Class ACK

All Implemented Interfaces:
Group, Message, Structure, Visitable, Serializable

public class ACK extends AbstractMessage

Represents a ACK message structure (see chapter 2.14.1). This structure contains the following elements:

  • 1: MSH (Message Header)
  • 2: SFT (Software Segment) optional repeating
  • 3: MSA (Message Acknowledgment)
  • 4: ERR (Error) optional repeating
See Also:
  • Constructor Details

    • ACK

      public ACK()
      Creates a new ACK message with DefaultModelClassFactory.
    • ACK

      public ACK(ModelClassFactory factory)
      Creates a new ACK message with custom ModelClassFactory.
  • Method Details

    • getVersion

      public String getVersion()
      Returns "2.5.1"
      Specified by:
      getVersion in interface Message
      Overrides:
      getVersion in class AbstractMessage
    • getMSH

      public MSH getMSH()

      Returns MSH (Message Header) - creates it if necessary

    • getSFT

      public SFT getSFT()

      Returns the first repetition of SFT (Software Segment) - creates it if necessary

    • getSFT

      public SFT getSFT(int rep)

      Returns a specific repetition of SFT (Software Segment) - creates it if necessary

      Parameters:
      rep - The repetition index (0-indexed, i.e. the first repetition is at index 0)
      Throws:
      HL7Exception - if the repetition requested is more than one greater than the number of existing repetitions.
    • getSFTReps

      public int getSFTReps()

      Returns the number of existing repetitions of SFT

    • getSFTAll

      public List<SFT> getSFTAll() throws HL7Exception

      Returns a non-modifiable List containing all current existing repetitions of SFT.

      Note that unlike getSFT(), this method will not create any reps if none are already present, so an empty list may be returned.

      Throws:
      HL7Exception
    • insertSFT

      public void insertSFT(SFT structure, int rep) throws HL7Exception

      Inserts a specific repetition of SFT (Software Segment)

      Throws:
      HL7Exception
      See Also:
      • AbstractGroup#insertRepetition(Structure, int)
    • insertSFT

      public SFT insertSFT(int rep) throws HL7Exception

      Inserts a specific repetition of SFT (Software Segment)

      Throws:
      HL7Exception
      See Also:
      • AbstractGroup#insertRepetition(Structure, int)
    • removeSFT

      public SFT removeSFT(int rep) throws HL7Exception

      Removes a specific repetition of SFT (Software Segment)

      Throws:
      HL7Exception
      See Also:
    • getMSA

      public MSA getMSA()

      Returns MSA (Message Acknowledgment) - creates it if necessary

    • getERR

      public ERR getERR()

      Returns the first repetition of ERR (Error) - creates it if necessary

    • getERR

      public ERR getERR(int rep)

      Returns a specific repetition of ERR (Error) - creates it if necessary

      Parameters:
      rep - The repetition index (0-indexed, i.e. the first repetition is at index 0)
      Throws:
      HL7Exception - if the repetition requested is more than one greater than the number of existing repetitions.
    • getERRReps

      public int getERRReps()

      Returns the number of existing repetitions of ERR

    • getERRAll

      public List<ERR> getERRAll() throws HL7Exception

      Returns a non-modifiable List containing all current existing repetitions of ERR.

      Note that unlike getERR(), this method will not create any reps if none are already present, so an empty list may be returned.

      Throws:
      HL7Exception
    • insertERR

      public void insertERR(ERR structure, int rep) throws HL7Exception

      Inserts a specific repetition of ERR (Error)

      Throws:
      HL7Exception
      See Also:
      • AbstractGroup#insertRepetition(Structure, int)
    • insertERR

      public ERR insertERR(int rep) throws HL7Exception

      Inserts a specific repetition of ERR (Error)

      Throws:
      HL7Exception
      See Also:
      • AbstractGroup#insertRepetition(Structure, int)
    • removeERR

      public ERR removeERR(int rep) throws HL7Exception

      Removes a specific repetition of ERR (Error)

      Throws:
      HL7Exception
      See Also: