cdac.medinfo.sdk.hl7282.baselibs.segments

## Class MSH

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.segments.Segment
  - - cdac.medinfo.sdk.hl7282.baselibs.segments.MSH

- All Implemented Interfaces:
    ISegment

      public class MSH
      extends Segment

  MSH - message header segment

  The MSH segment defines the intent, source, destination, and some specifics of the syntax of a message.

  Represents an HL7 MSH message segment. This segment has the following fields:

  MSH-1: Field Separator (ST)Required
  MSH-2: Encoding Characters (ST)Required
  MSH-3: Sending Application (HD)Optional
  MSH-4: Sending Facility (HD)Optional
  MSH-5: Receiving Application (HD)Optional
  MSH-6: Receiving Facility (HD)Optional
  MSH-7: Date/Time Of Message (DTM)Required
  MSH-8: Security (ST)Optional
  MSH-9: Message Type (MSG)Required
  MSH-10: Message Control ID (ST)Required
  MSH-11: Processing ID (PT)Required
  MSH-12: Version ID (VID)Required
  MSH-13: Sequence Number (NM)Optional
  MSH-14: Continuation Pointer (ST)Optional
  MSH-15: Accept Acknowledgment Type (ID)Optional
  MSH-16: Application Acknowledgment Type (ID)Optional
  MSH-17: Country Code (ID)Optional
  MSH-18: Character Set (ID)Optional
  MSH-19: Principal Language Of Message (CWE)Optional
  MSH-20: Alternate Character Set Handling Scheme (ID)Optional
  MSH-21: Message Profile Identifier (EI)Optional MSH-22: Sending Responsible Organization (XON)Optional
  MSH-23: Receiving Responsible Organization (XON)Optional
  MSH-24: Sending Network Address (HD)Optional
  MSH-25: Receiving Network Address (HD)Optional

  This class provides mechanism to validate message against HL7 v 2.8.2 standard. The class provides accessors & mutators for the elements mentioned above. The class has validate method which validates Message against HL7 v 2.8.2 standard.

  User can also create Segment through `SegmentFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MSH()` Constructs the MSH segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCharacterSet(ID objtempCharacterSet)` Set the object of Character Set
    `void` | `addCharacterSet(java.lang.String strCharacterSet)` Set the Character Set.
    `void` | `addMessageProfileIdentifier(EI objtempMessageProfileIdentifier)` Set the Message Profile Identifier.
    `void` | `addMessageProfileIdentifier(java.lang.String strEntityIdentifier, java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Message Profile Identifier.
    `ID` | `getAcceptAcknowledgmentType()` Retrieves the Accept Acknowledgment Type.
    `ID` | `getAlternateCharacterSetHandlingScheme()` Retrieves the Alternate Character Set Handling Scheme.
    `ID` | `getApplicationAcknowledgmentType()` Retrieves the Application Acknowledgment Type.
    `ISingleCollection<ID>` | `getCharacterSet()` Retrieves the Character Set.
    `ST` | `getContinuationPointer()` Retrieves the Continuation Pointer.
    `ID` | `getCountryCode()` Retrieves the Country Code.
    `DTM` | `getDateTimeOfMessage()` Retrieves the Date Time Of Message.
    `IDelimiter` | `getDelimiter()` Retrieves the Delimiter.
    `ST` | `getEncodingChar()` Retrieves the Encoding Char.
    `ST` | `getFieldSeparator()` Retrieves the Field Separator.
    `ST` | `getMessageControlID()` Retrieves the Message Control ID.
    `ISingleCollection<EI>` | `getMessageProfileIdentifier()` Retrieves the Message Profile Identifier.
    `MSG` | `getMessageType()` Retrieves the Message Type.
    `CWE` | `getPrincipalLanguageOfMessage()` Retrieves the Principal Language Of Message.
    `PT` | `getProcessingID()` Retrieves the Processing ID.
    `HD` | `getReceivingApplication()` Retrieves the Receiving Application.
    `HD` | `getReceivingFacility()` Retrieves the Receiving Facility.
    `HD` | `getReceivingNetworkAddress()` Retrieves the Receiving Network Address.
    `XON` | `getReceivingResponsibleOrganization()` Retrieves the Receiving Responsible Organization.
    `ST` | `getSecurity()` Retrieves the Security.
    `HD` | `getSendingApplication()` Retrieves the Sending Application.
    `HD` | `getSendingFacility()` Retrieves the Sending Facility.
    `HD` | `getSendingNetworkAddress()` Retrieves the Sending Network Address.
    `XON` | `getSendingResponsibleOrganization()` Retrieves the Sending Responsible Organization.
    `NM` | `getSequenceNumber()` Retrieves the Sequence Number.
    `VID` | `getVersionID()` Retrieves the Version ID.
    `int` | `parse(java.lang.String strSegmentStream, IDelimiter objIDelimiter)` Parses HL7 Segment Strings from any Stream into HL7 Segment object.
    `int` | `serialize(IHL7Stream objIHL7Stream, IDelimiter objIDelimiter)` Serializes HL7 Message objects.
    `void` | `setAcceptAcknowledgmentType(ID objacceptAcknowledgmentType)` Set the Accept Acknowledgment Type.
    `void` | `setAcceptAcknowledgmentType(java.lang.String strAcceptAcknowledgmentType)` Set the Accept Acknowledgment Type.
    `void` | `setAlternateCharacterSetHandlingScheme(ID objalternateCharacterSetHandlingScheme)` Set the Alternate Character Set Handling Scheme.
    `void` | `setAlternateCharacterSetHandlingScheme(java.lang.String strAlternateCharacterSetHandlingScheme)` Set the Alternate Character Set Handling Scheme.
    `void` | `setApplicationAcknowledgmentType(ID objapplicationAcknowledgmentType)` Set the Application Acknowledgment Type.
    `void` | `setApplicationAcknowledgmentType(java.lang.String strApplicationAcknowledgmentType)` Set the Application Acknowledgment Type.
    `void` | `setCharacterSet(ISingleCollection<ID> objCharacterSetList)` Set the CharacterSet list.
    `void` | `setContinuationPointer(ST objcontinuationPointer)` Set the Continuation Pointer.
    `void` | `setContinuationPointer(java.lang.String strContinuationPointer)` Set the Continuation Pointer.
    `void` | `setCountryCode(ID objcountryCode)` Set the Country Code.
    `void` | `setCountryCode(java.lang.String strCountryCode)` Set the Country Code.
    `void` | `setDateTimeOfMessage(DTM objdateTimeOfMessage)` Set the Date Time Of Message.
    `void` | `setDateTimeOfMessage(java.lang.String strTime)` Set the Date Time Of Message.
    `void` | `setEncodingChars(char cComponentSeparator, char cSubComponentSeparator, char cRepetitionSeparator, char cEscapeCharacter, char cTruncationCharacter)` Set the Encoding Char.
    `void` | `setEncodingChars(ST objencodingChar)` Set the Encoding Char.
    `void` | `setFieldSeparator(char cfieldSeparator)` Set the Field Separator.
    `void` | `setFieldSeparator(ST objfieldSeparator)` Set the Field Separator.
    `void` | `setMessageControlID(ST objmessageControlID)` Set the Message Control ID.
    `void` | `setMessageControlID(java.lang.String strMessageControlID)` Set the Message Control ID.
    `void` | `setMessageProfileIdentifier(ISingleCollection<EI> objMessageProfileIdentifierList)` Set the MessageProfileIdentifier list.
    `void` | `setMessageType(MSG objmessageType)` Set the Message Type.
    `void` | `setMessageType(java.lang.String strMessageCode, java.lang.String strTriggerEvent, java.lang.String strMessageStructure)` Set the Message Type.
    `void` | `setPrincipalLanguageOfMessage(CWE objprincipalLanguageOfMessage)` Set the Principal Language Of Message.
    `void` | `setPrincipalLanguageOfMessage(java.lang.String strIdentifier, java.lang.String strText, java.lang.String strNameOfCodingSystem, java.lang.String strAlternateIdentifier, java.lang.String strAlternateText, java.lang.String strNameOfAlternateCodingSystem, java.lang.String strCodingSystemVersionID, java.lang.String strAlternateCodingSystemVersionId, java.lang.String strOriginalText, java.lang.String strSecondAlternateIdentifier, java.lang.String strSecondAlternateText, java.lang.String strNameofSecondAlternateCodingSystem, java.lang.String strSecondAlternateCodingSystemVersionID, java.lang.String strCodingSystemOID, java.lang.String strValueSetOID, java.lang.String strValueSetVersionID, java.lang.String strAlternateCodingSystemOID, java.lang.String strAlternateValueSetOID, java.lang.String strAlternateValueSetVersionID, java.lang.String strSecondAlternateCodingSystemOID, java.lang.String strSecondAlternateValueSetOID, java.lang.String strSecondAlternateValueSetVersionID)` Set the Principal Language Of Message.
    `void` | `setProcessingID(PT objprocessingID)` Set the Processing ID.
    `void` | `setProcessingID(java.lang.String strProcessingId, java.lang.String strProcessingMode)` Set the Processing ID.
    `void` | `setReceivingApplication(HD objreceivingApplication)` Set the Receiving Application.
    `void` | `setReceivingApplication(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Receiving Application.
    `void` | `setReceivingFacility(HD objreceivingFacility)` Set the Receiving Facility.
    `void` | `setReceivingFacility(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Receiving Facility.
    `void` | `setReceivingNetworkAddress(HD objReceivingApplication)` Set the Receiving Network Address.
    `void` | `setReceivingNetworkAddress(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Receiving Network Address.
    `void` | `setReceivingResponsibleOrganization(java.lang.String strOrganizationName, CWE objOrganizationNameTypeCode, HD objAssigningAuthority, java.lang.String strIdentifierTypeCode, HD objAssigningFacility, java.lang.String strNameRepresentationCode, java.lang.String strOrganizationIdentifier)` Set the Receiving Responsible Organization.
    `void` | `setReceivingResponsibleOrganization(XON objReceivingResponsibleOrganization)` Ses the Receiving Responsible Organization.
    `void` | `setSecurity(ST objsecurity)` Set the Security.
    `void` | `setSecurity(java.lang.String strSecurity)` Set the Security.
    `void` | `setSendingApplication(HD objsendingApplication)` Set the Sending Application.
    `void` | `setSendingApplication(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Sending Application.
    `void` | `setSendingFacility(HD objsendingFacility)` Set the Sending Facility.
    `void` | `setSendingFacility(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Sending Facility.
    `void` | `setSendingNetworkAddress(HD objReceivingApplication)` Set the Sending Network Address.
    `void` | `setSendingNetworkAddress(java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Set the Sending Network Address.
    `void` | `setSendingResponsibleOrganization(java.lang.String strOrganizationName, CWE objOrganizationNameTypeCode, HD objAssigningAuthority, java.lang.String strIdentifierTypeCode, HD objAssigningFacility, java.lang.String strNameRepresentationCode, java.lang.String strOrganizationIdentifier)` Set the Sending Responsible Organization.
    `void` | `setSendingResponsibleOrganization(XON objSendingResponsibleOrganization)` Ses the Sending Responsible Organization.
    `void` | `setSequenceNumber(NM objsequenceNumber)` Set the Sequence Number.
    `void` | `setSequenceNumber(java.lang.String strSequenceNumber)` Set the Sequence Number.
    `void` | `setVersionID(java.lang.String strVersionId, CWE objInternationalizationCode, CWE objInternationalVersionId)` Set the Version ID.
    `void` | `setVersionID(VID objversionID)` Set the Version ID.
    `boolean` | `validate()` Validates HL7 Message objects .

    - ### Methods inherited from class cdac.medinfo.sdk.hl7282.baselibs.segments.Segment

      `addUnRecognizedField, dumpSegment, getFields, getName, getUnrecognizedFields, moveToNextSegment, removeDataElement, removeDataElement, setName, setUnRecognizedField, updateDataElement, updateDataElement, writeToXML`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MSH

          public MSH()

      Constructs the MSH segment.

  - ### Method Detail

    - #### getAcceptAcknowledgmentType

          public ID getAcceptAcknowledgmentType()

      Retrieves the Accept Acknowledgment Type. This field identify the conditions under which accept acknowledgments are required to be returned in response to this message.
      Returns:
        ID - acceptAcknowledgmentType

    - #### getAlternateCharacterSetHandlingScheme

          public ID getAlternateCharacterSetHandlingScheme()

      Retrieves the Alternate Character Set Handling Scheme. This field specify the Alternate Character Set Handling Scheme.
      Returns:
        ID - alternateCharacterSetHandlingScheme

    - #### getApplicationAcknowledgmentType

          public ID getApplicationAcknowledgmentType()

      Retrieves the Application Acknowledgment Type. This field contains the conditions under which application acknowledgments are required to be returned in response to this message.
      Returns:
        ID - applicationAcknowledgmentType

    - #### getCharacterSet

          public ISingleCollection<ID> getCharacterSet()

      Retrieves the Character Set. This field contains the character set for the entire message.
      Returns:
        ISingleCollection - characterSet

    - #### getContinuationPointer

          public ST getContinuationPointer()

      Retrieves the Continuation Pointer. This field is used to define continuations in application-specific ways.
      Returns:
        ST - continuationPointer

    - #### getCountryCode

          public ID getCountryCode()

      Retrieves the Country Code. This field contains the country of origin for the message.
      Returns:
        ID - countryCode

    - #### getDateTimeOfMessage

          public DTM getDateTimeOfMessage()

      Retrieves the Date Time Of Message. This field contains the date/time that the sending system created the message.
      Returns:
        DTM - dateTimeOfMessage

    - #### getEncodingChar

          public ST getEncodingChar()

      Retrieves the Encoding Char. This field contains the four characters in the following order: the component separator, repetition separator, escape character, and subcomponent separator.
      Returns:
        ST - encodingChar

    - #### getFieldSeparator

          public ST getFieldSeparator()

      Retrieves the Field Separator. This field contains the separator between the segment ID and the first real field.
      Returns:
        ST - fieldSeparator

    - #### getMessageControlID

          public ST getMessageControlID()

      Retrieves the Message Control ID. This field contains a number or other identifier that uniquely identifies the message.
      Returns:
        ST - messageControlID

    - #### getMessageProfileIdentifier

          public ISingleCollection<EI> getMessageProfileIdentifier()

      Retrieves the Message Profile Identifier. This field specify that Sites may use this field to assert adherence to, or reference, a message profile. Message profiles contain detailed explanations of grammar, syntax, and usage for a particular message or set of messages.
      Returns:
        ISingleCollection - messageProfileIdentifier

    - #### getPrincipalLanguageOfMessage

          public CWE getPrincipalLanguageOfMessage()

      Retrieves the Principal Language Of Message. This field contains the principal language of the message. Codes come from ISO 639.
      Returns:
        CWE - principalLanguageOfMessage

    - #### getProcessingID

          public PT getProcessingID()

      Retrieves the Processing ID. This field is use to decide whether to process the message as defined in HL7 Application or not.
      Returns:
        PT - processingID

    - #### getReceivingApplication

          public HD getReceivingApplication()

      Retrieves the Receiving Application. This field uniquely identify the receiving application among all other applications within the network enterprise
      Returns:
        HD - receivingApplication

    - #### getReceivingFacility

          public HD getReceivingFacility()

      Retrieves the Receiving Facility. This field identify the receiving application among multiple identical instances of the application running on behalf of different organizations.
      Returns:
        HD - receivingFacility

    - #### getSecurity

          public ST getSecurity()

      Retrieves the Security.
      Returns:
        ST - security

    - #### getSendingApplication

          public HD getSendingApplication()

      Retrieves the Sending Application. This field uniquely identifies the sending application among all other applications within the network enterprise.
      Returns:
        HD - sendingApplication

    - #### getSendingFacility

          public HD getSendingFacility()

      Retrieves the Sending Facility. This field used as the HL7 identifier for the user-defined table of values for the first component.
      Returns:
        HD - sendingFacility

    - #### getSequenceNumber

          public NM getSequenceNumber()

      Retrieves the Sequence Number. This field implies that the sequence number protocol is in use.
      Returns:
        NM - sequenceNumber

    - #### getDelimiter

          public IDelimiter getDelimiter()

      Retrieves the Delimiter.
      Returns:
        IDelimiter - delimiter.

    - #### getMessageType

          public MSG getMessageType()

      Retrieves the Message Type. This field contains the message type, trigger event, and the message structure ID for the message.
      Returns:
        MSG - messageType

    - #### getVersionID

          public VID getVersionID()

      Retrieves the Version ID. This field is matched by the receiving system to its own version to be sure the message will be interpreted correctly.
      Returns:
        VID - versionID

    - #### setFieldSeparator

          public void setFieldSeparator(char cfieldSeparator)

      Set the Field Separator. This field contains the separator between the segment ID and the first real field.
      Parameters:
        `cfieldSeparator` - Use as cfieldSeparator.

    - #### setFieldSeparator

          public void setFieldSeparator(ST objfieldSeparator)

      Set the Field Separator. This field contains the separator between the segment ID and the first real field.
      Parameters:
        `objfieldSeparator` - object of fieldSeparator.

    - #### setEncodingChars

          public void setEncodingChars(char cComponentSeparator,
                              char cSubComponentSeparator,
                              char cRepetitionSeparator,
                              char cEscapeCharacter,
                              char cTruncationCharacter)

      Set the Encoding Char. This field contains the four characters in the following order: the component separator, repetition separator, escape character, and subcomponent separator.
      Parameters:
        `cComponentSeparator` - Delimiter Use as ComponentSeparator
        `cSubComponentSeparator` - Delimiter Use as SubComponentSeparator
        `cRepetitionSeparator` - Delimiter Use as RepetitionSeparator
        `cEscapeCharacter` - Delimiter Use as EscapeCharacter
        `cTruncationCharacter` - Delimiter Use as TruncationCharacter

    - #### setEncodingChars

          public void setEncodingChars(ST objencodingChar)

      Set the Encoding Char. This field contains the four characters in the following order: the component separator, repetition separator, escape character, and subcomponent separator.
      Parameters:
        `objencodingChar` - object of Encoding Char.

    - #### setAcceptAcknowledgmentType

          public void setAcceptAcknowledgmentType(java.lang.String strAcceptAcknowledgmentType)

      Set the Accept Acknowledgment Type. This field identify the conditions under which accept acknowledgments are required to be returned in response to this message.
      Parameters:
        `strAcceptAcknowledgmentType` - Specifies the conditions under which accept acknowledgments are required to be returned in response to this message.Suggested Values AL,NE,ER,SU. [Refer Table No 0155]

    - #### setAcceptAcknowledgmentType

          public void setAcceptAcknowledgmentType(ID objacceptAcknowledgmentType)

      Set the Accept Acknowledgment Type. This field identify the conditions under which accept acknowledgments are required to be returned in response to this message.
      Parameters:
        `objacceptAcknowledgmentType` - object of Accept Acknowledgment Type.

    - #### setAlternateCharacterSetHandlingScheme

          public void setAlternateCharacterSetHandlingScheme(java.lang.String strAlternateCharacterSetHandlingScheme)

      Set the Alternate Character Set Handling Scheme. This field specify the Alternate Character Set Handling Scheme.
      Parameters:
        `strAlternateCharacterSetHandlingScheme` - Specifies any special handling scheme that is needed.Suggested Values ISO 2022-1994,2.3,.[Refer Table No 0356]

    - #### setAlternateCharacterSetHandlingScheme

          public void setAlternateCharacterSetHandlingScheme(ID objalternateCharacterSetHandlingScheme)

      Set the Alternate Character Set Handling Scheme. This field specify the Alternate Character Set Handling Scheme.
      Parameters:
        `objalternateCharacterSetHandlingScheme` - object of Alternate Character Set Handling Scheme.

    - #### setApplicationAcknowledgmentType

          public void setApplicationAcknowledgmentType(java.lang.String strApplicationAcknowledgmentType)

      Set the Application Acknowledgment Type. This field contains the conditions under which application acknowledgments are required to be returned in response to this message.
      Parameters:
        `strApplicationAcknowledgmentType` - Specifies the conditions under which application acknowledgments are required to be returned in response to this message.Suggested Values AL,NE,ER,SU. [Refer Table No 0155]

    - #### setApplicationAcknowledgmentType

          public void setApplicationAcknowledgmentType(ID objapplicationAcknowledgmentType)

      Set the Application Acknowledgment Type. This field contains the conditions under which application acknowledgments are required to be returned in response to this message.
      Parameters:
        `objapplicationAcknowledgmentType` - object of Application Acknowledgment Type.

    - #### addCharacterSet

          public void addCharacterSet(java.lang.String strCharacterSet)

      Set the Character Set. This field contains the character set for the entire message.
      Parameters:
        `strCharacterSet` - Specifies the character set for the entire message.Suggested Values ASCII,8859/1 ... [Refer Table No 0211].

    - #### addCharacterSet

          public void addCharacterSet(ID objtempCharacterSet)

      Set the object of Character Set
      Parameters:
        `objtempCharacterSet` - object of Character Set.

    - #### setCharacterSet

          public void setCharacterSet(ISingleCollection<ID> objCharacterSetList)

      Set the CharacterSet list.
      Parameters:
        `objCharacterSetList` - List of CharacterSet

    - #### setContinuationPointer

          public void setContinuationPointer(java.lang.String strContinuationPointer)

      Set the Continuation Pointer. This field is used to define continuations in application-specific ways.
      Parameters:
        `strContinuationPointer` - Specifies continuations in application-specific ways. Only the sender of a fragmented message values this field.

    - #### setContinuationPointer

          public void setContinuationPointer(ST objcontinuationPointer)

      Set the Continuation Pointer. This field is used to define continuations in application-specific ways.
      Parameters:
        `objcontinuationPointer` - object of Continuation Pointer.

    - #### setCountryCode

          public void setCountryCode(java.lang.String strCountryCode)

      Set the Country Code. This field contains the country of origin for the message.
      Parameters:
        `strCountryCode` - Specifies the country of origin for the message. It will be used primarily to specify default elements, such as currency denominations.No Suggested Values.Use 3-character (alphabetic) form of ISO 3166.[Refer Table No 0399].

    - #### setCountryCode

          public void setCountryCode(ID objcountryCode)

      Set the Country Code. This field contains the country of origin for the message.
      Parameters:
        `objcountryCode` - object of Country Code.

    - #### setDateTimeOfMessage

          public void setDateTimeOfMessage(java.lang.String strTime)

      Set the Date Time Of Message. This field contains the date/time that the sending system created the message.
      Parameters:
        `strTime` - Specifies a point in time using a 24-hour clock notation.

    - #### setDateTimeOfMessage

          public void setDateTimeOfMessage(DTM objdateTimeOfMessage)

      Set the Date Time Of Message.
      Parameters:
        `objdateTimeOfMessage` - object of Date Time Of Message.

    - #### setMessageControlID

          public void setMessageControlID(java.lang.String strMessageControlID)

      Set the Message Control ID. This field contains a number or other identifier that uniquely identifies the message.
      Parameters:
        `strMessageControlID` - Specifies a number or other identifier that uniquely identifies the message.

    - #### setMessageControlID

          public void setMessageControlID(ST objmessageControlID)

      Set the Message Control ID. This field contains a number or other identifier that uniquely identifies the message.
      Parameters:
        `objmessageControlID` - object of MessageControlID

    - #### addMessageProfileIdentifier

          public void addMessageProfileIdentifier(java.lang.String strEntityIdentifier,
                                         java.lang.String strNamespaceId,
                                         java.lang.String strUniversalId,
                                         java.lang.String strUniversalIdType)

      Set the Message Profile Identifier. This field specify that Sites may use this field to assert adherence to, or reference, a message profile. Message profiles contain detailed explanations of grammar, syntax, and usage for a particular message or set of messages.
      Parameters:
        `strEntityIdentifier` - Specifies defined by a hierarchic designator, represented by components 2 through 4. [Reference Section 2.A.33, "HD - hierarchic designator".]
        `strNamespaceId` - Specifies the HL7 identifier for the user-defined table of values for this component. [Refer to User-defined Table 0363 - Assigning authority]
        `strUniversalId` - Specifies string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Specifies the interpretation of the second component of the HD.

    - #### addMessageProfileIdentifier

          public void addMessageProfileIdentifier(EI objtempMessageProfileIdentifier)

      Set the Message Profile Identifier. This field specify that Sites may use this field to assert adherence to, or reference, a message profile. Message profiles contain detailed explanations of grammar, syntax, and usage for a particular message or set of messages.
      Parameters:
        `objtempMessageProfileIdentifier` - object of Message Profile Identifier.

    - #### setMessageProfileIdentifier

          public void setMessageProfileIdentifier(ISingleCollection<EI> objMessageProfileIdentifierList)

      Set the MessageProfileIdentifier list.
      Parameters:
        `objMessageProfileIdentifierList` - List of MessageProfileIdentifier

    - #### setMessageType

          public void setMessageType(java.lang.String strMessageCode,
                            java.lang.String strTriggerEvent,
                            java.lang.String strMessageStructure)

      Set the Message Type. This field contains the message type, trigger event, and the message structure ID for the message.
      Parameters:
        `strMessageCode` - Specifies the message type code.Suggested values such as ACK, ADT, ORM, ORU etc.
        `strTriggerEvent` - Specifies the trigger event code.
        `strMessageStructure` - Specifies the abstract message structure code.

    - #### setMessageType

          public void setMessageType(MSG objmessageType)

      Set the Message Type. This field contains the message type, trigger event, and the message structure ID for the message.
      Parameters:
        `objmessageType` - object of Message Type.

    - #### setPrincipalLanguageOfMessage

          public void setPrincipalLanguageOfMessage(java.lang.String strIdentifier,
                                           java.lang.String strText,
                                           java.lang.String strNameOfCodingSystem,
                                           java.lang.String strAlternateIdentifier,
                                           java.lang.String strAlternateText,
                                           java.lang.String strNameOfAlternateCodingSystem,
                                           java.lang.String strCodingSystemVersionID,
                                           java.lang.String strAlternateCodingSystemVersionId,
                                           java.lang.String strOriginalText,
                                           java.lang.String strSecondAlternateIdentifier,
                                           java.lang.String strSecondAlternateText,
                                           java.lang.String strNameofSecondAlternateCodingSystem,
                                           java.lang.String strSecondAlternateCodingSystemVersionID,
                                           java.lang.String strCodingSystemOID,
                                           java.lang.String strValueSetOID,
                                           java.lang.String strValueSetVersionID,
                                           java.lang.String strAlternateCodingSystemOID,
                                           java.lang.String strAlternateValueSetOID,
                                           java.lang.String strAlternateValueSetVersionID,
                                           java.lang.String strSecondAlternateCodingSystemOID,
                                           java.lang.String strSecondAlternateValueSetOID,
                                           java.lang.String strSecondAlternateValueSetVersionID)

      Set the Principal Language Of Message. This field contains the principal language of the message. Codes come from ISO 639.
      Parameters:
        `strIdentifier` - Specifies of characters (the code) that uniquely identifies the item being referenced.
        `strText` - Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction.
        `strNameOfCodingSystem` - Identifies the coding scheme being used in the identifier component.
        `strAlternateIdentifier` - Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
        `strAlternateText` - Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
        `strNameOfAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strCodingSystemVersionID` - A sequence of characters that uniquely identifies a second alternate code.
        `strAlternateCodingSystemVersionId` - This component carries the version for the coding system identified by components 4-6.
        `strOriginalText` - The text as seen and/or selected by the user who entered the data.
        `strSecondAlternateIdentifier` - A sequence of characters that uniquely identifies a second alternate code.
        `strSecondAlternateText` - The descriptive or textual name of the alternate identifier.
        `strNameofSecondAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strSecondAlternateCodingSystemVersionID` - This component carries the version for the coding system identified by components 10-12.
        `strCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
        `strValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
        `strValueSetVersionID` - This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
        `strAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
        `strAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
        `strAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.18. The version is a date.
        `strSecondAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
        `strSecondAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
        `strSecondAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.21. The version is a date.

    - #### setPrincipalLanguageOfMessage

          public void setPrincipalLanguageOfMessage(CWE objprincipalLanguageOfMessage)

      Set the Principal Language Of Message. This field contains the principal language of the message. Codes come from ISO 639.
      Parameters:
        `objprincipalLanguageOfMessage` - object of Principal Language Of Message.

    - #### setProcessingID

          public void setProcessingID(java.lang.String strProcessingId,
                             java.lang.String strProcessingMode)

      Set the Processing ID. This field is use to decide whether to process the message as defined in HL7 Application or not.
      Parameters:
        `strProcessingId` - Specifies a value that defines whether the message is part of a production, training, or debugging system.
        `strProcessingMode` - Specifies a value that defines whether the message is part of an archival process or an initial load.

    - #### setProcessingID

          public void setProcessingID(PT objprocessingID)

      Set the Processing ID. This field is use to decide whether to process the message as defined in HL7 Application or not.
      Parameters:
        `objprocessingID` - object of Processing ID.

    - #### setReceivingApplication

          public void setReceivingApplication(java.lang.String strNamespaceId,
                                     java.lang.String strUniversalId,
                                     java.lang.String strUniversalIdType)

      Set the Receiving Application. This field uniquely identify the receiving application among all other applications within the network enterprise
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setReceivingApplication

          public void setReceivingApplication(HD objreceivingApplication)

      Set the Receiving Application. This field uniquely identify the receiving application among all other applications within the network enterprise
      Parameters:
        `objreceivingApplication` - object of Receiving Application.

    - #### setReceivingFacility

          public void setReceivingFacility(java.lang.String strNamespaceId,
                                  java.lang.String strUniversalId,
                                  java.lang.String strUniversalIdType)

      Set the Receiving Facility. This field identify the receiving application among multiple identical instances of the application running on behalf of different organizations.
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setReceivingFacility

          public void setReceivingFacility(HD objreceivingFacility)

      Set the Receiving Facility. This field identify the receiving application among multiple identical instances of the application running on behalf of different organizations.
      Parameters:
        `objreceivingFacility` - object of Receiving Facility.

    - #### setSecurity

          public void setSecurity(java.lang.String strSecurity)

      Set the Security.
      Parameters:
        `strSecurity` - Specifies a field ,that is used to implement security features.

    - #### setSecurity

          public void setSecurity(ST objsecurity)

      Set the Security.
      Parameters:
        `objsecurity` - object of Security.

    - #### setSendingApplication

          public void setSendingApplication(java.lang.String strNamespaceId,
                                   java.lang.String strUniversalId,
                                   java.lang.String strUniversalIdType)

      Set the Sending Application. This field uniquely identifies the sending application among all other applications within the network enterprise.
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setSendingApplication

          public void setSendingApplication(HD objsendingApplication)

      Set the Sending Application. This field uniquely identifies the sending application among all other applications within the network enterprise.
      Parameters:
        `objsendingApplication` - object of Sending Application.

    - #### setSendingFacility

          public void setSendingFacility(java.lang.String strNamespaceId,
                                java.lang.String strUniversalId,
                                java.lang.String strUniversalIdType)

      Set the Sending Facility. This field used as the HL7 identifier for the user-defined table of values for the first component.
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setSendingFacility

          public void setSendingFacility(HD objsendingFacility)

      Set the Sending Facility. This field used as the HL7 identifier for the user-defined table of values for the first component.
      Parameters:
        `objsendingFacility` - object of Sending Facility.

    - #### setSequenceNumber

          public void setSequenceNumber(java.lang.String strSequenceNumber)

      Set the Sequence Number. This field implies that the sequence number protocol is in use.
      Parameters:
        `strSequenceNumber` - Specifies a non null value in this field implies that the sequence number protocol is in use.

    - #### setSequenceNumber

          public void setSequenceNumber(NM objsequenceNumber)

      Set the Sequence Number. This field implies that the sequence number protocol is in use.
      Parameters:
        `objsequenceNumber` - object of Sequence Number.

    - #### setVersionID

          public void setVersionID(java.lang.String strVersionId,
                          CWE objInternationalizationCode,
                          CWE objInternationalVersionId)

      Set the Version ID. This field is matched by the receiving system to its own version to be sure the message will be interpreted correctly.
      Parameters:
        `strVersionId` - Used to identify the HL7 version.
        `objInternationalizationCode` - Used to identify the international affiliate country code.
        `objInternationalVersionId` - International affiliate's version.

    - #### setVersionID

          public void setVersionID(VID objversionID)

      Set the Version ID. This field is matched by the receiving system to its own version to be sure the message will be interpreted correctly.
      Parameters:
        `objversionID` - object of Version ID.

    - #### getSendingResponsibleOrganization

          public XON getSendingResponsibleOrganization()

      Retrieves the Sending Responsible Organization. Business organization that originated and is accountable for the content of the message.
      Returns:
        XON - SendingResponsibleOrganization

    - #### setSendingResponsibleOrganization

          public void setSendingResponsibleOrganization(java.lang.String strOrganizationName,
                                               CWE objOrganizationNameTypeCode,
                                               HD objAssigningAuthority,
                                               java.lang.String strIdentifierTypeCode,
                                               HD objAssigningFacility,
                                               java.lang.String strNameRepresentationCode,
                                               java.lang.String strOrganizationIdentifier)

      Set the Sending Responsible Organization. Business organization that originated and is accountable for the content of the message.
      Parameters:
        `strOrganizationName` - Specifies name of the specified organization.
        `strOrganizationNameTypeCode` - Specifies a code that represents the type of name i.e., legal name, display name. Suggested Values A,L,D,SL.[Refer to table No.0204]
        `objAssigningAuthority` - Specifies The assigning authority is a unique identifier of the system (or organization or agency or department) that creates the data.
        `strIdentifierTypeCode` - Specifies a code corresponding to the type of identifier.
        `objAssigningFacility` - Specifies The place or location identifier where the identifier was first assigned to the person.
        `strNameRepresentationCode` - Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
        `strOrganizationIdentifier` - This component contains the sequence of characters (the code) that uniquely identifies the item being referenced by XON.1 Organization Name. This component replaces XON.3 ID Number as of v 2.5.

    - #### setSendingResponsibleOrganization

          public void setSendingResponsibleOrganization(XON objSendingResponsibleOrganization)

      Ses the Sending Responsible Organization. Business organization that originated and is accountable for the content of the message.
      Parameters:
        `objSendingResponsibleOrganization` - object of Sending Responsible Organization.

    - #### getReceivingResponsibleOrganization

          public XON getReceivingResponsibleOrganization()

      Retrieves the Receiving Responsible Organization. Business organization that is the intended receiver of the message and is accountable for acting on the data conveyed by the transaction.
      Returns:
        XON - ReceivingResponsibleOrganization

    - #### setReceivingResponsibleOrganization

          public void setReceivingResponsibleOrganization(java.lang.String strOrganizationName,
                                                 CWE objOrganizationNameTypeCode,
                                                 HD objAssigningAuthority,
                                                 java.lang.String strIdentifierTypeCode,
                                                 HD objAssigningFacility,
                                                 java.lang.String strNameRepresentationCode,
                                                 java.lang.String strOrganizationIdentifier)

      Set the Receiving Responsible Organization. Business organization that is the intended receiver of the message and is accountable for acting on the data conveyed by the transaction.
      Parameters:
        `strOrganizationName` - Specifies name of the specified organization.
        `strOrganizationNameTypeCode` - Specifies a code that represents the type of name i.e., legal name, display name. Suggested Values A,L,D,SL.[Refer to table No.0204]
        `objAssigningAuthority` - Specifies The assigning authority is a unique identifier of the system (or organization or agency or department) that creates the data.
        `strIdentifierTypeCode` - Specifies a code corresponding to the type of identifier.
        `objAssigningFacility` - Specifies The place or location identifier where the identifier was first assigned to the person.
        `strNameRepresentationCode` - Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
        `strOrganizationIdentifier` - This component contains the sequence of characters (the code) that uniquely identifies the item being referenced by XON.1 Organization Name. This component replaces XON.3 ID Number as of v 2.5.

    - #### setReceivingResponsibleOrganization

          public void setReceivingResponsibleOrganization(XON objReceivingResponsibleOrganization)

      Ses the Receiving Responsible Organization. Business organization that is the intended receiver of the message and is accountable for acting on the data conveyed by the transaction.
      Parameters:
        `objReceivingResponsibleOrganization` - object of Receiving Responsible Organization.

    - #### getSendingNetworkAddress

          public HD getSendingNetworkAddress()

      Retrieves the Sending Network Address. Identifier of the network location the message was transmitted from.
      Returns:
        HD - receivingApplication

    - #### setSendingNetworkAddress

          public void setSendingNetworkAddress(java.lang.String strNamespaceId,
                                      java.lang.String strUniversalId,
                                      java.lang.String strUniversalIdType)

      Set the Sending Network Address. Identifier of the network location the message was transmitted from.
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setSendingNetworkAddress

          public void setSendingNetworkAddress(HD objReceivingApplication)

      Set the Sending Network Address. Identifier of the network location the message was transmitted from.
      Parameters:
        `objReceivingApplication` - Object of Receiving Application.

    - #### getReceivingNetworkAddress

          public HD getReceivingNetworkAddress()

      Retrieves the Receiving Network Address. Identifier of the network location the message was transmitted to.
      Returns:
        HD - receivingApplication

    - #### setReceivingNetworkAddress

          public void setReceivingNetworkAddress(java.lang.String strNamespaceId,
                                        java.lang.String strUniversalId,
                                        java.lang.String strUniversalIdType)

      Set the Receiving Network Address. Identifier of the network location the message was transmitted to.
      Parameters:
        `strNamespaceId` - Specifies Specifies the HL7 identifier for the user-defined table of values for this component.[Refer Table No.300]
        `strUniversalId` - Specifies a string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Governs the interpretation of the strUniversalId.

    - #### setReceivingNetworkAddress

          public void setReceivingNetworkAddress(HD objReceivingApplication)

      Set the Receiving Network Address. Identifier of the network location the message was transmitted to.
      Parameters:
        `objReceivingApplication` - Object of Receiving Application.

    - #### validate

          public boolean validate()
                           throws InvalidSegmentException

      Validates HL7 Message objects . Validate method checks for validation each and every segments in side the Message object against specified message Structure. Validation chcecks include optionality of segment or group. It also verifies the number of times segment or group is repeated in message. e.g {PSH} while parsing PSH segment validate method will check for its mandatory presence. [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
      Specified by:
        `validate` in interface `ISegment`
      Overrides:
        `validate` in class `Segment`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidSegmentException` - Thrown when Any of required filed is missing.

    - #### serialize

          public int serialize(IHL7Stream objIHL7Stream,
                      IDelimiter objIDelimiter)
                        throws SerializeException,
                               java.io.IOException

      Serializes HL7 Message objects. Before serializaton it validates Message as per HL7 v2.5 standard. For successfull serialization , Message Object should follow order of segments as per its corresponding Message Structure. Serialize method fails if given stream is null. It mandates presence of required segments and the number of occurences specified by the standard. This method also checks for presence of Mandatory Groups.It also verifies repeatability of Group.
      Specified by:
        `serialize` in interface `ISegment`
      Overrides:
        `serialize` in class `Segment`
      Parameters:
        `objIHL7Stream` - Object of IHL7Stream.
        `objIDelimiter` - Object of class Delimiter.
      Returns:
        int - [failure or success].
      Throws:
        `SerializeException` - Thrown when serialization of Message fails.
        `java.io.IOException` - Signals that an I/O exception of some sort has occurred.

    - #### parse

          public int parse(java.lang.String strSegmentStream,
                  IDelimiter objIDelimiter)
                    throws InvalidSegmentException,
                           java.io.IOException

      Parses HL7 Segment Strings from any Stream into HL7 Segment object. This method checks for the Repetition of the fields in the Segment. It also checks for the optionality of the fields as whether they are mandatory or optional. Successful parsing of the segment populates the object with the data present on the stream and provides easy accessor and mutator methods to navigate the message. It also leads to failure if version of given HL7 Message is not 2.8.2. This method raises exception if there is Segment which is not valid as per HL7 v 2.8.2 standard.
      Specified by:
        `parse` in interface `ISegment`
      Overrides:
        `parse` in class `Segment`
      Parameters:
        `strSegmentStream` - String from HL7Stream.
        `objIDelimiter` - Object of class Delimiter.
      Returns:
        int - Success if segment is valid. - Fail if segment in not valid.
      Throws:
        `InvalidSegmentException` - Thrown when Field Validation Fails.
        `java.io.IOException` - Signals that an I/O exception of some sort has occurred.