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.downloader.extract_spec_files(extract_location: pathlib.Path, archive_file: 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

apply_base_resource_params()[source]
property jsonfilename
prepare()[source]
write()[source]
class fhirpath.fhirspec.spec.ResourceSearchParameterDefinition(resource_type)[source]

Bases: object

resource_type
class fhirpath.fhirspec.spec.SearchParameter[source]

Bases: object

clone()[source]
code
comparator
component
expression
classmethod from_definition(resource_type, definition)[source]
get_expression(resource_type, definition)[source]
modifier
multiple_and
multiple_or
name
support_prefix()[source]
target
type
xpath
class fhirpath.fhirspec.spec.SearchParameterDefinition[source]

Bases: object

code
comparator
component
expression_map
classmethod from_dict(spec, dict_value)[source]
modifier
multiple_and
multiple_or
name
spec
target
type
xpath

Module contents

FHIR Specification: http://www.hl7.org/fhir/

class fhirpath.fhirspec.FHIRSearchSpecFactory[source]

Bases: object

static from_release(release: str)[source]
class fhirpath.fhirspec.FhirSpecFactory[source]

Bases: object

static from_release(release: str, config: Optional[fhirspec.Configuration] = None)[source]
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