HL7 ORCgrp() to XML subtransform
We are building a data transformation from HL7 to custom XML. We've got an XML schema, and are using virtual documents (EnsLib.EDI.XML.Document).
We can:
- build our transform as a single transform
- build our transform using subtransforms where the source data for the subtransform is all in a single HL7 segment and all the output data goes into a single (complex) element of the XML, so the input type on the subtransform is the segment from the HL7 schema and the output type on the subtransform is the relevant element picked out of the XML schema:
- but we can't (so far!) build a subtransform whose input is a group of segments from the HL7.
Specifically, we are working with HL7 2.3 RDS_001, containing drugs and allergy data. Each drug comes through as a group of 4 segments (ORC, RXD, RXR and OBX). There may be many groups, each with a drug. So the obvious strategy in transforming those is to have the group of 4 segments as the input to a subtransform. And while we can loop over these groups readily enough in the outer transform (as in screenshot below), we can't see how to specify the ORCgrp() as a whole as the input to any subtransform.
Is this possible?
You can use the auxiliary property (aux attribute) of the <subtransform> DTL element to pass the index of the group to process to the subtransform, passing the entire source message as source object.
Thanks @Robert Barbiaux, that's really helpful.