I have some transformation code that accumulates many source OBX segments into one stream and write the stream (>32k) to one target OBX. Just the opposite of what you want to do though:
<code>
<![CDATA[
// (1) instantiate a stream variable
set tStream=##class(%GlobalCharacterStream).%New()
// (2) build the first components of the segment
set tSC = tStream.Write("OBX|1|TX|||")
]]
<foreach property='source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp()}' key='k1'>
<assign property='tempOBX05' value='source.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(k1).OBX:5}' action='set'/>
<code>
<![CDATA[
// (3) accumulate value into the tstream
set tSC = tStream.Write("~"_tempOBX05)
]]>
</code>
</foreach>
<code>
<![CDATA[
//(4) create an OBX segment
set tSegment= ##class(EnsLib.HL7.Segment).%New()
set tSegment.SegType = "2.1:OBX"
//(5) put the stream into the segment
set tSC= tSegment.StoreRawDataStream(tStream)
//(6) put the segment into the target HL7 message
set tSC= target.setSegmentByPath(tSegment,"PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX")
]]>
</code>
Thanks in advance
Steve
--
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
If it doesn't work on versions other than 2009.1 please let me know.
HTH