ConsentForm
Mixin Extends:
Helper class representing a Consent Form.
Example:
// To get a list of ConsentForms use clinical6.get
import { clinical6, ConsentForm } from 'clinical6';
clinical6.get(ConsentForm).then(c => console.log(c));
// To get a single ConsentForm, you can also use clinical6
clinical6.get({ id: 5, type: 'consent__forms'});
// To save or insert, you can either use the .save() capability or clinical6
myConsentForm.save(); // insert if no id, save if id
clinical6.insert(new ConsentForm({...}));
clinical6.update(myConsentForm);
Constructor Summary
Public Constructor | ||
public |
constructor(json: Object) Constructor for helper class representing a Consent Form |
Member Summary
Public Members | ||
public get |
|
|
public set |
|
|
public get |
|
|
public set |
|
Method Summary
Public Methods | ||
public |
async getVersions(options: String): Promise Gets the ConsentFormVersions associated to this ConsentForm. |
|
public |
async save(): Promise<ConsentForm> Saves a consent form (insert if id doesn't exist, update if it does) |
Inherited Summary
From class ConsentFormModel | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Public Constructors
public constructor(json: Object) source
Constructor for helper class representing a Consent Form
Override:
ConsentFormModel#constructorParams:
Name | Type | Attribute | Description |
json | Object | json api response from server |
Public Members
public get consentFormVersions: ConsentFormVersion[] source
public set consentFormVersions: ConsentFormVersion[] source
public get consentStrategy: ConsentStrategy source
public set consentStrategy: ConsentStrategy source
Public Methods
public async getVersions(options: String): Promise source
Gets the ConsentFormVersions associated to this ConsentForm.
Example:
import { ConsentForm, clinical6 } from 'clinical6';
const consentForm = new ConsentForm({ id: 23 });
consentForm.getVersions({ id: 5 });
// Combined with clinical6.get
clinical6.get(ConsentForm).then(consentForms => { consentForms[0].getVersions() });
public async save(): Promise<ConsentForm> source
Saves a consent form (insert if id doesn't exist, update if it does)
Example:
import { ConsentForm, clinical6 } from 'clinical6';
// Inserts new consentForm (no existing id)
const consentForm = new ConsentForm(
"type": "consent__forms",
"attributes": {
"name": "a consent form name",
"enabled": true
});
consentForm.save();
// Updates existing consentForm(has existing id)
clinical6.get(ConsentForm).then(consentForms => consentForms[0].save());