Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fhir-biobank

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fhir-biobank

Python library working with FHIR standard in scope of biobanks MIABIS requirements

  • 0.1.3
  • PyPI
  • Socket score

Maintainers
1

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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc