cdac.medinfo.sdk.hl7282.baselibs.segments

## Class MSA

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

- All Implemented Interfaces:
    ISegment

      public class MSA
      extends Segment

  MSA - Message Acknowledgment Segment.

  The MSA segment contains information sent while acknowledging another message.

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

  MSA-1: Acknowledgment Code (ID)Required
  MSA-2: Message Control ID (ST)Required
  MSA-3: Text Message (ST)Withdrawn
  MSA-4: Expected Sequence Number (NM)Optional
  MSA-5: Delayed Acknowledgment Type (ID)Withdrawn
  MSA-6: Error Condition (CE)Withdrawn
  MSA-7: Message Waiting Number (NM)Optional
  MSA-8: Message Waiting Priority (ID)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
    `MSA()` Constructs the MSA segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ID` | `getAcknowledgmentCode()` Retrieves the Acknowledgment Code.
    `NM` | `getExpectedSequenceNumber()` Retrieves the Expected Sequence Number.
    `ST` | `getMessageControlID()` Retrieves the Message Control ID.
    `NM` | `getMessageWaitingNumber()` Retrieves the Message Waiting Number .
    `ID` | `getMessageWaitingPriority()` Retrieves the Message Waiting Priority .
    `void` | `setAcknowledgmentCode(ID objacknowledgmentCode)` Set the Acknowledgment Code.
    `void` | `setAcknowledgmentCode(java.lang.String strAcknowledgmentCode)` Set the Acknowledgment Code.
    `void` | `setExpectedSequenceNumber(NM objexpectedSequenceNumber)` Set the Expected Sequence Number.
    `void` | `setExpectedSequenceNumber(java.lang.String strExpectedSequenceNumber)` Set the Expected Sequence Number.
    `void` | `setMessageControlID(ST objmessageControlID)` Set the Message Control ID.
    `void` | `setMessageControlID(java.lang.String strMessageControlID)` Set the Message Control ID.
    `void` | `setMessageWaitingNumber(NM objMessageWaitingNumber)` Set the Message Waiting Number .
    `void` | `setMessageWaitingNumber(java.lang.String strMessageWaitingNumber)` Set the Message Waiting Number .
    `void` | `setMessageWaitingPriority(ID objMessageWaitingPriority)` Set the Message Waiting Priority .
    `void` | `setMessageWaitingPriority(java.lang.String strMessageWaitingPriority)` Set the Message Waiting Priority .
    `boolean` | `validate()` Validates HL7 Message objects .

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

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

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

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

- - ### Constructor Detail

    - #### MSA

          public MSA()

      Constructs the MSA segment.

  - ### Method Detail

    - #### getAcknowledgmentCode

          public ID getAcknowledgmentCode()

      Retrieves the Acknowledgment Code. This field contains an acknowledgment code.
      Returns:
        ID - acknowledgmentCode

    - #### getExpectedSequenceNumber

          public NM getExpectedSequenceNumber()

      Retrieves the Expected Sequence Number. This field used in the sequence number protocol.
      Returns:
        NM - expectedSequenceNumber

    - #### getMessageControlID

          public ST getMessageControlID()

      Retrieves the Message Control ID. This field contains the message control ID of the message sent by the sending system.
      Returns:
        ST - messageControlID

    - #### setAcknowledgmentCode

          public void setAcknowledgmentCode(java.lang.String strAcknowledgmentCode)

      Set the Acknowledgment Code. This field contains an acknowledgment code.
      Parameters:
        `strAcknowledgmentCode` - This field contains the String Value of Acknowledgment Code

    - #### setAcknowledgmentCode

          public void setAcknowledgmentCode(ID objacknowledgmentCode)

      Set the Acknowledgment Code. This field contains an acknowledgment code.
      Parameters:
        `objacknowledgmentCode` - object of Acknowledgment Code

    - #### setExpectedSequenceNumber

          public void setExpectedSequenceNumber(java.lang.String strExpectedSequenceNumber)

      Set the Expected Sequence Number. This field used in the sequence number protocol.
      Parameters:
        `strExpectedSequenceNumber` - String which to set as Expected Sequence Number.

    - #### setExpectedSequenceNumber

          public void setExpectedSequenceNumber(NM objexpectedSequenceNumber)

      Set the Expected Sequence Number. This field used in the sequence number protocol.
      Parameters:
        `objexpectedSequenceNumber` - object of Expected Sequence Number.

    - #### setMessageControlID

          public void setMessageControlID(java.lang.String strMessageControlID)

      Set the Message Control ID. This field contains the message control ID of the message sent by the sending system.
      Parameters:
        `strMessageControlID` - String which to set as Message Control ID

    - #### setMessageControlID

          public void setMessageControlID(ST objmessageControlID)

      Set the Message Control ID. This field contains the message control ID of the message sent by the sending system.
      Parameters:
        `objmessageControlID` - object of Message Control ID

    - #### getMessageWaitingNumber

          public NM getMessageWaitingNumber()

      Retrieves the Message Waiting Number . If present, indicates the number of messages the Acknowledging Application has waiting on a queue for the Requesting Application.
      Returns:
        NM - MessageWaitingNumber

    - #### setMessageWaitingNumber

          public void setMessageWaitingNumber(java.lang.String strMessageWaitingNumber)

      Set the Message Waiting Number . If present, indicates the number of messages the Acknowledging Application has waiting on a queue for the Requesting Application.
      Parameters:
        `strMessageWaitingNumber` - Specifies Message Waiting Number

    - #### setMessageWaitingNumber

          public void setMessageWaitingNumber(NM objMessageWaitingNumber)

      Set the Message Waiting Number . If present, indicates the number of messages the Acknowledging Application has waiting on a queue for the Requesting Application.
      Parameters:
        `objMessageWaitingNumber` - Specifies Message Waiting Number

    - #### getMessageWaitingPriority

          public ID getMessageWaitingPriority()

      Retrieves the Message Waiting Priority . If present, indicates that the Sending Application has messages waiting on a queue for the Receiving Application.
      Returns:
        ID - MessageWaitingPriority

    - #### setMessageWaitingPriority

          public void setMessageWaitingPriority(java.lang.String strMessageWaitingPriority)

      Set the Message Waiting Priority . If present, indicates that the Sending Application has messages waiting on a queue for the Receiving Application.
      Parameters:
        `strMessageWaitingPriority` - Specifies the the intent of the message

    - #### setMessageWaitingPriority

          public void setMessageWaitingPriority(ID objMessageWaitingPriority)

      Set the Message Waiting Priority . If present, indicates that the Sending Application has messages waiting on a queue for the Receiving Application.
      Parameters:
        `objMessageWaitingPriority` - Specifies the the intent of the message

    - #### 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` - Throws when Segment Validation fails