Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

findCompletedFormData

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

Code Block
  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.

...

Code Block
  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.

...

Code Block
{
    "itemDataId": 223,
    "itemGroupDataId": 22,
    "formDataId": 9,
    "siteName": 12,
    "investigatorName": 'Dr. Johnson',
    "investigatorId": 19
}

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

Code Block
var itemDataContext = JSON.parse(getItemDataContext());
logger(itemDataContext);
var itemDataId = itemDataContext.itemDataId;
logger('itemDataId '+itemDataContext.itemDataId);
logger('investigatorId '+itemDataContext.investigatorId);
logger('investigatorName '+itemDataContext.investigatorName);

return itemDataId;

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:

Code Block
"collectedBarcodes": "F00123478134, F00123478196",
"transferBarcodes": "T00000022588, T00000022589, T00000022590, T00000022591, T00000022592, T00000022593, T00000022594, T00000022595",

logger

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

Code Block
logger('Some debug value '+value);

...