Why does my DTL test tool work perfectly but my DTL only half works when used by the process?
I created a DTL to do HL7 mapping. The test function in the tools works the DTL perfectly but when used by the rule in my business process, the OBX segments are stripped and the MRN is gone. The assigning authority and ID type are added into the PID but the actual patient MRN is blank (3.1 value).
Here is the source code.
<code>
<![CDATA[ //MSH SEGMENT]]></code>
<assign value='source.{MSH}' property='target.{MSH}' action='set' />
<assign value='"STLMC"' property='target.{MSH:SendingFacility}' action='set' />
<assign value='"2.5"' property='target.{MSH:VersionID}' action='set' />
<code>
<![CDATA[ //EVN SEGMENT]]></code>
<assign value='source.{EVN}' property='target.{EVN}' action='set' />
<code>
<![CDATA[ //PID SEGMENT]]></code>
<assign value='source.{PID}' property='target.{PID}' action='set' />
<assign value='source.{PID:PatientIDInternalID().ID}_"^^^STLMC^MR"' property='target.{PID:3()}' action='set' />
<code>
<![CDATA[ //PV1 Segment]]></code>
<assign value='source.{PV1}' property='target.{PV1}' action='set' />
<assign value='..Lookup("GHHC_STLMCPatientClass",source.{PV1:PatientClass})' property='target.{PV1:PatientClass}' action='set' />
<code>
<![CDATA[ //TXA SEGMENT]]></code>
<assign value='source.{TXA}' property='target.{TXA}' action='set' />
<if condition='target.{TXA:DocumentType} = "EPDISCH^Discharge Summaries"' >
<true>
<assign value='"DS"' property='target.{TXA:DocumentType}' action='set' />
</true>
</if>
<if condition='target.{TXA:DocumentType} = "EPHIST^H\T\P"' >
<true>
<assign value=' "HP"' property='target.{TXA:DocumentType}' action='set' />
</true>
</if>
<if condition='target.{TXA:DocumentType} = "EPOPN^Op Note"' >
<true>
<assign value='"OP"' property='target.{TXA:DocumentType}' action='set' />
</true>
</if>
<if condition='target.{TXA:DocumentType} = "EPCONSLT^Consults"' >
<true>
<assign value='"CN"' property='target.{TXA:DocumentType}' action='set' />
</true>
</if>
<foreach property='source.{OBX()}' key='k1' >
<assign value='source.{OBX(k1)}' property='target.{OBXgrp(k1).OBX}' action='set' />
</foreach>
</transform>