Class ODS

All Implemented Interfaces:
Segment, Structure, Visitable, Serializable

public class ODS extends AbstractSegment

Represents an HL7 ODS message segment (DIETARY ORDERS, SUPPLEMENTS, and PREFERENCES). This segment has the following fields:

  • ODS-1: Type (ID)
  • ODS-2: Service Period (CE) optional repeating
  • ODS-3: Diet, Supplement, or Preference Code (CE) repeating
  • ODS-4: Text Instruction (ST) optional repeating
See Also:
  • Constructor Details

  • Method Details

    • getType

      public ID getType()
      Returns ODS-1: "Type" - creates it if necessary
    • getOds1_Type

      public ID getOds1_Type()
      Returns ODS-1: "Type" - creates it if necessary
    • getServicePeriod

      public CE[] getServicePeriod()
      Returns all repetitions of Service Period (ODS-2).
    • getOds2_ServicePeriod

      Returns all repetitions of Service Period (ODS-2).
    • getServicePeriodReps

      public int getServicePeriodReps()
      Returns a count of the current number of repetitions of Service Period (ODS-2). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getServicePeriod

      public CE getServicePeriod(int rep)
      Returns a specific repetition of ODS-2: "Service Period" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds2_ServicePeriod

      public CE getOds2_ServicePeriod(int rep)
      Returns a specific repetition of ODS-2: "Service Period" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds2_ServicePeriodReps

      Returns a count of the current number of repetitions of Service Period (ODS-2). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertServicePeriod

      public CE insertServicePeriod(int rep) throws HL7Exception
      Inserts a repetition of ODS-2: "Service Period" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertOds2_ServicePeriod

      public CE insertOds2_ServicePeriod(int rep) throws HL7Exception
      Inserts a repetition of ODS-2: "Service Period" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeServicePeriod

      public CE removeServicePeriod(int rep) throws HL7Exception
      Removes a repetition of ODS-2: "Service Period" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeOds2_ServicePeriod

      public CE removeOds2_ServicePeriod(int rep) throws HL7Exception
      Removes a repetition of ODS-2: "Service Period" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getDietSupplementOrPreferenceCode

      Returns all repetitions of Diet, Supplement, or Preference Code (ODS-3).
    • getOds3_DietSupplementOrPreferenceCode

      Returns all repetitions of Diet, Supplement, or Preference Code (ODS-3).
    • getDietSupplementOrPreferenceCodeReps

      Returns a count of the current number of repetitions of Diet, Supplement, or Preference Code (ODS-3). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getDietSupplementOrPreferenceCode

      Returns a specific repetition of ODS-3: "Diet, Supplement, or Preference Code" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds3_DietSupplementOrPreferenceCode

      Returns a specific repetition of ODS-3: "Diet, Supplement, or Preference Code" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds3_DietSupplementOrPreferenceCodeReps

      Returns a count of the current number of repetitions of Diet, Supplement, or Preference Code (ODS-3). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertDietSupplementOrPreferenceCode

      Inserts a repetition of ODS-3: "Diet, Supplement, or Preference Code" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertOds3_DietSupplementOrPreferenceCode

      Inserts a repetition of ODS-3: "Diet, Supplement, or Preference Code" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeDietSupplementOrPreferenceCode

      Removes a repetition of ODS-3: "Diet, Supplement, or Preference Code" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeOds3_DietSupplementOrPreferenceCode

      Removes a repetition of ODS-3: "Diet, Supplement, or Preference Code" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • getTextInstruction

      public ST[] getTextInstruction()
      Returns all repetitions of Text Instruction (ODS-4).
    • getOds4_TextInstruction

      Returns all repetitions of Text Instruction (ODS-4).
    • getTextInstructionReps

      public int getTextInstructionReps()
      Returns a count of the current number of repetitions of Text Instruction (ODS-4). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • getTextInstruction

      public ST getTextInstruction(int rep)
      Returns a specific repetition of ODS-4: "Text Instruction" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds4_TextInstruction

      public ST getOds4_TextInstruction(int rep)
      Returns a specific repetition of ODS-4: "Text Instruction" - creates it if necessary
      Parameters:
      rep - The repetition index (0-indexed)
    • getOds4_TextInstructionReps

      Returns a count of the current number of repetitions of Text Instruction (ODS-4). This method does not create a repetition, so if no repetitions have currently been defined or accessed, it will return zero.
    • insertTextInstruction

      public ST insertTextInstruction(int rep) throws HL7Exception
      Inserts a repetition of ODS-4: "Text Instruction" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • insertOds4_TextInstruction

      public ST insertOds4_TextInstruction(int rep) throws HL7Exception
      Inserts a repetition of ODS-4: "Text Instruction" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeTextInstruction

      public ST removeTextInstruction(int rep) throws HL7Exception
      Removes a repetition of ODS-4: "Text Instruction" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • removeOds4_TextInstruction

      public ST removeOds4_TextInstruction(int rep) throws HL7Exception
      Removes a repetition of ODS-4: "Text Instruction" at a specific index
      Parameters:
      rep - The repetition index (0-indexed)
      Throws:
      HL7Exception - If the rep is invalid (below 0, or too high for the allowable repetitions)
    • createNewTypeWithoutReflection

      protected Type createNewTypeWithoutReflection(int field)
      Overrides:
      createNewTypeWithoutReflection in class AbstractSegment