Skip to main content

A Python implementation of the HL7 FHIR MolecularDefinition resource that supports associated profiles and enables bidirectional translation between MolecularDefinition profiles and genomic representations, including VRS, HGVS, and SPDI.

Project description

fhir-moldef

Overview

Welcome to the fhir-moldef repository. This project provides a Python implementation of the HL7 (Health Level Seven) Fast Healthcare Interoperability Resources (FHIR) Molecular Definition standard. It enables users to create instances of the MolecularDefinition resource and currently supports three profiles: Sequence, Allele, and Variant.

Additionally, this repository supports seamless, bidirectional translation between Global Alliance for Genomics and Health (GA4GH) Variant Representation Specification (VRS) Alleles (v2.0) and the FHIR Allele Profile, enabling interoperability between the two standards.

Disclaimer

This project uses the MolecularDefinition schema from the latest in-progress development version: Work in Progress Schema. This page may occasionally be unavailable due to active development.

It does not match the schema in the HL7 FHIR 6.0.0 Ballot 2 release: FHIR Ballot 2 Schema.

Core Functionality

Category Currently Supported
Resource Generation of HL7 FHIR MolecularDefinition resources
Profiles Sequence, Allele, and Variant profiles
Translation Bidirectional translation between VRS 2.0 and FHIR (full + minimal)
Notebooks Interactive Jupyter notebooks with examples (see the Notebooks README for details)
Pipeline Extraction of VRS Allele objects from ClinVar variation files and translation into the FHIR Allele Profile

Installation Status

fhir-moldef is available on PyPI: https://pypi.org/project/fhir-moldef/

For users who want to work directly with the source code, local development setup instructions are also provided below.

Prerequisites

  • Python 3.11–3.13
  • Virtual environment (uv recommended): used to manage project dependencies

Dependencies & Infrastructure

The following infrastructure is required only for the VRS ↔ FHIR translation functionality:

  • PostgreSQL 14
  • SeqRepo (biocommons.seqrepo)

These dependencies are not required if you only plan to instantiate MolecularDefinition profiles.

For instructions on installing and configuring SeqRepo, see the VRS-Python SeqRepo installation guide.

Containerized setup instructions using Podman are planned, including configuration for running SeqRepo (and future UTA support).

Installation Steps

1. Install fhir-moldef with pip

fhir-moldef is available on PyPI.

pip install fhir-moldef

2. Optional: install additional dependencies

Additional dependency groups are available for translator functionality, example notebooks, and development tools. You can choose the dependency groups that best fit your use case.

To install all optional dependency groups:

pip install "fhir-moldef[translators,notebooks,dev]"

Local Development Setup

Clone the repository and create a local development environment if you want to work directly with the source code.

git clone https://github.com/InformaticsGenomicMedicine/fhir-moldef.git
cd fhir-moldef

uv venv
source .venv/bin/activate

# Optional extras: dev, notebooks, translators
# Install all extras with: uv sync --all-extras
# Install multiple extras with: uv sync --extra dev --extra notebooks
uv sync --extra dev

Contributing

Contributions are welcome! Please feel free to fork the repository and submit a pull request.
You can also report bugs or suggest improvements by opening an issue.

Acknowledgments

This project builds upon the following community standards and open-source implementations.

Standards

Software

We gratefully acknowledge the communities and contributors who develop and maintain these standards and software projects.

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

fhir_moldef-0.7.1.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

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

fhir_moldef-0.7.1-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

Details for the file fhir_moldef-0.7.1.tar.gz.

File metadata

  • Download URL: fhir_moldef-0.7.1.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fhir_moldef-0.7.1.tar.gz
Algorithm Hash digest
SHA256 3c9bea1e4d7e97d34e074ada04d0c1ea4f7159849ad973b96588f4b344725bdb
MD5 d1ae2c13b31239e175425b5aa2d4e073
BLAKE2b-256 03e14d2d0790816f8f153c369fe6449a4811fa9a303421b57c059ee681dcde64

See more details on using hashes here.

File details

Details for the file fhir_moldef-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: fhir_moldef-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 56.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fhir_moldef-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25d122377a5f60f6fd429720abdcc8942447e6463c7c33aeadb804b21f4f9fc8
MD5 c4e2303f6b26d66f3a3db951a31e1ec1
BLAKE2b-256 aeef690f472bcbff0c12941042723c01defcec541b7fcdf1ae53a4a6ba931782

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