Question
· Apr 4, 2017

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. 

 

<transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.3:MDM_T02' targetDocType='2.5:MDM_T02' create='new' language='objectscript' >
<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>

Discussion (8)0
Log in or sign up to continue

Hi Graham,

please try

<assign value='source.{PID:PatientIDInternalID(1).ID}_"^^^STLMC^MR"' property='target.{PID:3(1)}' action='set' />

I think the test function works differently than the right DTL
Please tell me if it has worked.

Otherwise, try this

with the PID:PatientIDInternal(1).ID did you set the PID:3.1 please append  value in the other subfields a second step. Like this:

<assign value='source.{PID:PatientIDInternalID(1).ID}' property='target.{PID:3(1)}' action='set' />

<assign value='"^^^STLMC^MR"' property='target.{PID:3(1)}' action='append' />

OR

<assign value='source.{PID:3(1).1}' property='target.{PID:3(1).1}' action='set' />

<assign value='"STLMC"' property='target.{PID:3(1).4}' action='set' />

<assign value='"MR"' property='target.{PID:3(1).5}' action='set' />

Yep! That mapped the MRN over. Now I just can't seem to get the source OBXs into the OBXgrp() object. 

This works when I use the test tool but not when I call the DTL from the process and rule. 

 

<foreach property='source.{OBX()}' key='k1' >
<assign value='source.{OBX(k1)}' property='target.{OBXgrp(k1).OBX}' action='set' />
</foreach>