Skip to main content

EnsLib.HL7.Util.FormatDSXMLv2

class EnsLib.HL7.Util.FormatDSXMLv2 extends %XML.SAX.ContentHandler, EnsLib.EDI.IOFormatInterface

XML import/export format of HL7 v2 messages
Consists of Data Structure tags around data.
  <hl7:DFT_P03 xmlns:hl7="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <hl7:MSH><hl7:MSH.1></hl7:MSH.1><hl7:MSH.2></hl7:MSH.2><hl7:MSH.3><hl7:HD.1><hl7:IS.1>Unity</hl7:IS.1></hl7:HD.1></hl7:MSH.3><hl7:MSH.4><hl7:HD.1><hl7:IS.1>OptiGlomerate Group Ltd.</hl7:IS.1></hl7:HD.1></hl7:MSH.4><hl7:MSH.5><hl7:HD.1><hl7:IS.1>Affinity</hl7:IS.1></hl7:HD.1></hl7:MSH.5><hl7:MSH.6><hl7:HD.1><hl7:IS.1>OctoGlomerate Holdings Inc.</hl7:IS.1></hl7:HD.1></hl7:MSH.6><hl7:MSH.7><hl7:TS.1><hl7:DTM.1>201505281135</hl7:DTM.1></hl7:TS.1></hl7:MSH.7>
  
Namespace is set to hl7
The Data Structure for OBX:5 is obtained from OBX:2

Property Inventory

Method Inventory

Parameters

parameter DefaultNSP = hl7;
parameter DefaultNSPDeclarations = xmlns:hl7='urn:hl7-org:v2xml' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance';

Properties

property %Content as %String;
Property methods: %ContentDisplayToLogical(), %ContentGet(), %ContentIsValid(), %ContentLogicalToDisplay(), %ContentLogicalToOdbc(), %ContentNormalize(), %ContentSet()
property %Context as %String [ MultiDimensional ];
Property methods: %ContextDisplayToLogical(), %ContextGet(), %ContextIsValid(), %ContextLogicalToDisplay(), %ContextLogicalToOdbc(), %ContextNormalize(), %ContextSet()
property %DocObj as EnsLib.EDI.Document;
Property methods: %DocObjGet(), %DocObjGetSwizzled(), %DocObjIsValid(), %DocObjNewObject(), %DocObjSet()
property %FieldPath as %String;
Property methods: %FieldPathDisplayToLogical(), %FieldPathGet(), %FieldPathIsValid(), %FieldPathLogicalToDisplay(), %FieldPathLogicalToOdbc(), %FieldPathNormalize(), %FieldPathSet()
property %InCData as %Integer [ InitialExpression = 0 ];
Property methods: %InCDataDisplayToLogical(), %InCDataGet(), %InCDataIsValid(), %InCDataLogicalToDisplay(), %InCDataNormalize(), %InCDataSet()
property %LastLevel as %Integer;
Property methods: %LastLevelDisplayToLogical(), %LastLevelGet(), %LastLevelIsValid(), %LastLevelLogicalToDisplay(), %LastLevelNormalize(), %LastLevelSet()
property %SegFields as %Integer;
Property methods: %SegFieldsDisplayToLogical(), %SegFieldsGet(), %SegFieldsIsValid(), %SegFieldsLogicalToDisplay(), %SegFieldsNormalize(), %SegFieldsSet()
property %SegObj as EnsLib.EDI.Segment;
Property methods: %SegObjGet(), %SegObjGetSwizzled(), %SegObjIsValid(), %SegObjNewObject(), %SegObjSet()

Methods

classmethod ImportDocument(Output pDocObj As EnsLib.EDI.Document, Output pStatus As %Status, pIOStream As %IO.I.CharacterStream, ByRef pConfigItem As %String) as %Boolean
Return 1 if we imported the whole document or got an error. Returning 0 means the caller will do its standard parse. Must pass Schema value in the pConfigItem array. For example: set pConfigItem="2.4"
classmethod ImportSegment(Output pSegObj As EnsLib.EDI.Segment, Output pStatus As %Status, pIOStream As %IO.I.CharacterStream, ByRef pSeparators As %String) as %Boolean
Return 1 if we imported a segment or got an error. Returning 0 means the caller will do its standard parse.
classmethod OutputDocument(pDocObj As EnsLib.EDI.Document, Output pStatus As %Status, pIOStream As %IO.I.CharacterStream, pSeparators As %String, pSequenceNumber As %String) as %Boolean
Return 1 if we took care of the whole document or got an error. Returning 0 means the caller will continue doing component segments as usual.
classmethod OutputDocumentEnd(pDocObj As EnsLib.EDI.Document, Output pStatus As %Status, pIOStream As %IO.I.CharacterStream, pSeparators As %String, pSequenceNumber As %String)
Inherited description: Output any post-segment trailing document content. Called only if OutputDocument() returned 0 meaning it did not complete output of all segments itself.
classmethod OutputSegment(pSegObj As EnsLib.EDI.Segment, Output pStatus As %Status, pIOStream As %IO.I.CharacterStream, pSeparators As %String, pSegNum As %String, pSegPath As %String, pParentDoc As EnsLib.EDI.Document, ByRef pSequenceNumber As %String) as %Boolean
Return 1 if we took care of the segment or got an error. Returning 0 means the caller will output the segment as usual.
method characters(chars As %Library.String, length As %Library.Integer)
Inherited description: Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

  • chars: The characters.
  • length: The number of characters to use from the character array.
method endCDATA()
Inherited description: Receive notification of the end of a CDATA section.

The SAX parser will invoke this method at the end of each CDATA parsed.

Exceptions thrown: SAXException - Any SAX exception, possibly wrapping another exception.

/
method endElement(uri As %Library.String, localname As %Library.String, qname As %Library.String)
Inherited description: Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

  • uri: The URI of the associated namespace for this element
  • localname: The local part of the element name
  • qname: The QName of this element

method endEntity(name As %String)
Inherited description: Receive notification of the end of an entity.

The SAX parser will invoke this method at the end of an entity

  • name: The name of the entity that is ending.

Exceptions thrown: SAXException - Any SAX exception, possibly wrapping another exception.

method fault(text As %String)
method faultStatus(status As %Status)
method startCDATA()
Inherited description: Receive notification of the start of a CDATA section.

The SAX parser will invoke this method at the start of each CDATA parsed.

Exceptions thrown: SAXException - Any SAX exception, possibly wrapping another exception.

method startElement(uri As %Library.String, localname As %Library.String, qname As %Library.String, attrs As %Library.List)
Inherited description: Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writin output to a file).

  • uri: The URI of the associated namespace for this element
  • localname: the local part of the element name
  • qname: the QName of this element
  • attrs: a list in $List format consisting of a repeating group of attributes.

The format of the repeating group is as follows:

  • +0 - uri: The URI of the associated namespace for this attribute
  • +1 - localname: The local part of the name of this attribute
  • +2 - qname: The QName of this attribute
  • +3 - type: The type of this attribute ("CDATA", NMTOKEN", "ENTITY", etc.)
  • +4 - value: The value of this attribute

method startEntity(name As %String)
Inherited description: Receive notification of the start of an entity.

The SAX parser will invoke this method at the start of an entity

  • name: The name of the entity that is starting.

Exceptions thrown: SAXException - Any SAX exception, possibly wrapping another exception.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab