Published on InterSystems Developer Community (https://community.intersystems.com)

Home > RawContent only has first 10k of the message, how do I pull out the full message?

Question
Julian Pardoe · Sep 29, 2021

RawContent only has first 10k of the message, how do I pull out the full message?

We have the following code, but recently had a few issues with messages sent to downstream systems being rejected. 
After investigating, seems that the message being sent is being truncated, the RawContent that we are pulling from Ens.EnsLib_HL7.Message only has the first 10k of the message

We are storing message body IDs in a table, then when we receive later messages, we look up the corresponding record in the table, 
extract the message and alter some fields from the saved message based on the received message and send onto downstream systems

Is there a simple way of getting the full message into RawContent rather than just the first 10k?

example of the code...

        EnsMsgBodyID has the value of the previously saved message body id
        
        &SQL(SELECT RawContent into :RawContent FROM Ens.EnsLib_HL7.Message  WHERE ID = :EnsMsgBodyID)
        
        set newHl7 = ##class(EnsLib.HL7.Message).ImportFromString(RawContent)
        Do newHl7.PokeDocType("Hl7Template_2.4:"_"Hl7_General")
            
        Do newHl7.%Save()

        Alter various fields in newHl7

        set status = ..SendRequestAsync(downstreamsystem,newHl7)

#Caché
Product version: HealthShare 2016.1
$ZV: Cache for Windows (x86-64) 2017.2 (Build 744U) Fri Sep 29 2017 10:58:27 EDT [HealthShare Modules:Core:15.03.3105 + Linkage Engine:15.03.3105]

Source URL:https://community.intersystems.com/post/rawcontent-only-has-first-10k-message-how-do-i-pull-out-full-message