Synthetic XML data generator for CCE FHIR profiles.
This repository contains Rust code to generate synthetic XML data for CCE FHIR models.
There are a couple of creates that support FHIR:
-
fhir-sdk - is being used in other projects, but it only supports serialization and deserialization to and from JSON, and XML is not supported yet.
-
Hence, fhirbolt is being used in this project as it supports XML.
There are, a total of 10 profiles -
- 4 Observation profiles (Histology, TNMc, TNMp, VitalStatus)
- 2 Procedure profiles (Operation, Radiotherapy)
- and 1 each of Patient, Condition, Specimen & MedicationStatement
This repository implements a command line tool, to be run from the command prompt. It accepts the following command line arguments -
Usage: cce-fhir-gen [OPTIONS]
Options:
-n, --number <NUMBER>
Number of resources to generate
[default: 1]
-r, --resource-type <RESOURCE_TYPE>
Type of resource to generate
[default: bundle]
Possible values:
- bundle: Generate whole Bundle
- patient: Generate Patient
- condition: Generate Condition
- specimen: Generate Specimen
- observation-histology: Generate Observation Histology
- observation-vital-status: Generate Observation VitalStatus
- observation-tn-mc: Generate Observation TNMc
- procedure-radiotherapy: Generate Procedure Radiotherapy
- procedure-operation: Generate Procedure Operation
- systemic-therapy-medication-statement: Generate Systemic Therapy Medication Statement
-o, --output-mode <OUTPUT_MODE>
Where to store the resources
[default: screen]
Possible values:
- screen: Show the generated XML in the terminal
- file: Store the generated XML in a file
- api-call: Call the given API endpoint (WIP)
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Parameter | Default value | Meaning |
---|---|---|
n | 1 | a value greater than 1 generates a bundle containing multiple resources of the resource type specified by r |
r | bundle | generates a bundle containing one each of the other resources |
o | screen | displays the generated data on the screen |
In development mode, we tend to run cargo run
command for running the application. In this case, you can use:
cargo run -- -n 100 -r patient
Copyright © 2023 The Samply Community
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.