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.
- Transform cohort-study data into FHIR-compliant data
- Allows the definition of pairing rules between cohort-study data and FHIR resource properties
- Paring rules are specified in independent modules to make them testeable
To use this tool, ensure you have the following installed:
- Node.js (version 12 or higher)
- npm (Node Package Manager)
- TypeScript (installed globally)
- Clone the repository from GitHub:
git clone https://github.com/your-username/fhir-cohort-data-transformer.git
- Navigate to the project directory:
cd fhir-cohort-data-transformer
- Install the dependencies:
npm install
- Compile
tsc
- To create new pairing rules or JSON output-templates, refer to the developer manual.
-
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
- Start the viewer server
npm run dev-viewer
- Open editor at http://localhost:3000
-
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).