Skip to main content

FHIR Resources as Model Class

Project description

FHIR® Resources (R4)

https://img.shields.io/pypi/v/fhir.resources.svg Supported Python Versions https://img.shields.io/travis/nazrulworld/fhir.resources.svg https://codecov.io/gh/nazrulworld/fhir.resources/branch/master/graph/badge.svg HL7® FHIR®

All FHIR Resources are available as python class with built-in initial validation, exporter as json value.

Installation

Just a simple pip install fhir.resources or easy_install fhir.resources is enough. But if you want development version, just clone from https://github.com/nazrulworld/fhir.resources and python setup.py install.

Example: 1: Resource object created from json string:

>>> from fhir.resources.organization import Organization
>>> from fhir.resources.address import Address
>>> json_dict = {"resourceType": "Organization",
...     "id": "mmanu",
...     "active": True,
...     "name": "Acme Corporation",
...     "address": [{"country": "Swizterland"}]
... }
>>> org = Organization(json_dict)
>>> isinstance(org.address[0], Address)
>>> True
>>> org.address[0].country == "Swizterland"
True
>>> org.as_json()['active'] is True
True

Example: 2: Construct resource object in python way:

>>> org = Organization()
>>> org.id = "mmanu"
>>> org.active = True
>>> org.name = "Acme Corporation"
>>> org.address = list()
>>> address = Address()
>>> address.country = "Swizterland"
>>> org.address.append(address)
>>> org.as_json() == json_dict
True

Example: 3: Auto validation while providing wrong datatype:

>>> from fhir.resources.fhirabstractbase import FHIRValidationError
>>> try:
...     org = Organization({"id": "fmk", "address": ["i am wrong type"]})
...     raise AssertionError("Code should not come here")
... except FHIRValidationError:
...     pass

Release and Version Policy

This package is following FHIR® release and versioning policy, for example say, FHIR releases next version 4.0.1, we also release same version here.

Credits

All FHIR® Resources (python classes) are generated using fhir-parser.

This package skeleton was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

© Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks owned by Health Level Seven International

History

4.0.0 (2019-01-14)

  • see version info at 4.0.0b1 section.

4.0.0b1 (2019-01-13)

Version Info (R4)

[FHIR]
FhirVersion=4.0.0-a53ec6ee1b
version=4.0.0
buildId=a53ec6ee1b
date=20181227223754

3.0.1 (2019-01-13)

Version Info (STU3)

[FHIR]
FhirVersion=3.0.1.11917
version=3.0.1
revision=11917
date=20170419074443

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.resources-4.0.0.tar.gz (406.3 kB view details)

Uploaded Source

Built Distribution

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

fhir.resources-4.0.0-py2.py3-none-any.whl (685.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file fhir.resources-4.0.0.tar.gz.

File metadata

  • Download URL: fhir.resources-4.0.0.tar.gz
  • Upload date:
  • Size: 406.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7

File hashes

Hashes for fhir.resources-4.0.0.tar.gz
Algorithm Hash digest
SHA256 f0ac58c15857460d64afe6b0fa16e8a7da5094a09dc6582d929b0e92ac8cd106
MD5 854a5dbdb1250615eca237c784f455b8
BLAKE2b-256 a8ef7a06207263bfb2ffd917b26bbca13aae33b71afb398036707eafff2cd439

See more details on using hashes here.

File details

Details for the file fhir.resources-4.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: fhir.resources-4.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 685.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7

File hashes

Hashes for fhir.resources-4.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2557453940d6ee2ab542c1a8229ff861dbd6b6f79eac607828d0013ab4fe619b
MD5 e9316520155d4949878dde5deeec6ad4
BLAKE2b-256 dcf5df3744dce09497936a2c5772810cfcbf7a16b1a9f30c588201a1c6a00d50

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