go to post Yuriy Borokhov · Aug 31, 2016 Brian,Try this.ClassMethod getRawHL7Content(pSessionID As %String = "", pTargetName As %String = "") As %String{ set RawContent= "Message Not Found: Contact Interface Team" set pID = "" if (..NotEmpty(pSessionID)) && (..NotEmpty(pTargetName)) { &sql( SELECT TOP 1 MessageBodyId INTO :pID FROM Ens.MessageHeader WHERE (TargetConfigName=:pTargetName AND SessionId=:pSessionID) OR (SourceConfigName=:pTargetName AND SessionId=:pSessionID) ) if SQLCODE '= 0 { set RawContent = "Message Not Found: Contact Interface Team" } else { set RawContent = ##class(EnsLib.HL7.Message).%OpenId(pID).OutputToString() } } Quit RawContent}