fhirpath.fhirspec package¶
Submodules¶
fhirpath.fhirspec.downloader module¶
- fhirpath.fhirspec.downloader.download_and_extract(release: fhirpath.enums.FHIR_VERSION, output_dir: pathlib.Path)[source]¶
- fhirpath.fhirspec.downloader.download_archive(release: fhirpath.enums.FHIR_VERSION, temp_location: pathlib.Path) → pathlib.Path[source]¶
fhirpath.fhirspec.spec module¶
Most of codes are copied from https://github.com/nazrulworld/fhir-parser and modified in terms of styling, unnecessary codes cleanup (those are not relevant for this package)
- class fhirpath.fhirspec.spec.FHIRSearchSpec(source: pathlib.Path, fhir_release: fhirpath.enums.FHIR_VERSION, storage: fhirpath.storage.MemoryStorage)[source]¶
Bases:
object
https://www.hl7.org/fhir/searchparameter-registry.html
- property jsonfilename¶
- class fhirpath.fhirspec.spec.ResourceSearchParameterDefinition(resource_type)[source]¶
Bases:
object
- resource_type¶
Module contents¶
FHIR Specification: http://www.hl7.org/fhir/
- fhirpath.fhirspec.ensure_spec_jsons(release: fhirpath.enums.FHIR_VERSION)[source]¶
- fhirpath.fhirspec.lookup_fhir_resource_spec(resource_type: str, cache: bool = True, fhir_release: fhirpath.enums.FHIR_VERSION = <FHIR_VERSION.DEFAULT: 'R4'>) → Optional[fhirspec.FHIRStructureDefinition][source]¶
- Parameters
resource_type – the resource type name (required). i.e Organization
cache – (default True) the flag which indicates should query fresh or serve from cache if available.
fhir_release – FHIR Release (version) name. i.e FHIR_VERSION.STU3, FHIR_VERSION.R4
:return FHIRStructureDefinition
Example:
>>> from fhirpath.fhirspec import lookup_fhir_resource_spec >>> from zope.interface import Invalid >>> dotted_path = lookup_fhir_resource_spec('Patient') >>> 'fhir.resources.patient.Patient' == dotted_path True >>> dotted_path = lookup_fhir_resource_spec('FakeResource') >>> dotted_path is None True