EntryTemplate
Mixin Extends:
Helper class representing an eDiary Entry Template.
Example:
import { MobileUser, EntryTemplate } from 'clinical6';
const template = new EntryTemplate({
id: 12,
type: 'ediary__entry_templates',
attributes: {
category: 'manual',
created_at: '2017-06-27T20:32:59Z',
updated_at: '2017-06-27T20:32:59Z'
},
relationships: {
entry_group: {
data: {
id: '13',
type: 'ediary__entry_groups'
}
},
flow_process: {
data: {
id: '145',
type: 'data_collection__flow_processes'
}
}
}
});
Constructor Summary
Public Constructor | ||
public |
constructor(json: Object) Constructor for helper class representing an eDiary Entry Template |
Member Summary
Public Members | ||
public get |
|
|
public set |
|
|
public get |
|
|
public set |
|
Method Summary
Public Methods | ||
public |
Add eDiary Entry |
Inherited Summary
From class EntryTemplateModel | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
Public Constructors
public constructor(json: Object) source
Constructor for helper class representing an eDiary Entry Template
Override:
EntryTemplateModel#constructorParams:
Name | Type | Attribute | Description |
json | Object | json api response from server |
Public Methods
public async addEntry(entry: Entry, mobileUser: MobileUser): Promise<Entry[]|Entry> source
Add eDiary Entry
Throw:
If missing token or missing required parameters |
Example:
import { MobileUser, EntryTemplate } from 'clinical6';
const mobileUser = new MobileUser({ id: 5, ... });
const template = new EntryTemplate({ id: 5, ... });
const data = { date: '2018-06-02' };
// You can add an entry using the `addEntry` method
template.addEntry(mobileUser, data).then(entry => console.log(entry));