Question on Subtransform in DTL to transform from a JSON/XML to a custom message
I am building a DTL to transform from a JSON/XML to a custom message. The DTL works fine, but I wants to move some part of the data transformation to another DTL and calls it using the <subtransform> action from the main DTL.
to define
I have the
when I am testing this subtransform I am getting the following for each identifier in the message.
<PatientIdentifierInfo> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <PatientIdentifier xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </PatientIdentifierInfo>
My expectation is receiving the PatientIdentifierInfo in array of JSON format.
Does any one knows why?
Product version: IRIS 2022.1
The key (k1) is missing from your targetObj:
<subtransform class='ADT.DTL.SDAToPatientIdentifierInfo' targetObj='target.PatientIdentifierInfo.()' sourceObj='source.{Patient.Extension.PatientIdentifiers(k1)}' />
In your master transform is this housed within a foreach loop and k1 defined?
Thank you for looking into this and you are right!
Hi Stuart, have you work with multiple subtransform within a DTL when the subtransform having Extension data elements?
The use of sub transforms is always subjective subject.
Go what feels best for you if your having many lines for a specific section / function then a sub-transform is suitable.