Skip to content

samply/cce-fhir-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cce-fhir-gen

Synthetic XML data generator for CCE FHIR profiles.

This repository contains Rust code to generate synthetic XML data for CCE FHIR models.

FHIR library

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.

Profiles

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

Usage

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

Parameters and their default values

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

How to run

Development mode

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

License

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.

About

Synthetic XML data generator for CCE FHIR profiles.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages