© 2024 IQVIA - All Rights Reserved

Implicit Methods

Summary

All invocations of formal expressions have available to them a number of custom methods injected into their execution context by ClinSpark. These methods provide access to specific access to backend functionality as described below.

customErrorMessage

This method is meant to be used only for edit checks. When invoked, it overrides the default error message configured in the edit check with the value of the parameter.

customErrorMessage('This is a new error message.');

findCompletedFormData

This method looks up previously collected study data for the current subject. Timepoint is optional.

var baselineForms = findCompletedFormData("Study Event Name", "Form Name, "TIMEPOINT");

Note that this method will return ALL collected instances of matching form data, including nonconformant and canceled data. To account for this be sure to filter the returned data accordingly.

findFormData

This method looks up previously collected study data for the current subject. Timepoint is optional.

var baselineForms = findFormData("Study Event Name", "Form Name, "TIMEPOINT");

Note that this method will return ALL collected instances of matching form data, including nonconformant and canceled data. To account for this be sure to filter the returned data accordingly.

getItemDataContext

This method takes no parameters, and returns a JSON object which exposes the various context data pertaining to the itemData, including unique primary database keys of the itemData, and its enclosing itemGroupData and formData objects. These values are useful if a unique identifier for this collected data entity is needed.

Here is an example of the JSON returned:

Here’s an example of accessing this context data, parsing it in Javascript and working with data:

Note that this is standard in 22.3, but can be made available to older ClinSpark environments with a support ticket.

In 23.3 and later this context contains additional data, listing all collection item data barcodes for all Specimen Containers, and additionally a transferBarcodes element which shows all transfers which were created from an itemData:

logger

This method emits the parameter as debug output in the Method and Edit Check tooling.


Exported and Printed Copies Are Uncontrolled