Question
· Jan 13

DTL Transformation output: maxOccurs bug?

We are using a DTL transformation to take HL7 and transform into custom XML (XML is a virtual document, held in an EnsLib.EDI.XML.Document object). The schema specifying the format of the XML says one element should occur no more than 24 times (maxOccurs="24" in the XSD schema). However, the transformation to produce one such element always produces 24 elements, all but the last one blank, when tested stand-alone. And when the sub-transform producing one element is incorporated into the full transformation to produce the whole XML object, it produces the wrong output.

Is this a bug in the Ensemble XML Schema / transformation handling? Or are we doing something wrong?

The offending transformation takes an AL1 segment from an HL7 2.3 RDS_001 message and transforms it into an <allergy> node in the XML:

First, here's the Schema for the XML:

Second, here's the transformation which takes an AL1 segment and transforms to an <allergy> object:

Third, here's the output when that transformation is tested in isolation. Notice there are a total of 24 <allergy> objects, matching the maxOccurs="24" from the schema:

Fourth, for comparison, when the schema contains maxOccurs="unbounded" this is the output of the same transformation:

Fifth, here's the output of the calling transformation (whole HL7 message to root node of the XML schema), which calls the above transformation. Notice that there are 2x AL1 segments in the source HL7 message, and 2x (empty) <allergy> nodes in the output XML - given the behaviour of the segment transformation we wonder whether the nodes presented here are the first two produced by the segment transformation, but that is supposition:

Sixth and finally, here is the relevant part of that top-level transformation (HL7 -> root node of XML):

Note that this problem arises in a transformation we are having other (we think unrelated?) issues with, discussed here: DTL Transformation output: ordering of XML nodes | InterSystems Developer

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