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