Skip to main content

EnsLib.HL7.Util.IOFraming

abstract class EnsLib.HL7.Util.IOFraming

Property Inventory

Method Inventory

Parameters

parameter SETTINGS = Framing:Connection:selector?context={Ens.ContextSearch/getDisplayList?host=@currHostId&prop=Framing};

Properties

property DefCharEncoding as %String (MAXLEN = 20) [ InitialExpression = "latin1" ];
Default Character Encoding to use when reading or writing HL7 messages.

If MSH field 18 (Character Set) is empty, this encoding will be used. Choices you can use for this setting include:

  • Native: Use the default character encoding of the installed locale of the IRIS server.
  • latin1: The ISO Latin1 8-bit encoding. This is the default.
  • ISO-8859-1: The ISO Latin1 8-bit encoding.
  • UTF-8: The Unicode 8-bit encoding.
  • Unicode: The Unicode 16-bit encoding (Little-Endian).
  • UnicodeBig: The Unicode 16-bit encoding (Big-Endian).
  • Any other NLS definitions installed on this IRIS server.
  • @<ttable>: <ttable> means a raw InterSystems character translation table name. A prefix of '@' means to use the named table.
Putting ! before the encoding name will force the use of the named encoding and will ignore any value found in MSH:18.
Property methods: DefCharEncodingDisplayToLogical(), DefCharEncodingGet(), DefCharEncodingIsValid(), DefCharEncodingLogicalToDisplay(), DefCharEncodingLogicalToOdbc(), DefCharEncodingNormalize(), DefCharEncodingSet()
property Framing as %String (DISPLAYLIST = ",None,MLLP,MLLP11/28,AsciiLF,AsciiCR,Ascii11,Ascii11/28,LLP,MsgEnvelope,MLLPMsgEnvelope") [ InitialExpression = "MLLP" ];
HL7 message outbound framing protocol. The options are:
  • None: No framing - Each line that begins with 'MSH' is the start of a new message.
  • MLLP: Minimal Lower Level Protocol - Frame each HL7 message with ASCII code 11 prefix and ASCII code 28,13 suffix.
  • MLLPN/M: Minimal Lower Level Protocol - Frame each HL7 message with ASCII code N prefix, and ASCII code M suffix followed by an additional ASCII code 13.
  • AsciiLF: Frame messages with ASCII code 10 (Line Feed) separating each message from the subsequent one.
  • AsciiCR: Frame messages with an extra ASCII code 13 (Carriage Return) separating each message from the subsequent one.
  • AsciiM: Frame messages with ASCII code M suffix character(s) separating each message from the subsequent one.
  • AsciiN/M: Frame messages with ASCII code N prefix character(s) before each message and ASCII code M suffix character(s), but no trailing ASCII code 13 as in MLLPN/M.
  • LLP: Lower Level Protocol - (Obsolete) Frame each HL7 message in a redundant checksum block.
  • MsgEnvelope: Use the message's Envelope property verbatim if it is present. The string <!--HL72MSG--> if present in the Envelope will be replaced with the message content. Otherwise the message will simply follow the Envelope text.
  • MLLPMsgEnvelope: Same as MsgEnvelope, but with MLLP prefix and suffix also around the message inside the Envelope.

Notes:
- ASCII code N is a sequence of one or more characters represented by their ASCII code, separated by comma in case of more than one character.
- All ASCII codes should be given in decimal.
- ASCII code 120 (character 'x') is not allowed as a framing character.
- If an asterisk (*) is appended to the framing specification, 'Flexible' framing will be used in parsing received acknowledgement response messages. Otherwise the response messages will be expected with the same kind of framing as that specified here for outbound messages.

Property methods: FramingDisplayToLogical(), FramingGet(), FramingIsValid(), FramingLogicalToDisplay(), FramingLogicalToOdbc(), FramingNormalize(), FramingSet()

Methods

method OutputFramedToDevice(pMsg As EnsLib.HL7.Message, pSeparators As %String, pSequenceNumber As %String, pInbound As %Boolean = 0, ByRef pIOLogEntry As Ens.Util.IOLog = $$$NULLOREF, pDoFraming As %Integer) as %Status
method OutputFramedToIOStream(pIOStream As %IO.I.CharacterStream, pMsg As EnsLib.HL7.Message, pSeparators As %String, pSequenceNumber As %String, pInbound As %Boolean = 1, ByRef pIOLogEntry As Ens.Util.IOLog = $$$NULLOREF, pDoFraming As %Integer = 1) as %Status
Write an HL7 Message to the given IO Stream.

Returned %Status codes are only logged if they are error exceptions.

Possible values for pDoFraming are:

  • 0 = No framing.
  • 1 = Full framing (default).
  • -1 = Prefix only.
  • 2 = Suffix only.
method SetOutFraming(pFraming As %String)
Call this method after initializing or resetting the parser to force a particular output framing style different from the input framing style that is either specified or detected.

Subclasses

FeedbackOpens in a new tab