Adding another OBX segment in DTL message type ORU_R01

160 views
Skip to first unread message

Siri

unread,
Jun 13, 2017, 6:14:55 AM6/13/17
to InterSystems: Ensemble in Healthcare
Hi 
Can someone please help me with adding an extra OBX segment in to the messages . I need to count number of OBX segments and count+1 OBX segment at the end.

Example : 
Incoming Message

MSH|^~\&|||||20170607001510||ORU^R01|20171580000001|P|2.2||||
PID|1||^^^1||^|||M||||||||||||
PV1|1||||||||||||||||^|||||||||||||||||||||||||||||
ORC|RE||O0036749||||||20170607001510|||^^^|||||
OBR|1||O0036749|POCTBG^Syringe|||20170607001832|||^||||20170607001832|Venous^^^^^^P|||||||20170607001832|||O|||||||||BHorobin|
OBX|1|ST|POCGPH^POCTBG pH^M^pH|1|7.309||7.350 - 7.450|L|||F|||20170607001832|^|^BHorobin|
NTE|1||84^Value below reference range
OBX|2|ST|POCGCO2^POCTBG PCO2^M^pCO2|1|4.47|kPa|4.60 - 6.00|L|||F|||20170607001832|^||
NTE|1||84^Value below reference range
OBX|3|ST|POCGO2^POCTBG O2^M^pO2|1|4.70|kPa|11.0 - 14.4|LL|||F|||20170607001832|^||
NTE|1||85^Value below critical limit
OBX|4|ST|POCGK^POCTBG Potassium^M^K+|1|5.9|mmol/l|3.5 - 5.3|H|||F|||20170607001832|^||
NTE|1||83^Value above reference range
OBX|5|ST|POCGNA^POCTBG Sodium^M^Na+|1|122|mmol/l|133 - 146|L|||F|||20170607001832|^||
NTE|1||84^Value below reference range
OBX|6|ST|POCGCA^POCTBG Ionised Calcium^M^Ca++|1|1.16|mmol/l|1.15 - 1.29|N|||F|||20170607001832|^||

Outgoing Message:

MSH|^~\&|||||20170607001510||ORU^R01|20171580000001|P|2.2||||
PID|1||^^^1||^|||M||||||||||||
PV1|1||||||||||||||||^|||||||||||||||||||||||||||||
ORC|RE||O0036749||||||20170607001510|||^^^|||||
OBR|1||O0036749|POCTBG^Syringe|||20170607001832|||^||||20170607001832|Venous^^^^^^P|||||||20170607001832|||O|||||||||BHorobin|
OBX|1|ST|POCGPH^POCTBG pH^M^pH|1|7.309||7.350 - 7.450|L|||F|||20170607001832|^|^BHorobin|
NTE|1||84^Value below reference range
OBX|2|ST|POCGCO2^POCTBG PCO2^M^pCO2|1|4.47|kPa|4.60 - 6.00|L|||F|||20170607001832|^||
NTE|1||84^Value below reference range
OBX|3|ST|POCGO2^POCTBG O2^M^pO2|1|4.70|kPa|11.0 - 14.4|LL|||F|||20170607001832|^||
NTE|1||85^Value below critical limit
OBX|4|ST|POCGK^POCTBG Potassium^M^K+|1|5.9|mmol/l|3.5 - 5.3|H|||F|||20170607001832|^||
NTE|1||83^Value above reference range
OBX|5|ST|POCGNA^POCTBG Sodium^M^Na+|1|122|mmol/l|133 - 146|L|||F|||20170607001832|^||
NTE|1||84^Value below reference range
OBX|6|ST|POCGCA^POCTBG Ionised Calcium^M^Ca++|1|1.16|mmol/l|1.15 - 1.29|N|||F|||20170607001832|^||
OBX|7|ST|POCGCL^POCTBG Chloride^M^Cl-|1|93|mmol/l|95 - 108|L|||F|||20170607001832|^||


Thank you,
Siri

David Blake

unread,
Jun 13, 2017, 6:45:57 AM6/13/17
to Ensemble-in...@googlegroups.com

Hi Siri

 

You pretty much have the answer there but will need to use a transform to make it easy for yourself.

 

You will probably have a ForEach on the source and copy each OBX to the target.

 

After the ForEach simply use k1+1 (or whatever the key on the OBX ForEach is) for the index of your new segment on the target.

 

Alternatively, using the * character will give the number of entries.

 

For example…

 

Set tOBXEntries   source.{PIDgrpgrp(k1).ORCgrp(k2).OBXgrp(*)}

 

You can then create your new OBX, using tOBXEntries+1 as the key.

 

Hope this helps

 


David Blake
Technical Specialist - Integration | InterSystems 
Direct: +44 01753 855450 | Mobile: +44 7852 265557
InterSystems.com

cid:image001.png@01D1E68F.C902F0E0

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Spencer

unread,
Jun 13, 2017, 7:26:17 AM6/13/17
to Ensemble-in...@googlegroups.com

Hi Siri

 

This is relatively straight forward to accomplish, but the answer does depend on where and how you want to perform this. The easiest way would be to create a graphical DTL transformation to copy the original message and then add on the additional segment as a series of steps in the transformation. And also what is the basis of the values in the new segment? If they are hard coded, then fine you can just put them in (this seems unlikely!), if they are calculated from other values in the message then the calculation could be put into the transformation. If, however, they require obtaining from other external sources then this could prompt a different approach.

 

Perhaps you could advise on the questions there.

 

Meanwhile the XML declarations in a simple DTL that did this with fixed values would look something like …

 

<transform sourceDocType=”2.2:ORU_R01” targetDocType=”2.2:ORU_R01” create=”copy” … {Others stripped} …>

  <assign value=”source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(*)}+1” property=”zNextOBX” action=’set’ />

  <assign value=’”ST”’ property=’target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(zNextOBX).OBX.ValueType}’ action=’set’ />

  //  repeat for all other field you wish to set – it is easy within the Web based editor for DTL’s!

</transform>

 

The key there is to just create a local variable in the DTL, I’ve called it zNextOBX, that will hold the index of the next OBXgrp. This is set to be the current number of OBXgrp’s in the message + 1 (the special * is the virtual document syntax for getting the count in a repeating group). Then I use zNextOBX in all the fields I want to set. I’ve only shown 1 there, you have many more!!

 

Of course this assumes all your messages have 1 single PIDgrpgrp and within there a single ORCgrp, but you could extend the same idea further if that is not the case.

 

Thanks!

Tom.

 

From: <ensemble-in...@googlegroups.com> on behalf of Siri <sirimal...@gmail.com>
Reply-To: "Ensemble-in...@googlegroups.com" <Ensemble-in...@googlegroups.com>
Date: Tuesday, 13 June 2017 at 11:14
To: "InterSystems: Ensemble in Healthcare" <Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] Adding another OBX segment in DTL message type ORU_R01

 

Hi 

--

Siri

unread,
Jun 13, 2017, 8:34:01 AM6/13/17
to InterSystems: Ensemble in Healthcare
Thank you David, for the reply . Your suggestion is very helpful.

Regards
Siri

To post to this group, send email to Ensemble-i...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com


For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.

To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healthcare+unsub...@googlegroups.com.

Siri

unread,
Jun 13, 2017, 8:36:38 AM6/13/17
to InterSystems: Ensemble in Healthcare
Hi Tom,
Thanks, this works ! You have saved me a lot of time.

thank you
Siri

To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com


For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.

To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healthcare+unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages