Skip to content
LambogeniusDocs

HL7 v2 Codec for Azure Logic Apps

Schemas

Where schemas go, the XSD rules the codec follows, element naming, and how a schema is chosen.

Service provider/serviceProviders/lamboHl7CodecLicensed together with the HL7 MLLP Connector. One token covers both.

Where schemas go

Put the XSDs an integration needs in the Logic App's Artifacts/Schemas (sub-folders are fine; xsd:import and xsd:include paths are resolved relative to each file). The codec takes element names, nesting and positions from them; nothing is hard-coded.

The XSD rules

  • Message root: a global element (for example ADT_A01) whose content starts with MSH. A file can define several roots.
  • Segments: elements named by the segment ID (PID, ZPI) or the ID plus a description, whose children are fields named SEG_n_Name.
  • Groups: any other element (ADT_A01_PROCEDURE). Anonymous sequences and choices, group references and xsd:any also work.
  • Namespace: the root is in the schema's target namespace; children are unqualified (qualified children also work).
  • OBX-5 (varies) is named by the datatype in OBX-2 at run time.

Element naming

NameNumbering
FieldCTD_1_ContactRole1-based, like HL7 (CTD-1)
Component / sub-componentCE_0_Identifier, XPN_0_0_Surname0-based (CE.1 is CE_0)
Field the XSD doesn't defineCTD_91-based
… its componentsCTD_9_0, CTD_9_1, CTD_9_0_00-based
GroupADT_A01_PROCEDURE
<CTD>
  <CTD_1_ContactRole><CE_0_Identifier>EP</CE_0_Identifier></CTD_1_ContactRole>
  <CTD_2_ContactName>...</CTD_2_ContactName>
  <CTD_9><CTD_9_0>LOCAL</CTD_9_0><CTD_9_1>A</CTD_9_1></CTD_9>   <!-- CTD-9 is not in the XSD -->
</CTD>

The descriptive part (_ContactRole) is optional; positions come from the number, so a profile may leave fields out.

How a schema is chosen

  1. 1
    Message structure

    from MSH-9.3. If that's empty, MSH-9.1/9.2 are mapped to the structure (ADT^A04 → ADT_A01).

  2. 2
    Version

    from MSH-12: if several files define the root, the one whose path contains the version (2.5.1, v251) wins. Roots that carry the version, such as ADT_A01_251, are found too; an exact root wins.

  3. 3
    Override

    with schemaName (ADT_A01, ADT_A01.xsd or file.xsd#ROOT), or point an action or the connection at another folder with schemaFolder.