Class REF_I12

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

public class REF_I12 extends AbstractMessage

Represents a REF_I12 message structure (see chapter 11). This structure contains the following elements:

  • 1: MSH (Message Header)
  • 2: RF1 (Referral Information) optional
  • 3: REF_I12_AUTHORIZATION_CONTACT (a Group object) optional
  • 4: REF_I12_PROVIDER_CONTACT (a Group object) repeating
  • 5: PID (Patient identification)
  • 6: NK1 (Next of kin / associated parties) optional repeating
  • 7: GT1 (Guarantor) optional repeating
  • 8: REF_I12_INSURANCE (a Group object) optional repeating
  • 9: ACC (Accident) optional
  • 10: DG1 (Diagnosis) optional repeating
  • 11: DRG (Diagnosis Related Group) optional repeating
  • 12: AL1 (Patient allergy information) optional repeating
  • 13: REF_I12_PROCEDURE (a Group object) optional repeating
  • 14: REF_I12_OBSERVATION (a Group object) optional repeating
  • 15: REF_I12_PATIENT_VISIT (a Group object) optional
  • 16: NTE (Notes and Comments) optional repeating
See Also:
  • Constructor Details

    • REF_I12

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

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

    • getVersion

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

      public MSH getMSH()

      Returns MSH (Message Header) - creates it if necessary

    • getRF1

      public RF1 getRF1()

      Returns RF1 (Referral Information) - creates it if necessary

    • getAUTHORIZATION_CONTACT

      Returns AUTHORIZATION_CONTACT (a Group object) - creates it if necessary

    • getPROVIDER_CONTACT

      Returns the first repetition of PROVIDER_CONTACT (a Group object) - creates it if necessary

    • getPROVIDER_CONTACT

      Returns a specific repetition of PROVIDER_CONTACT (a Group object) - 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.
    • getPROVIDER_CONTACTReps

      Returns the number of existing repetitions of PROVIDER_CONTACT

    • getPROVIDER_CONTACTAll

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

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

      Throws:
      HL7Exception
    • insertPROVIDER_CONTACT

      public void insertPROVIDER_CONTACT(REF_I12_PROVIDER_CONTACT structure, int rep) throws HL7Exception

      Inserts a specific repetition of PROVIDER_CONTACT (a Group object)

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

      Inserts a specific repetition of PROVIDER_CONTACT (a Group object)

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

      Removes a specific repetition of PROVIDER_CONTACT (a Group object)

      Throws:
      HL7Exception
      See Also:
    • getPID

      public PID getPID()

      Returns PID (Patient identification) - creates it if necessary

    • getNK1

      public NK1 getNK1()

      Returns the first repetition of NK1 (Next of kin / associated parties) - creates it if necessary

    • getNK1

      public NK1 getNK1(int rep)

      Returns a specific repetition of NK1 (Next of kin / associated parties) - 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.
    • getNK1Reps

      public int getNK1Reps()

      Returns the number of existing repetitions of NK1

    • getNK1All

      public List<NK1> getNK1All() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertNK1

      public void insertNK1(NK1 structure, int rep) throws HL7Exception

      Inserts a specific repetition of NK1 (Next of kin / associated parties)

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

      public NK1 insertNK1(int rep) throws HL7Exception

      Inserts a specific repetition of NK1 (Next of kin / associated parties)

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

      public NK1 removeNK1(int rep) throws HL7Exception

      Removes a specific repetition of NK1 (Next of kin / associated parties)

      Throws:
      HL7Exception
      See Also:
    • getGT1

      public GT1 getGT1()

      Returns the first repetition of GT1 (Guarantor) - creates it if necessary

    • getGT1

      public GT1 getGT1(int rep)

      Returns a specific repetition of GT1 (Guarantor) - 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.
    • getGT1Reps

      public int getGT1Reps()

      Returns the number of existing repetitions of GT1

    • getGT1All

      public List<GT1> getGT1All() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertGT1

      public void insertGT1(GT1 structure, int rep) throws HL7Exception

      Inserts a specific repetition of GT1 (Guarantor)

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

      public GT1 insertGT1(int rep) throws HL7Exception

      Inserts a specific repetition of GT1 (Guarantor)

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

      public GT1 removeGT1(int rep) throws HL7Exception

      Removes a specific repetition of GT1 (Guarantor)

      Throws:
      HL7Exception
      See Also:
    • getINSURANCE

      Returns the first repetition of INSURANCE (a Group object) - creates it if necessary

    • getINSURANCE

      public REF_I12_INSURANCE getINSURANCE(int rep)

      Returns a specific repetition of INSURANCE (a Group object) - 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.
    • getINSURANCEReps

      public int getINSURANCEReps()

      Returns the number of existing repetitions of INSURANCE

    • getINSURANCEAll

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

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

      Throws:
      HL7Exception
    • insertINSURANCE

      public void insertINSURANCE(REF_I12_INSURANCE structure, int rep) throws HL7Exception

      Inserts a specific repetition of INSURANCE (a Group object)

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

      Inserts a specific repetition of INSURANCE (a Group object)

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

      Removes a specific repetition of INSURANCE (a Group object)

      Throws:
      HL7Exception
      See Also:
    • getACC

      public ACC getACC()

      Returns ACC (Accident) - creates it if necessary

    • getDG1

      public DG1 getDG1()

      Returns the first repetition of DG1 (Diagnosis) - creates it if necessary

    • getDG1

      public DG1 getDG1(int rep)

      Returns a specific repetition of DG1 (Diagnosis) - 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.
    • getDG1Reps

      public int getDG1Reps()

      Returns the number of existing repetitions of DG1

    • getDG1All

      public List<DG1> getDG1All() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertDG1

      public void insertDG1(DG1 structure, int rep) throws HL7Exception

      Inserts a specific repetition of DG1 (Diagnosis)

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

      public DG1 insertDG1(int rep) throws HL7Exception

      Inserts a specific repetition of DG1 (Diagnosis)

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

      public DG1 removeDG1(int rep) throws HL7Exception

      Removes a specific repetition of DG1 (Diagnosis)

      Throws:
      HL7Exception
      See Also:
    • getDRG

      public DRG getDRG()

      Returns the first repetition of DRG (Diagnosis Related Group) - creates it if necessary

    • getDRG

      public DRG getDRG(int rep)

      Returns a specific repetition of DRG (Diagnosis Related Group) - 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.
    • getDRGReps

      public int getDRGReps()

      Returns the number of existing repetitions of DRG

    • getDRGAll

      public List<DRG> getDRGAll() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertDRG

      public void insertDRG(DRG structure, int rep) throws HL7Exception

      Inserts a specific repetition of DRG (Diagnosis Related Group)

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

      public DRG insertDRG(int rep) throws HL7Exception

      Inserts a specific repetition of DRG (Diagnosis Related Group)

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

      public DRG removeDRG(int rep) throws HL7Exception

      Removes a specific repetition of DRG (Diagnosis Related Group)

      Throws:
      HL7Exception
      See Also:
    • getAL1

      public AL1 getAL1()

      Returns the first repetition of AL1 (Patient allergy information) - creates it if necessary

    • getAL1

      public AL1 getAL1(int rep)

      Returns a specific repetition of AL1 (Patient allergy information) - 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.
    • getAL1Reps

      public int getAL1Reps()

      Returns the number of existing repetitions of AL1

    • getAL1All

      public List<AL1> getAL1All() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertAL1

      public void insertAL1(AL1 structure, int rep) throws HL7Exception

      Inserts a specific repetition of AL1 (Patient allergy information)

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

      public AL1 insertAL1(int rep) throws HL7Exception

      Inserts a specific repetition of AL1 (Patient allergy information)

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

      public AL1 removeAL1(int rep) throws HL7Exception

      Removes a specific repetition of AL1 (Patient allergy information)

      Throws:
      HL7Exception
      See Also:
    • getPROCEDURE

      Returns the first repetition of PROCEDURE (a Group object) - creates it if necessary

    • getPROCEDURE

      public REF_I12_PROCEDURE getPROCEDURE(int rep)

      Returns a specific repetition of PROCEDURE (a Group object) - 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.
    • getPROCEDUREReps

      public int getPROCEDUREReps()

      Returns the number of existing repetitions of PROCEDURE

    • getPROCEDUREAll

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

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

      Throws:
      HL7Exception
    • insertPROCEDURE

      public void insertPROCEDURE(REF_I12_PROCEDURE structure, int rep) throws HL7Exception

      Inserts a specific repetition of PROCEDURE (a Group object)

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

      Inserts a specific repetition of PROCEDURE (a Group object)

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

      Removes a specific repetition of PROCEDURE (a Group object)

      Throws:
      HL7Exception
      See Also:
    • getOBSERVATION

      Returns the first repetition of OBSERVATION (a Group object) - creates it if necessary

    • getOBSERVATION

      Returns a specific repetition of OBSERVATION (a Group object) - 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.
    • getOBSERVATIONReps

      public int getOBSERVATIONReps()

      Returns the number of existing repetitions of OBSERVATION

    • getOBSERVATIONAll

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

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

      Throws:
      HL7Exception
    • insertOBSERVATION

      public void insertOBSERVATION(REF_I12_OBSERVATION structure, int rep) throws HL7Exception

      Inserts a specific repetition of OBSERVATION (a Group object)

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

      Inserts a specific repetition of OBSERVATION (a Group object)

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

      Removes a specific repetition of OBSERVATION (a Group object)

      Throws:
      HL7Exception
      See Also:
    • getPATIENT_VISIT

      Returns PATIENT_VISIT (a Group object) - creates it if necessary

    • getNTE

      public NTE getNTE()

      Returns the first repetition of NTE (Notes and Comments) - creates it if necessary

    • getNTE

      public NTE getNTE(int rep)

      Returns a specific repetition of NTE (Notes and Comments) - 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.
    • getNTEReps

      public int getNTEReps()

      Returns the number of existing repetitions of NTE

    • getNTEAll

      public List<NTE> getNTEAll() throws HL7Exception

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

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

      Throws:
      HL7Exception
    • insertNTE

      public void insertNTE(NTE structure, int rep) throws HL7Exception

      Inserts a specific repetition of NTE (Notes and Comments)

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

      public NTE insertNTE(int rep) throws HL7Exception

      Inserts a specific repetition of NTE (Notes and Comments)

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

      public NTE removeNTE(int rep) throws HL7Exception

      Removes a specific repetition of NTE (Notes and Comments)

      Throws:
      HL7Exception
      See Also: