Manual Reference Source Test
public class | source

ConsentFormVersion

Helper class representing a Consent Form Version.

Example:

// To get a list of ConsentFormVersions use clinical6.get
import { clinical6, ConsentFormVersion } from 'clinical6';
clinical6.get(ConsentFormVersion).then(c => console.log(c));

// To get a single ConsentFormVersion, you can also use clinical6
clinical6.get({ id: 5, type: 'consent_form_versions'});

// To save or insert, you can either use the .save() capability or clinical6
myConsentFormVersion.save(); // insert if no id, save if id
clinical6.insert(new ConsentFormVersion({...}));
clinical6.update(myConsentFormVersion);

Test:

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

Constructor for helper class representing a Consent Form Version

Member Summary

Public Members
public get
public set
public get
public set
public
public set
public get
public
public set
public get
public get
public set
public get

templatable: AgreementTemplate | PaperTemplate

public set

templatable: AgreementTemplate | PaperTemplate

Method Summary

Public Methods
public

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

Gets the approver group assignment associated to this ConsentFormVersion.

public

Saves a consent form version (insert if id doesn't exist, update if it does)

Inherited Summary

From class ConsentFormVersionModel
public
public

Static Public Members

public static get type: String source

Public Constructors

public constructor(json: Object) source

Constructor for helper class representing a Consent Form Version

Override:

ConsentFormVersionModel#constructor

Params:

NameTypeAttributeDescription
json Object

json api response from server

Public Members

public get approverGroups: ApproverGroup[] source

public set approverGroups: ApproverGroup[] source

public get approvers: Object[] source

public set approvers: Object[] source

public assignments: * source

public set consentForm: ConsentForm source

public get consentForm: ConsentForm source

public formVersions: * source

public set language: Language source

public get language: Language source

public get site: Site source

public set site: Site source

public get templatable: AgreementTemplate | PaperTemplate source

public set templatable: AgreementTemplate | PaperTemplate source

Public Methods

public async getApproverGroupAssignments(params: Object, options: String): Promise source

Gets the approver group assignment associated to this ConsentFormVersion.

Params:

NameTypeAttributeDescription
params Object
  • optional

Parameters used to get information from server

params.id Number
  • optional

Id to get data from the server

params.type String
  • optional

Type to be used for storage

params.filters Object
  • optional

Filters to be used for get

options String
  • optional

Modify the nature of the call and response

options.url String
  • optional

Override the url for this call

options.cacheMode String
  • optional

Override the caching method for this call

Return:

Promise

Promise with data (array or object)

Example:

import { ConsentFormVersion, clinical6 } from 'clinical6';
const consentFormVersion = new consentFormVersion({ id: 23 });
consentFormVersion.getApproverGroupAssignments({ id: 5 });

// Combined with clinical6.get
clinical6.get(ConsentFormVersion).then(consentFormVersions => { consentFormVersions[0].getApproverGroupAssignments() });

Test:

public async save(): Promise<ConsentFormVersion> source

Saves a consent form version (insert if id doesn't exist, update if it does)

Return:

Promise<ConsentFormVersion>

Returns a promise via ajax call.

Example:

import { ConsentFormVersion, clinical6 } from 'clinical6';

// Inserts new consentFormVersion (no existing id)
const consentFormVersion = new ConsentFormVersion(
  "type": "consent__form_versions",
  "attributes": {},
  "relationships": {
  "agreement_template": {
   "data": {
      "id": 8,
      "type": "agreement__templates"
    }
  },
  "site": {
    "data": {
      "id": 9,
      "type": "trials__sites"
    }
  }
 });

consentFormVersion.save();

// Updates existing consentFormVersion(has existing id)
clinical6.get(ConsentFormVersion).then(consentFormVersions => consentFormVersions[0].save());

Test: