Manual Reference Source Test
import EDiaryService from 'clinical6/src/services/EDiaryService.js'
public class | source

EDiaryService

Extends:

AbstractServiceJsonApiService → EDiaryService

Service handling EDiary (Entries, Groups, and Templates) calls with specific endpoints.

Constructor Summary

Public Constructor
public

Update type to be ediary__entry_groups

Method Summary

Public Methods
public

async delete(object: Object, cacheMode: String): Promise

public

async get(cacheMode: String): Promise<EntryGroup[]|EntryGroup>

public

async getTemplates(entryGroup: Object, filters: Object, cacheMode: String): Promise<EntryTemplate[]|EntryTemplate>

Get eDiary entry templates

public

async insert(object: Object, cacheMode: String): Promise<EntryGroup>

public

async update(object: Object, cacheMode: String): Promise<EntryGroup>

Inherited Summary

From class AbstractService
public get
public set
public
private
From class JsonApiService
public

options: *

public

async delete(obj: Object, options: String): Promise

Call a DELETE request on the main obj.type expecting JSON API information.

public

async get(params: Object, options: String): Promise

Call a GET request expecting JSON API information.

public

async getChildren(parent: Object, child: Object, options: String): Promise

Call a GET request expecting JSON API information for children given a parent.

public

async insert(obj: Object, options: String): Promise

Call a POST request on the main obj.type expecting JSON API information.

public

async update(obj: Object, options: String): Promise

Call a PATCH request on the main obj.type expecting JSON API information.

Public Constructors

public constructor() source

Update type to be ediary__entry_groups

Override:

JsonApiService#constructor

Public Methods

public async delete(object: Object, cacheMode: String): Promise source

Call a DELETE request on the main obj.type expecting JSON API information.

Override:

JsonApiService#delete

Params:

NameTypeAttributeDescription
object Object

Object in which to delete

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise

Message

public async get(cacheMode: String): Promise<EntryGroup[]|EntryGroup> source

Call a GET request expecting JSON API information.

Override:

JsonApiService#get

Params:

NameTypeAttributeDescription
cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<EntryGroup[]|EntryGroup>

Promise object that returns one object or hashmap

Throw:

Clinical6Error

If missing token or missing required parameters

Example:

import { eDiaryService } from 'clinical6';

// You will be able to access these entry groups using the `get` method.
eDiaryService.get().then(entryGroups => console.log(entryGroups));

public async getTemplates(entryGroup: Object, filters: Object, cacheMode: String): Promise<EntryTemplate[]|EntryTemplate> source

Get eDiary entry templates

Params:

NameTypeAttributeDescription
entryGroup Object
  • nullable: false

Parameters used to get information from server (such as id)

filters Object
  • optional

Filters to modify result (date, entry_group_id)

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<EntryTemplate[]|EntryTemplate>

Promise object that returns one object or hashmap

Throw:

Clinical6Error

If missing token or missing required parameters

Example:

import { eDiaryService } from 'clinical6';

// You will be able to access these entry groups using the `get` method.
eDiaryService.getTemplates({ id: 15 }).then(templates => console.log(templates));

// You can also use the filter for automatic or manual
eDiaryService.getTemplates({ id: 15 }, { category: 'automatic' })
 .then(templates => console.log(templates));

Test:

public async insert(object: Object, cacheMode: String): Promise<EntryGroup> source

Call a POST request on the main obj.type expecting JSON API information.

Override:

JsonApiService#insert

Params:

NameTypeAttributeDescription
object Object

Object in which to insert

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<EntryGroup>

Inserted object

public async update(object: Object, cacheMode: String): Promise<EntryGroup> source

Call a PATCH request on the main obj.type expecting JSON API information.

Override:

JsonApiService#update

Params:

NameTypeAttributeDescription
object Object

Object in which to update

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<EntryGroup>

Updated object