set strADT ="MSH|^~\&|MEDICO|JOE'S HOSPITAL^1.2.3.4.5|OCIEB2B|OCIEUHGB2BTEST|20130730072041|SECURITY|ADT^A01|MSG00001|P|2.7|||AL"_$c(13) _"EVN|A01|20130626044550||01|00968|20130626043902"_$c(13) set InputADT=##class(EnsLib.HL7.Message).ImportFromString(strADT) set InputADT.DocType="2.7:ADT_A01" w InputADT.%Save()
In case you need to import it from a stream you can use ImportFromStream method to import the content from stream.
ok
• property Identifier as %String [ Calculated,Transient,ReadOnly ];
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message#PROPERTY_Identifier
You can't set it. It gets calculated and is ReadOnly.
Following http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message
you should probably start with
set Set HL7Msg=##class(EnsLib.HL7.Message).%New()
and start to compose the message accordingly.
You can do it using below code.
set strADT ="MSH|^~\&|MEDICO|JOE'S HOSPITAL^1.2.3.4.5|OCIEB2B|OCIEUHGB2BTEST|20130730072041|SECURITY|ADT^A01|MSG00001|P|2.7|||AL"_$c(13)
_"EVN|A01|20130626044550||01|00968|20130626043902"_$c(13)
set InputADT=##class(EnsLib.HL7.Message).ImportFromString(strADT)
set InputADT.DocType="2.7:ADT_A01"
w InputADT.%Save()
In case you need to import it from a stream you can use ImportFromStream method to import the content from stream.
I was able to find what I needed. Set MSGX=##Class(EnsLib.HL7.Message).%OpenId(xxxxxxx) works