...
From there you can format it using the tool of your choice to see the output you’re looking for. A Google search for “prettify JSON” will help locate free online tools; the Foundry Health internal team uses VS Code to do this.
Code Block |
---|
{ "item": { "nameid": "VS_Significance"136424, "dataType": "string", "dataCollectionStatus": "Unsaved", // Unique ID for the item data "sasFieldName": "VSCLSIG", "codeListItemsname": ["AE_START_DATE", // Name {of the item (e.g., 'Adverse Event Start Date') "codedValuedataType": "CSincompleteDatetime", // Data type (e.g., 'string', 'date', 'incompleteDatetime') "decodedataCollectionStatus": "Clinically Significant" Complete",// Status: 'Complete', 'In Progress', etc. }, "sasFieldName": "AESTDTC", // {Corresponding SAS field name "codedValuevalue": "NCS2024-08- T13:39: ", // Captured value (can be incomplete) "decode": "Not Clinically Significant"codeListItems": [ } // Optional: List of allowed coded values ], "measurementUnits": [], { "measurementUnit": null, "valuecodedValue": null"CS", "outOfRange": false, // Coded value "nonconformantMessage": null, "lengthdecode": null,"Clinically Significant" // Meaning of coded value "significantDigits": null}, "canceled": false{ "codedValue": "NCS", } } |
formJson
The formJson object contains the complete formData along with all contained itemGroupData and their child itemData.
In addition, quite a bit of context metadata can be found within the formJson object:
Code Block |
---|
"form": { "name": "Demographics", "studyEventName": "Day -28 to Day -2", "cohort": { "id": 88, "decode": "Not Clinically Significant" } ], "measurementUnits": [], // Array of applicable measurement units "measurementUnit": null, // Specific measurement unit (if used) "outOfRange": true, // Whether the value is out of an acceptable range "nonconformantMessage": null, // Message if the item is nonconformant "length": null, // Optional: Length constraint for the value "significantDigits": null, // Optional: Number of significant digits allowed "canceled": false // Whether this item has been canceled } } |
formJson
The formJson object contains the complete formData along with all contained itemGroupData and their child itemData.
In addition, quite a bit of context metadata can be found within the formJson object:
Code Block |
---|
{ "form": { "name": "Form Name", // Name of the form (e.g., 'Demographics') "studyEventName": "Event Name", // Name of the study event "cohort": { // Cohort-related metadata "id": 88, "name": "Cohort Name", "epoch": { "id": 80, "name": "Screening" // Epoch or phase name } }, "timepoint": null, // Timepoint (if applicable) "canceled": false, // Whether the form is canceled "dataCollectionStatus": "Complete", // Status: Complete, In Progress, etc. "subject": { // Information about the subject/volunteer "id": 165, "screeningNumber": "S440113001", // Subject screening number "randomizationNumber": "1302", // Randomization number "subjectStudyStatus": "Active", // Status of subject in study "volunteer": { // Volunteer details "id": 135, "initials": "M-M", "age": 30, "sexMale": true, "dateOfBirth": "1990-XX-05" // Supports incomplete dates } }, "itemGroups": [ // Array of item groups within the form { "itemGroupRepeatKey": 1, // Identifier for repeated groups "items": [ // Array of individual items { "name": "Item Name", // Name of the item "dataType": "string", // Data type (e.g., string, date, etc.) "name": "12Nov2020", "epochvalue": { "some value", // Collected data value "id": 80, "namecanceled": "Screening" false, // Whether the item is canceled } }, "timepoint": null, "canceled": false, "dataCollectionStatussasFieldName": "Complete" |
Here you will also find metadata about the subject/volunteer
Code Block |
---|
"subject": { "id": 165, "SAS_NAME", // SAS field name mapping "locked": false, "screeningNumber": "S440113001", "leadInNumber": "L0001", "randomizationNumbercodeListItems": "1302",[] // "subjectStudyStatus"Optional: "Active", Code list if applicable "subjectEligibilityType": "Unspecified", "volunteer": { "id": 135, } "initials": "M-M", ] "age": 30, "sexMale": true, } "dateOfBirth": "1990-XX-05" ] } } |
All of this data can be directly accessed from the expression.
...
2, If you want to write JavaScript in strict mode, and get strict mode syntax checking, paste this in the first two lines:/* globals itemJson, formJson, findFormData, logger, customErrorMessage, findCompletedFormData, findFormData, getItemDataContext */
'use strict';
If you are using other implicit data/methods not included here and get “undefined variable” errors in those lines, add those variables/functions to the list of “globals”.
...