User bio
404 bio not found
Member since Jul 22, 2016
Posts:
Replies:
You cannot change the doc type of "msg" as its state is immutable. You'll need to create a clone then change doc type. To create the clone:
s outmsg=msg.%ConstructClone(1)
Also note that not all trigger events (MSH:9.2) share the same doctype either, so you'll need to derive it appropriately. e.g. ADT^A01, ADT^A04, ADT^A05 the doc type is ADT_A01.
I guess I re-invented the wheel a bit, thanks for the info.
Followers:
Following:
Tony has not followed anybody yet.
Global Masters badges:
Tony has no Global Masters badges yet.
This because the RawContent field is a %String where MAXLEN is 10000. You will need to get the contents out as a stream. So it'll be like:
s msg=##class(EnsLib.HL7.Message).%OpenId(EnsMsgBodyID)
d msg.OutputToLibraryStream(.msgstream)
s newmsg=##class(EnsLib.HL7.Message).ImportFromLibraryStream(msgstream)