module hl7

Global Variables

  • zero_time_delta

function parse_hl7_dtm

parse_hl7_dtm(hl7_input: 'str') → Hl7ParsedDtm

parse_hl7_dtm Parse the given hl7 input string to a Hl7ParsedDtm

Args:

  • hl7_input (str): The hl7 string to parse

Raises:

  • ValueError: when the provided hl7_input is malformed

Returns: The parsed Hl7ParsedDtm


function hl7_to_fhir_dtm

hl7_to_fhir_dtm(dtm: 'str', precision: 'Optional[Hl7DtmPrecision]' = None) → str

hl7_to_fhir_dtm Converts the given hl7 dtm to an ISO equivalent string optionally truncating the precision to the provided specifity as long as the dtm has precision greater than or equal to the provided specifity

Precision: Hour, Minute and Second truncation is not implemented

Args:

  • dtm (str): The hl7 dtm
  • precision (Optional[FhirDtmPrecision], optional): The output precision. When None is provided, the precision of the dtm is used. Defaults to None

Returns: The ISO date time string


function to_fhir_dtm

to_fhir_dtm(
    dt: 'datetime',
    precision: 'Optional[FhirDtmPrecision]' = None
) → str

to_fhir_dtm Converts the given datetime to an ISO equivalent string optionally truncating the precision to the provided specifity

Precision: Hour, Minute and Second truncation is not implemented

Args:

  • dt (datetime): The datetime
  • precision (Optional[FhirDtmPrecision], optional): The FHIR precision. When None is provided, SEC will be used. Defaults to None

Returns: The ISO date time string


function parse_fhir

parse_fhir(json_input: 'str') → Any

parse_fhir Parses the given json input string to a FHIR object. In the event of a FHIR bundle an attempt will be made to merge duplicate entries for the same entity

See merge_dict for more information

Args:

  • json_input (str): The json input string

Returns: The FHIR object


function get_fhir_entry_key

get_fhir_entry_key(entry: 'Mapping[str, dict]') → str

get_fhir_entry_key Gets the unique key for the given FHIR bundle entry

Key: Combination of resourceType, meta.versionId and id. Fields are allowed to be missing or empty

Args:

  • entry (Mapping): The FHIR bundle entry

Returns: The unique key for the entry, otherwise, empty string


function get_ccda_section

get_ccda_section(
    ccda: 'Mapping[Any, Any]',
    search_template_ids: 'Sequence[str]'
) → Optional[Mapping[Any, Any]]

get_ccda_section Gets the POCD_MT000040.Section from the ClinicalDocument that matches one of the templateIds

See https://github.com/HL7/CDA-core-2.0/tree/master/schema

Args:

  • ccda (Mapping): The ccda document as a map
  • search_template_ids (Sequence): The templateIds

Returns: The section from the document if present


function get_ccda_component3

get_ccda_component3(ccda: 'Mapping[Any, Any]') → Sequence[Any]

get_ccda_component3 Gets the POCD_MT000040.Component3 from the ClinicalDocument.

See https://github.com/HL7/CDA-core-2.0/tree/master/schema

Args:

  • ccda (Mapping): The ccda document as a map

Returns: The Component3 elements from the document, otherwise []


function get_component3_section_templateId

get_component3_section_templateId(
    component: 'Mapping[Any, Any]'
) → Sequence[Any]

get_component3_section_template_id Gets the templateId from the POCD_MT000040.Component3.

See https://github.com/HL7/CDA-core-2.0/tree/master/schema

Args:

  • component (Mapping): The component3 as a map

Returns: The templateId from the component3, otherwise []


function get_template_id_key

get_template_id_key(template_id: 'str') → str

get_template_id_key Gets a key for the given template id

Args:

  • template_id (str): The template id

Returns:

  • str: The key

function is_template_id

is_template_id(id: 'Mapping[Any, Any]', template_id: 'str') → bool

is_template_id Determines if the given id matches the specified template id

Args:

  • id (Mapping[Any, Any]): The id
  • template_id (str): The template id

Returns:

  • bool: True if the id matches the template id, otherwise, False

class FhirDtmPrecision

FhirDtmPrecision A precision associated with a FHIR DTM


class Hl7DtmPrecision

FhirDtmPrecision A precision associated with a HL7 DTM


class Hl7ParsedDtm

Hl7ParsedDtm The parsed DTM

Attributes:

  • precision (Hl7DtmPrecision): The precision
  • dt (datetime): The datetime

This file was automatically generated via lazydocs.