ca.uhn.hl7v2.model.v25.group.RGV_O15_ORDER Maven / Gradle / Ivy
/*
* This class is an auto-generated source file for a HAPI
* HL7 v2.x standard structure class.
*
* For more information, visit: http://hl7api.sourceforge.net/
*/
package ca.uhn.hl7v2.model.v25.group;
import ca.uhn.hl7v2.model.v25.segment.*;
import ca.uhn.log.HapiLogFactory;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
import ca.uhn.hl7v2.model.AbstractMessage;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.AbstractGroup;
import ca.uhn.hl7v2.model.GenericSegment;
/**
* Represents a RGV_O15_ORDER group structure (a Group object).
* A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
* This Group contains the following elements:
*
*
* - 1: ORC (Common Order)
* - 2: RGV_O15_TIMING (a Group object) optional repeating
* - 3: RGV_O15_ORDER_DETAIL (a Group object) optional
* - 4: RGV_O15_ENCODING (a Group object) optional
* - 5: RGV_O15_GIVE (a Group object) repeating
*
*/
public class RGV_O15_ORDER extends AbstractGroup {
/**
* Creates a new RGV_O15_ORDER group
*/
public RGV_O15_ORDER(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(ORC.class, true, false);
this.add(RGV_O15_TIMING.class, false, true);
this.add(RGV_O15_ORDER_DETAIL.class, false, false);
this.add(RGV_O15_ENCODING.class, false, false);
this.add(RGV_O15_GIVE.class, true, true);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating RGV_O15_ORDER - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns "2.5"
*/
public String getVersion() {
return "2.5";
}
/**
* Returns
* ORC (Common Order) - creates it if necessary
*/
public ORC getORC() {
ORC ret = null;
try {
ret = (ORC)this.get("ORC");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns
* the first repetition of
* TIMING (a Group object) - creates it if necessary
*/
public RGV_O15_TIMING getTIMING() {
RGV_O15_TIMING ret = null;
try {
ret = (RGV_O15_TIMING)this.get("TIMING");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns a specific repetition of
* TIMING (a Group object) - creates it if necessary
*
* @param 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.
*/
public RGV_O15_TIMING getTIMING(int rep) {
RGV_O15_TIMING ret = null;
try {
ret = (RGV_O15_TIMING)this.get("TIMING", rep);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns the number of existing repetitions of TIMING
*/
public int getTIMINGReps() {
int reps = -1;
try {
reps = this.getAll("TIMING").length;
} catch (HL7Exception e) {
String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
throw new RuntimeException(message);
}
return reps;
}
/**
* Inserts a specific repetition of TIMING (a Group object)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public void insertTIMING(RGV_O15_TIMING structure, int rep) throws HL7Exception {
super.insertRepetition("TIMING", structure, rep);
}
/**
* Inserts a specific repetition of TIMING (a Group object)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public RGV_O15_TIMING insertTIMING(int rep) throws HL7Exception {
return (RGV_O15_TIMING)super.insertRepetition("TIMING", rep);
}
/**
* Removes a specific repetition of TIMING (a Group object)
* @see AbstractGroup#removeRepetition(String, int)
*/
public RGV_O15_TIMING removeTIMING(int rep) throws HL7Exception {
return (RGV_O15_TIMING)super.removeRepetition("TIMING", rep);
}
/**
* Returns
* ORDER_DETAIL (a Group object) - creates it if necessary
*/
public RGV_O15_ORDER_DETAIL getORDER_DETAIL() {
RGV_O15_ORDER_DETAIL ret = null;
try {
ret = (RGV_O15_ORDER_DETAIL)this.get("ORDER_DETAIL");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns
* ENCODING (a Group object) - creates it if necessary
*/
public RGV_O15_ENCODING getENCODING() {
RGV_O15_ENCODING ret = null;
try {
ret = (RGV_O15_ENCODING)this.get("ENCODING");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns
* the first repetition of
* GIVE (a Group object) - creates it if necessary
*/
public RGV_O15_GIVE getGIVE() {
RGV_O15_GIVE ret = null;
try {
ret = (RGV_O15_GIVE)this.get("GIVE");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns a specific repetition of
* GIVE (a Group object) - creates it if necessary
*
* @param 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.
*/
public RGV_O15_GIVE getGIVE(int rep) {
RGV_O15_GIVE ret = null;
try {
ret = (RGV_O15_GIVE)this.get("GIVE", rep);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new RuntimeException(e);
}
return ret;
}
/**
* Returns the number of existing repetitions of GIVE
*/
public int getGIVEReps() {
int reps = -1;
try {
reps = this.getAll("GIVE").length;
} catch (HL7Exception e) {
String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
throw new RuntimeException(message);
}
return reps;
}
/**
* Inserts a specific repetition of GIVE (a Group object)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public void insertGIVE(RGV_O15_GIVE structure, int rep) throws HL7Exception {
super.insertRepetition("GIVE", structure, rep);
}
/**
* Inserts a specific repetition of GIVE (a Group object)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public RGV_O15_GIVE insertGIVE(int rep) throws HL7Exception {
return (RGV_O15_GIVE)super.insertRepetition("GIVE", rep);
}
/**
* Removes a specific repetition of GIVE (a Group object)
* @see AbstractGroup#removeRepetition(String, int)
*/
public RGV_O15_GIVE removeGIVE(int rep) throws HL7Exception {
return (RGV_O15_GIVE)super.removeRepetition("GIVE", rep);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy