The FHIR Cohort Data Transformer is a TypeScript tool designed to transform cohort-study data into FHIR-compliant data. This tool allows you to specify and test the pairing rules between the cohort-study data and the properties of a given FHIR resource. Once you have defined these rules, you can link them to one or more FHIR-compliant templates.
To use this tool, ensure you have the following installed:
git clone https://github.com/your-username/fhir-cohort-data-transformer.git
cd fhir-cohort-data-transformer
npm install
tsc
To run the unit tests :
npm test
To run the linter :
npm run lint
To transform the available input samples (./fhirvalidation/sampleinputs), and check the validity of their corresponding transformations against a FHIR profile:
npm run validatesamples
To preview a transformation of a given input
npm run dev-viewer
Tp generate FHIR-compliant data based on the rules already defined, and the mapping configuration:
#Transform a single file, print the ouput to STDOUT
npm run transform -- ./fhirvalidation/sampleinputs/input-p1234.json
#Transform a single file, save the output on the given folder
npm run transform -- ./fhirvalidation/sampleinputs/input-p1234.json -o /tmp/out
#Transform all the .json files in a given folder, save the output on the given folder
npm run transform -- ./fhirvalidation/sampleinputs -o /tmp/out
The developer documentation with the description of the tool design, and further details for creating new templates/pairing rules can be found here (still under development).