Skip to main content

FHIR Library

This Python library is simplifying work with FHIR library focused on BBMRI-ERIC biobanks. This library works with Patient, Specimen, and Condition resources, along with extensions needed for these resources as defined by simplifier.net/bbrmi.de.

Documentation of this library is available at fhir-biobank.readthedocs.io

Installation

pip install fhir-biobank

Usage

This library allows you to easily create FHIR resources along with all the data in a single constructor. Use case of creating a simple Patient resource:

from fhir_biobank import PatientResource

internal_id = "0"
patient_identifier = "4816522"
patient_gender = "female"
patient_birthdate = date(2000, 12, 11)
patient = PatientResource(internal_id, patient_identifier, patient_gender, patient_birthdate)

Standard action is to convert FHIR resource to a JSON representation. Use case of converting Patient resource to a JSON representation:

json_representation = patient.patientJSON()

JSON representation of the Patient resource initialized above looks like this:

{
  "id": "0",
  "meta": { "profile": [ "https://fhir.bbmri.de/StructureDefinition/Patient" ] },
  "birthDate": "2000-12-11",
  "deceasedBoolean": "False",
  "gender": "female",
  "identifier": [
    {
      "type": {
        "coding": [
          {
            "code": "ACSN",
            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
            "userSelected": "True"
          }
        ]
      },
      "use": "usual",
      "value": "4816522"
    }
  ],
  "multipleBirthBoolean": "False",
  "resourceType": "Patient"
}

In order to upload resource to a server, creating Bundle resource containing all of the resources that you want to upload is necessary. Bundle contains list of Entry resources, where each Entry resource represents specific resource(for example Patient resource). Here is a example how to create Bundle resource containing the Patient resource made earlier:

from fhir_biobank.bundle import Bundle, Entry

fullURL_patient_resource = "https://example.com/patient/0"
shortURL_patient_resource = "patient/0"
entry = Entry(patient, fullURL_patient_resource, shortURL_patient_resource)
entries = [entry]
bundle_id = "424242"
bundle = Bundle(bundle_id, entries)

Metadata

Release files for fhir-biobank 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fhir-biobank 0.1.3
File Size Uploaded Provenance Actions
fhir_biobank-0.1.3.tar.gz 14.3 kB Without provenance Details for fhir_biobank-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fhir-biobank 0.1.3
File Interpreter ABI Platform Actions
fhir_biobank-0.1.3-py3-none-any.whl Python 3 none any Details for fhir_biobank-0.1.3-py3-none-any.whl

Total release size: 34.2 kB

Release files / fhir_biobank-0.1.3.tar.gz

Download URL fhir_biobank-0.1.3.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
08a792d4dcefbc9be69406db2f5deb895736bafe891d622166535b73ce5acb22
BLAKE2b-256 checksum
How to use checksums
94c100319bd516ece34880773096970496c823693b069badd92345f67d5bd640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.0

Release files / fhir_biobank-0.1.3-py3-none-any.whl

Download URL fhir_biobank-0.1.3-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ce4c48df354b9143cf22d6bacd30ca80b445fc220c9ad0770f95a96bdd728ba
BLAKE2b-256 checksum
How to use checksums
f8edd24418f7d5956bc30da71569d8a8c81e04cec7f3a44c0043970091006802
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.0

Security for fhir-biobank 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page