This script converts Unified Study Data Model (USDM) JSON data into Study Data Tabulation Model (SDTM) Trial Design Model (TDM) datasets using JSONata expressions.
- Node.js (version 14 or higher recommended)
- npm (comes with Node.js)
Install the required dependencies by running:
npm install jsonata
npm install json-2-csv
-
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 usdm2tdm.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
armsandelementsto the SDTM TA domain structure. - It maps
criteriato the SDTM TI domain structure. - It maps
encountersto the SDTM TV domain structure. - It maps
elementsto the SDTM TE domain structure. - It maps
characteristicsandobjectivesto the SDTM TI domain structure.
The output will look like this:
[
{
STUDYID: 'Study_CDISC PILOT - LZZT',
DOMAIN: 'TA',
ARMCD: 'StudyArm_1',
ARM: 'Placebo',
TAETORD: 1,
ETCD: 'EL1',
ELEMENT: 'Screening'
},
...
]
I referred to the USDM v3 IG for this program. Website: Creation of SDTM Trial Design Domains
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
I am leaving space for post-processing to make these SDTM TDM datasets fully conformant. That part is outside the scope of this script.