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 withMSH. 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 namedSEG_n_Name. - Groups: any other element (
ADT_A01_PROCEDURE). Anonymous sequences and choices, group references andxsd:anyalso 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
| Name | Numbering | |
|---|---|---|
| Field | CTD_1_ContactRole | 1-based, like HL7 (CTD-1) |
| Component / sub-component | CE_0_Identifier, XPN_0_0_Surname | 0-based (CE.1 is CE_0) |
| Field the XSD doesn't define | CTD_9 | 1-based |
| … its components | CTD_9_0, CTD_9_1, CTD_9_0_0 | 0-based |
| Group | ADT_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
- 1Message structure
from MSH-9.3. If that's empty, MSH-9.1/9.2 are mapped to the structure (
ADT^A04→ADT_A01). - 2Version
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 asADT_A01_251, are found too; an exact root wins. - 3Override
with
schemaName(ADT_A01,ADT_A01.xsdorfile.xsd#ROOT), or point an action or the connection at another folder withschemaFolder.