Question Jimmy Christian · Dec 21, 2023

How to see complete message in EnsLib.HL7.Message. RawContent is truncated

Hello community,

I am trying to see the complete HL7 message for the class EnsLib.HL7.Message.

But it is showing the truncated version only.

I also tried to convert to stream

msg.OutputToLibraryStream(.streammsg)
newmsg=##class(EnsLib.HL7.Message).ImportFromLibraryStream(streammsg)

While (streammsg.AtEnd = 0) {
     Set len = 1000
        Set tPrintMessage=newstream.Read(.len)
     Write tPrintMessage
}

But when i print it, its not showing complete message.

Any idea or suggestions?

Thank you in advance.

Jimmy Christian.
 

Product version: IRIS 2023.3

Comments

Prasanth Annamreddy · Dec 21, 2023

You can try like Set len=$$$MaxStringLength instead of 1000. The above example reading text upto 1000 characters so message is truncated while printing the message.

0
Justin Owens · Dec 22, 2023

I have run into the RawContent truncating in the past.  We used the code below to open the message using the Message Body ID. We were then able to write the full message to a text file on the server. 

set o = ##class(EnsLib.HL7.Message).%OpenId(qMBId)
set tSC = o.OutputToFile(fname)
0