How to remove few OBX segments based on <if Condition> and reset OBX SETID sequence

39 views
Skip to first unread message

JamesG

unread,
May 24, 2012, 6:34:55 PM5/24/12
to Ensemble-in...@googlegroups.com
Hi 

I need some example of DTL whereby I can remove OBX segment(s) based on <if condition> from ORM^O01 message and make sure that output has correct OBX sequence (SETIDs).

Apologies this might be basic for many but I am an Ensemble beginner. 

Thanks,
James


Graham, Ben

unread,
May 25, 2012, 9:06:26 AM5/25/12
to ensemble-in...@googlegroups.com

James,

The key is to use a variable that is incremented each time you create a new OBX, using this value to populate the OBX set id (field 1), and as the iteration instance of the target OBX

 

<assign property='ObxResultInstancevalue='"0"' action='set'/>

<foreach property='source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp()}' key='k1'>

<if condition='source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(k1):2}=”TX”’>

<true>
<assign property='ObxResultInstancevalue='ObxResultInstance+1' action='set'>

<annotation>Creating a new OBX, increment OBX instance</annotation>

</assign>

<assign property='target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp('ObxResultInstance).SetIDOBX}' value=’ObxResultInstance’' action='set'/>
<assign property='target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp('ObxResultInstance).OBX:ObservationValue()}' value='source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(k1).OBX:ObservationValue()}' action='set'/>
</true>

</if>
</foreach>

--
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






This electronic transmission and any documents accompanying this electronic transmission may contain information that is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this message immediately.

JamesG

unread,
May 28, 2012, 1:37:37 PM5/28/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Ben,

Thanks for sharing detailed code. I am going to try out today.

Regards,
James

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

JamesG

unread,
May 30, 2012, 7:36:33 PM5/30/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Ben,

I tried the modified code and was able to create two additional segments from one OBX segment. After I split the information from incoming OBX segment into two, I added code to remove original OBX segment, which has also worked but now my SETID is not consistent. How do I reset the sequence for SETID?

Incoming OBX segments are like following 

OBX|1|ID|Print Label^Print Label||Y
OBX|2|ST|Additional Information^Information||Test data 

After Transformation outgoing OBX segments are like 

OBX|1|ID|Print Label^Print Label||Y
OBX|3|TX|Additional Information(1)^Information||Test  
OBX|4|TX|Additional Information(2)^Information||data  


Thanks,
James



On Friday, 25 May 2012 14:06:26 UTC+1, Ben wrote:

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

Graham, Ben

unread,
May 30, 2012, 10:10:43 PM5/30/12
to ensemble-in...@googlegroups.com
James,



I would need to see your transform to answer definitively, but some things you can look at...



Every time you create an OBX you are incrementing the instance counter ObxResultInstance.

Assign this value to the set id field (i.e. <assign property='target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp('ObxResultInstance).SetIDOBX}' value=’ObxResultInstance’' action='set'/>).



Make sure you are not overwriting the set id later in the transform.



Also, make sure you only increment the instance just before you create an OBX segment.



One other possibility is that you are incrementing the instance counter incorrectly...



-Ben



________________________________
From: ensemble-in...@googlegroups.com [ensemble-in...@googlegroups.com] on behalf of JamesG [bere...@googlemail.com]
Sent: Wednesday, May 30, 2012 4:36 PM
To: Ensemble-in...@googlegroups.com
Cc: 'ensemble-in...@googlegroups.com'
Subject: Re: [InterSystems-EnsHlth] How to remove few OBX segments based on <if Condition> and reset OBX SETID sequence
From: ensemble-in...@googlegroups.com<mailto:ensemble-in...@googlegroups.com> [mailto:ensemble-in...@googlegroups.com<mailto:ensemble-in...@googlegroups.com>] On Behalf Of JamesG
Sent: Thursday, May 24, 2012 3:35 PM
To: Ensemble-in...@googlegroups.com<mailto:Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] How to remove few OBX segments based on <if Condition> and reset OBX SETID sequence

Hi

I need some example of DTL whereby I can remove OBX segment(s) based on <if condition> from ORM^O01 message and make sure that output has correct OBX sequence (SETIDs).

Apologies this might be basic for many but I am an Ensemble beginner.

Thanks,
James


--
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<mailto:Ensemble-in...@googlegroups.com>
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com<mailto:Ensemble-in-Healt...@googlegroups.com>
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

________________________________



This electronic transmission and any documents accompanying this electronic transmission may contain information that is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this message immediately.

--
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
Reply all
Reply to author
Forward
0 new messages