{"id":19618867,"url":"https://github.com/nazrulworld/fhirspec","last_synced_at":"2025-04-28T02:32:14.865Z","repository":{"id":57429218,"uuid":"255589153","full_name":"nazrulworld/fhirspec","owner":"nazrulworld","description":"FHIR Specification Loader","archived":false,"fork":false,"pushed_at":"2022-12-30T13:46:44.000Z","size":67,"stargazers_count":3,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T16:48:10.147Z","etag":null,"topics":["fhir","fhir-parser","fhir-resources","fhirpath","hl7","python-library","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nazrulworld.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-14T11:21:13.000Z","updated_at":"2022-12-25T12:42:02.000Z","dependencies_parsed_at":"2023-01-31T11:45:52.581Z","dependency_job_id":null,"html_url":"https://github.com/nazrulworld/fhirspec","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Ffhirspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Ffhirspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Ffhirspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nazrulworld%2Ffhirspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nazrulworld","download_url":"https://codeload.github.com/nazrulworld/fhirspec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251238236,"owners_count":21557423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fhir","fhir-parser","fhir-resources","fhirpath","hl7","python-library","python3"],"created_at":"2024-11-11T11:11:07.804Z","updated_at":"2025-04-28T02:32:14.600Z","avatar_url":"https://github.com/nazrulworld.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========================\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\u0026logoWidth=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® FHIR®\n\nPython representation of FHIR® 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 \u003chttps://json5.org/\u003e`_),\nfrom python module, from ``TOML`` file, from plain text file, and so on.\n**Only capital letter's variables are accepted**\n\n\n\u003e\u003e\u003e import pathlib\n\u003e\u003e\u003e import os\n\u003e\u003e\u003e from foo.module import bar\n\u003e\u003e\u003e from fhirspec import Configuration\n\u003e\u003e\u003e config1 = Configuration.from_module(bar)\n\u003e\u003e\u003e config2 = Configuration.from_json_file(pathlib.Path(\"/json/file/location\"))\n\u003e\u003e\u003e data_dict = {\n... \"BASE_URL\": pathlib.Path(os.path.abspath(__file__))\n... }\n\u003e\u003e\u003e 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\u003e\u003e\u003e from fhirspec import Configuration\n\u003e\u003e\u003e from fhirspec import FHIRSpec\n\u003e\u003e\u003e config = Configuration(\n... {\n...   \"BASE_PATH\": \"\",\n      \"WRITE_RESOURCES\": True\n... }\n... )\n\u003e\u003e\u003e spec = FHIRSpec(config)\n\u003e\u003e\u003e \"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\u003e\u003e\u003e from fhirspec import download\n\u003e\u003e\u003e url = \"http://www.africau.edu/images/default/sample.pdf\"\n\u003e\u003e\u003e download_directory = pathlib.Path(os.path.expanduser(\"~/Downloads\"))\n\u003e\u003e\u003e download(url, download_directory)\n\u003e\u003e\u003e (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© Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks\nowned by `Health Level Seven International \u003chttps://www.hl7.org/legal/trademarks.cfm?ref=https://pypi.org/project/fhir-resources/\u003e`_\n\n**\"FHIR® 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazrulworld%2Ffhirspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnazrulworld%2Ffhirspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnazrulworld%2Ffhirspec/lists"}