fhirspec


Namefhirspec JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/nazrulworld/fhirspec
SummaryPython representation of FHIR® https://www.hl7.org/fhir/ specification.
upload_time2022-12-22 21:56:53
maintainerNone
docs_urlNone
authorMd Nazrul Islam
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            =========================
FHIR Specification Parser
=========================

.. image:: https://img.shields.io/pypi/v/fhirspec.svg
        :target: https://pypi.org/project/fhirspec/

.. image:: https://img.shields.io/pypi/pyversions/fhirspec.svg
        :target: https://pypi.org/project/fhirspec/
        :alt: Supported Python Versions

.. image:: https://img.shields.io/travis/com/nazrulworld/fhirspec.svg
        :target: https://app.travis-ci.com/github/nazrulworld/fhirspec

.. image:: https://codecov.io/gh/nazrulworld/fhirspec/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/nazrulworld/fhirspec/branch/master
   :alt: Test Coverage

.. image:: https://img.shields.io/lgtm/grade/python/g/nazrulworld/fhirspec.svg?logo=lgtm&logoWidth=18
    :target: https://lgtm.com/projects/g/nazrulworld/fhirspec/context:python
    :alt: Language grade: Python

.. image:: https://img.shields.io/pypi/l/fhirpath.svg
   :target: https://pypi.org/project/fhirspec/
   :alt: License

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black

.. image:: https://www.hl7.org/fhir/assets/images/fhir-logo-www.png
        :target: https://www.hl7.org/fhir/
        :alt: HL7® FHIR®

Python representation of FHIR® https://www.hl7.org/fhir/ specification. Idea and class structure based
on https://github.com/smart-on-fhir/fhir-parser.

Usages
======

``fhirspec.Configuration``
--------------------------
A class that is controlling the behavior of  ``fhirspec.FHIRSpec``, powerful but very convenient.
In several ways it is possible to construct the instance, ie. from ``JSON`` file (has support for `json5 <https://json5.org/>`_),
from python module, from ``TOML`` file, from plain text file, and so on.
**Only capital letter's variables are accepted**


>>> import pathlib
>>> import os
>>> from foo.module import bar
>>> from fhirspec import Configuration
>>> config1 = Configuration.from_module(bar)
>>> config2 = Configuration.from_json_file(pathlib.Path("/json/file/location"))
>>> data_dict = {
... "BASE_URL": pathlib.Path(os.path.abspath(__file__))
... }
>>> config3 = Configuration(data_dict=data_dict)



``fhirspec.FHIRSpec``
---------------------

The main loader class, to construct this instance, ``Configuration:`` is required parameter and additionally
source of json files. Bellows variables should have to be present in configuration.


	required_variables = [
		"WRITE_RESOURCES", "CLASS_MAP", "REPLACE_MAP", "NATIVES",
		"JSON_MAP", "JSON_MAP_DEFAULT", "RESERVED_MAP", "ENUM_MAP",
		"ENUM_NAME_MAP", "DEFAULT_BASES", "MANUAL_PROFILES", "CAMELCASE_CLASSES",
		"CAMELCASE_ENUMS", "BACKBONE_CLASS_ADDS_PARENT", "RESOURCE_MODULE_LOWERCASE",]


>>> from fhirspec import Configuration
>>> from fhirspec import FHIRSpec
>>> config = Configuration(
... {
...   "BASE_PATH": "",
      "WRITE_RESOURCES": True
... }
... )
>>> spec = FHIRSpec(config)
>>> "patient" in spec.profiles
True


``download``
------------

A perfect tool to download any file from server, no dependency on third-party library.

>>> from fhirspec import download
>>> url = "http://www.africau.edu/images/default/sample.pdf"
>>> download_directory = pathlib.Path(os.path.expanduser("~/Downloads"))
>>> download(url, download_directory)
>>> (download_directory / "sample.pdf").exists()
True


History
=======

0.4.0 (22-12-2022)
------------------

- FHIR R4B specification support has been added.

0.3.0 (18-03-2021)
------------------

- Now each ``FHIRClass`` contains original sequence of it's properties(elements) defined in specification.
- Additionally ``FHIRClass.expanded_properties_sequence`` returns all available properties (combined with parent) sequentially.


0.2.5 (02-11-2020)
------------------

- This release contains full fixes of ``FHIRStructureDefinitionElement.represents_class`` issues.


0.2.4 (02-11-2020)
------------------

- No more improvements, just same release of  ``0.2.1`` and overrides to the faulty release of ``0.2.3``.


0.2.3 (24-09-2020)
------------------

**Update to version ``0.2.4`` is recommended**

- use ``FHIRStructureDefinitionElement.is_main_profile_element`` instead of ``FHIRStructureDefinitionElement.represents_class``

0.2.1 (15-06-2020)
------------------

- Minor improvement on ``FHIRUnitTest`` handling empty value.

0.2.0 (06-06-2020)
------------------

- ``FHIRClass.known`` property has been changed to ``FHIRClass.__know_classes__`` and ``FHIRClass.is_known_class``.

- Make supports for Python 3.6 and 3.9

0.1.0 (28-04-2020)
------------------

- Initial release [nazrulworld]


------------

© Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks
owned by `Health Level Seven International <https://www.hl7.org/legal/trademarks.cfm?ref=https://pypi.org/project/fhir-resources/>`_

**"FHIR® is the registered trademark of HL7 and is used with the permission of HL7.
Use of the FHIR trademark does not constitute endorsement of this product by HL7"**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nazrulworld/fhirspec",
    "name": "fhirspec",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Md Nazrul Islam",
    "author_email": "email2nazrul@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3c/d5/b09b748709cc4b8b1134307871952ba049d225e8bdd82539b97c62437f86/fhirspec-0.4.0.tar.gz",
    "platform": null,
    "description": "=========================\nFHIR Specification Parser\n=========================\n\n.. image:: https://img.shields.io/pypi/v/fhirspec.svg\n        :target: https://pypi.org/project/fhirspec/\n\n.. image:: https://img.shields.io/pypi/pyversions/fhirspec.svg\n        :target: https://pypi.org/project/fhirspec/\n        :alt: Supported Python Versions\n\n.. image:: https://img.shields.io/travis/com/nazrulworld/fhirspec.svg\n        :target: https://app.travis-ci.com/github/nazrulworld/fhirspec\n\n.. image:: https://codecov.io/gh/nazrulworld/fhirspec/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/nazrulworld/fhirspec/branch/master\n   :alt: Test Coverage\n\n.. image:: https://img.shields.io/lgtm/grade/python/g/nazrulworld/fhirspec.svg?logo=lgtm&logoWidth=18\n    :target: https://lgtm.com/projects/g/nazrulworld/fhirspec/context:python\n    :alt: Language grade: Python\n\n.. image:: https://img.shields.io/pypi/l/fhirpath.svg\n   :target: https://pypi.org/project/fhirspec/\n   :alt: License\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\n.. image:: https://www.hl7.org/fhir/assets/images/fhir-logo-www.png\n        :target: https://www.hl7.org/fhir/\n        :alt: HL7\u00ae FHIR\u00ae\n\nPython representation of FHIR\u00ae https://www.hl7.org/fhir/ specification. Idea and class structure based\non https://github.com/smart-on-fhir/fhir-parser.\n\nUsages\n======\n\n``fhirspec.Configuration``\n--------------------------\nA class that is controlling the behavior of  ``fhirspec.FHIRSpec``, powerful but very convenient.\nIn several ways it is possible to construct the instance, ie. from ``JSON`` file (has support for `json5 <https://json5.org/>`_),\nfrom python module, from ``TOML`` file, from plain text file, and so on.\n**Only capital letter's variables are accepted**\n\n\n>>> import pathlib\n>>> import os\n>>> from foo.module import bar\n>>> from fhirspec import Configuration\n>>> config1 = Configuration.from_module(bar)\n>>> config2 = Configuration.from_json_file(pathlib.Path(\"/json/file/location\"))\n>>> data_dict = {\n... \"BASE_URL\": pathlib.Path(os.path.abspath(__file__))\n... }\n>>> config3 = Configuration(data_dict=data_dict)\n\n\n\n``fhirspec.FHIRSpec``\n---------------------\n\nThe main loader class, to construct this instance, ``Configuration:`` is required parameter and additionally\nsource of json files. Bellows variables should have to be present in configuration.\n\n\n\trequired_variables = [\n\t\t\"WRITE_RESOURCES\", \"CLASS_MAP\", \"REPLACE_MAP\", \"NATIVES\",\n\t\t\"JSON_MAP\", \"JSON_MAP_DEFAULT\", \"RESERVED_MAP\", \"ENUM_MAP\",\n\t\t\"ENUM_NAME_MAP\", \"DEFAULT_BASES\", \"MANUAL_PROFILES\", \"CAMELCASE_CLASSES\",\n\t\t\"CAMELCASE_ENUMS\", \"BACKBONE_CLASS_ADDS_PARENT\", \"RESOURCE_MODULE_LOWERCASE\",]\n\n\n>>> from fhirspec import Configuration\n>>> from fhirspec import FHIRSpec\n>>> config = Configuration(\n... {\n...   \"BASE_PATH\": \"\",\n      \"WRITE_RESOURCES\": True\n... }\n... )\n>>> spec = FHIRSpec(config)\n>>> \"patient\" in spec.profiles\nTrue\n\n\n``download``\n------------\n\nA perfect tool to download any file from server, no dependency on third-party library.\n\n>>> from fhirspec import download\n>>> url = \"http://www.africau.edu/images/default/sample.pdf\"\n>>> download_directory = pathlib.Path(os.path.expanduser(\"~/Downloads\"))\n>>> download(url, download_directory)\n>>> (download_directory / \"sample.pdf\").exists()\nTrue\n\n\nHistory\n=======\n\n0.4.0 (22-12-2022)\n------------------\n\n- FHIR R4B specification support has been added.\n\n0.3.0 (18-03-2021)\n------------------\n\n- Now each ``FHIRClass`` contains original sequence of it's properties(elements) defined in specification.\n- Additionally ``FHIRClass.expanded_properties_sequence`` returns all available properties (combined with parent) sequentially.\n\n\n0.2.5 (02-11-2020)\n------------------\n\n- This release contains full fixes of ``FHIRStructureDefinitionElement.represents_class`` issues.\n\n\n0.2.4 (02-11-2020)\n------------------\n\n- No more improvements, just same release of  ``0.2.1`` and overrides to the faulty release of ``0.2.3``.\n\n\n0.2.3 (24-09-2020)\n------------------\n\n**Update to version ``0.2.4`` is recommended**\n\n- use ``FHIRStructureDefinitionElement.is_main_profile_element`` instead of ``FHIRStructureDefinitionElement.represents_class``\n\n0.2.1 (15-06-2020)\n------------------\n\n- Minor improvement on ``FHIRUnitTest`` handling empty value.\n\n0.2.0 (06-06-2020)\n------------------\n\n- ``FHIRClass.known`` property has been changed to ``FHIRClass.__know_classes__`` and ``FHIRClass.is_known_class``.\n\n- Make supports for Python 3.6 and 3.9\n\n0.1.0 (28-04-2020)\n------------------\n\n- Initial release [nazrulworld]\n\n\n------------\n\n\u00a9 Copyright HL7\u00ae logo, FHIR\u00ae logo and the flaming fire are registered trademarks\nowned by `Health Level Seven International <https://www.hl7.org/legal/trademarks.cfm?ref=https://pypi.org/project/fhir-resources/>`_\n\n**\"FHIR\u00ae is the registered trademark of HL7 and is used with the permission of HL7.\nUse of the FHIR trademark does not constitute endorsement of this product by HL7\"**\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python representation of FHIR\u00ae https://www.hl7.org/fhir/ specification.",
    "version": "0.4.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "md5": "fcf744b3413b03364c99e02081d1a3f8",
                "sha256": "43b6dc4914c41a7c5a8440132c5fe835c1c9712ab9ee6c40044ecd88fdd798f1"
            },
            "downloads": -1,
            "filename": "fhirspec-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fcf744b3413b03364c99e02081d1a3f8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 21286,
            "upload_time": "2022-12-22T21:56:51",
            "upload_time_iso_8601": "2022-12-22T21:56:51.027189Z",
            "url": "https://files.pythonhosted.org/packages/04/7b/beb1c5961f2b4192fab283ca4b254722578055a161709f0651bb51651536/fhirspec-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "86d9efced5e71c922614b831c5b36432",
                "sha256": "02a0524c8f58fa01d9c5640529025fff5a77fb013726b45b5a2cc5d3f8d305b4"
            },
            "downloads": -1,
            "filename": "fhirspec-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "86d9efced5e71c922614b831c5b36432",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 27251,
            "upload_time": "2022-12-22T21:56:53",
            "upload_time_iso_8601": "2022-12-22T21:56:53.271220Z",
            "url": "https://files.pythonhosted.org/packages/3c/d5/b09b748709cc4b8b1134307871952ba049d225e8bdd82539b97c62437f86/fhirspec-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-22 21:56:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "nazrulworld",
    "github_project": "fhirspec",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fhirspec"
}
        
Elapsed time: 0.03211s