This script extracts biomedical concepts (BCs) from Unified Study Data Model (USDM) JSON data and maps them to study design activities using JSONata expressions.
- Node.js (version 14 or higher recommended)
- npm (comes with Node.js)
Install the required dependencies by running:
npm install jsonata
-
Place a USDM JSON file in the project directory and name it sdw-lzzt-usdm.json (or update the file path in usdm-to-tdm.js).
-
Run the script using Node.js:
node usdm_bc.js -f <filepath to USDM JSON file>
- The script will process the USDM JSON file and output the converted SDTM TDM dataset to the console and as CSV.
- The script uses JSONata to extract and transform data from the USDM JSON file.
- It maps
activitiesto their associated biomedical concepts (BCs). - Each BC includes details such as:
- Concept name
- Type (e.g., Dataset Specialization, Biomedical Concept)
- Standard code and decode
- Data elements and their data types
The output will look like this:
[
{
"activityId": "Activity_24",
"activityName": "Hemoglobin A1C",
"bc": [
{
"usdmBcId": "BiomedicalConcept_32",
"concept": "Hemoglobin A1C Concentration in Blood",
"bcId": "C64849",
"bcShortname": "HBA1C",
"bcType": "Dataset Specialization",
"dataElements": "LBTESTCD, LBORRES, LBORRESU, LBSPEC, LBFAST",
"dataTypes": "null, float, null, null, null"
},
...
]
},
...
]
The file sdw-lzzt-usdm.json contains the study definition for the CDISC Pilot Study in the USDM v3.6 format. It was created using the Study Definitions Workbench from D4K. Website: Study Definitions Workbench
If you want more examples, like study definitions in USDM v4.0 format, check out the DDF-RA project on GitHub in the Examples folder. Website: DDF-RA