Question
· Jan 10

DTL Transformation output: ordering of XML nodes

We are using a DTL transformation to take HL7 and transform into custom XML. But the nodes in the resulting XML are appearing out of sequence - and therefore failing validation against the schema.

The XSD schema for the XML looks fine when imported into Ensemble: root node in the XSD looks like this:

And shows in Ensemble like this:

The transformation looks like this, and we can see the text from the trace elements at lines 5, 12 and 19 appear in the correct order in the event log:

HOWEVER, the resulting XML has the <allergies> nodes before the <patientNotes> nodes....:

Any ideas about why this is happening, and how we can ensure nodes are generated in the correct order?

Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1 (Build 184U) Wed Sep 19 2018 09:09:22 EDT
Discussion (5)2
Log in or sign up to continue

With help from WRC, looks like this is something of our own doing - we were using sub-transforms in ways that caused us problems. Our sub-transforms above were outputting whole new XML documents, when at the very least they should have been taking existing partially produced XML from the top-level transform and using that existing document to output. We "solved" the node ordering issue by moving everything into a single transform, so there was no mismatch between top level and sub-transforms.