Skip to main content

A python package for importing and exporting the CDISC TransCelerate USDM, version 4, using FHIR

Project description

USDM4 FHIR

A Python package for converting between CDISC TransCelerate Unified Study Data Model (USDM), version 4, and HL7 FHIR M11 message bundles.

Supports export (USDM to FHIR) and import (FHIR to USDM) for multiple FHIR profile versions, including PRISM2 and PRISM3 message formats, as well as a Madrid export variant.

Features

  • Export USDM4 study definitions to FHIR M11 Bundle JSON (PRISM2, PRISM3, Madrid)
  • Import FHIR M11 Bundle JSON back to USDM4 study definitions (PRISM2, PRISM3)
  • Schedule of Activities export to FHIR
  • Round-trip fidelity testing between USDM and FHIR representations
  • Built on fhir.resources (Pydantic-based FHIR R5 models)

Installation

pip install usdm4_fhir

Quick Start

Export: USDM to FHIR

from usdm4_fhir.m11.export.export_prism3 import ExportPRISM3

exporter = ExportPRISM3(study, extra)
fhir_bundle_json = exporter.to_message()

Import: FHIR to USDM

from usdm4_fhir.m11.import_.import_prism3 import ImportPRISM3

importer = ImportPRISM3()
wrapper = await importer.from_message("path/to/fhir_bundle.json")
study = wrapper.study

Dependencies

  • usdm4 (>=0.18.0) -- USDM4 API model and assembler
  • fhir.resources (==7.1.0) -- FHIR R5 resource models
  • d4k_ms_base (>=0.3.0) -- shared microservice base

Development

Setup

git clone https://github.com/data4knowledge/usdm4_fhir.git
cd usdm4_fhir
python -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"

Commands

ruff format          # Format code
ruff check           # Lint
pytest               # Run tests

Build and Publish

python3 -m build --sdist --wheel
twine upload dist/*

Project Structure

src/usdm4_fhir/
  factory/        FHIR resource factories (ResearchStudy, PlanDefinition, etc.)
  m11/
    export/       USDM to FHIR export (PRISM2, PRISM3, Madrid)
    import_/      FHIR to USDM import (PRISM2, PRISM3)
    utility/      Shared utilities (address service, HTML parsing, tag references)
  soa/
    export/       Schedule of Activities FHIR export
  utility/        Data store
tests/            Integration test suite with round-trip verification

License

This project is licensed under the GNU General Public License v3.0. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usdm4_fhir-0.12.2.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usdm4_fhir-0.12.2-py3-none-any.whl (74.4 kB view details)

Uploaded Python 3

File details

Details for the file usdm4_fhir-0.12.2.tar.gz.

File metadata

  • Download URL: usdm4_fhir-0.12.2.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for usdm4_fhir-0.12.2.tar.gz
Algorithm Hash digest
SHA256 91a686724ea424113c332eb9d3699c1d2a1f2a636148589b6376ffb96320afd1
MD5 a6664c7192ee5754c106f79428e49a0e
BLAKE2b-256 7741ce2ef2496229c705c05a98e115c977406ebcedbd8bccbfffc1841ed507a3

See more details on using hashes here.

File details

Details for the file usdm4_fhir-0.12.2-py3-none-any.whl.

File metadata

  • Download URL: usdm4_fhir-0.12.2-py3-none-any.whl
  • Upload date:
  • Size: 74.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for usdm4_fhir-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2af72285616345a8d256ca01f3ae444325462cb16ba167fa55b1d1c7c2ebf04b
MD5 189bf886c0cdf7ef2d42d5bc55602968
BLAKE2b-256 22907cb2784ab880b131f59df5377191a5c718229d172c903f241dc0b8d3a8c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page