ca.uhn.hl7v2.model.v25.message.ORU_R30 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.message;
import 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;
/**
* Represents a ORU_R30 message structure (see chapter 7.3.4). This structure contains the
* following elements:
*
* - 1: MSH (Message Header)
* - 2: SFT (Software Segment) optional repeating
* - 3: PID (Patient Identification)
* - 4: PD1 (Patient Additional Demographic) optional
* - 5: ORU_R30_VISIT (a Group object) optional
* - 6: ORC (Common Order)
* - 7: OBR (Observation Request)
* - 8: NTE (Notes and Comments) optional repeating
* - 9: ORU_R30_TIMING_QTY (a Group object) optional repeating
* - 10: ORU_R30_OBSERVATION (a Group object) repeating
*
*/
public class ORU_R30 extends AbstractMessage {
/**
* Creates a new ORU_R30 message with custom ModelClassFactory.
*/
public ORU_R30(ModelClassFactory factory) {
super(factory);
init(factory);
}
/**
* Creates a new ORU_R30 message with DefaultModelClassFactory.
*/
public ORU_R30() {
super(new DefaultModelClassFactory());
init(new DefaultModelClassFactory());
}
private void init(ModelClassFactory factory) {
try {
this.add(MSH.class, true, false);
this.add(SFT.class, false, true);
this.add(PID.class, true, false);
this.add(PD1.class, false, false);
this.add(ORU_R30_VISIT.class, false, false);
this.add(ORC.class, true, false);
this.add(OBR.class, true, false);
this.add(NTE.class, false, true);
this.add(ORU_R30_TIMING_QTY.class, false, true);
this.add(ORU_R30_OBSERVATION.class, true, true);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ORU_R30 - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns "2.5"
*/
public String getVersion() {
return "2.5";
}
/**
* Returns
* MSH (Message Header) - creates it if necessary
*/
public MSH getMSH() {
MSH ret = null;
try {
ret = (MSH)this.get("MSH");
} 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
* SFT (Software Segment) - creates it if necessary
*/
public SFT getSFT() {
SFT ret = null;
try {
ret = (SFT)this.get("SFT");
} 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
* SFT (Software Segment) - 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 SFT getSFT(int rep) {
SFT ret = null;
try {
ret = (SFT)this.get("SFT", 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 SFT
*/
public int getSFTReps() {
int reps = -1;
try {
reps = this.getAll("SFT").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 SFT (Software Segment)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public void insertSFT(SFT structure, int rep) throws HL7Exception {
super.insertRepetition( "SFT", structure, rep);
}
/**
* Inserts a specific repetition of SFT (Software Segment)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public SFT insertSFT(int rep) throws HL7Exception {
return (SFT)super.insertRepetition("SFT", rep);
}
/**
* Removes a specific repetition of SFT (Software Segment)
* @see AbstractGroup\#removeRepetition(String, int)
*/
public SFT removeSFT(int rep) throws HL7Exception {
return (SFT)super.removeRepetition("SFT", rep);
}
/**
* Returns
* PID (Patient Identification) - creates it if necessary
*/
public PID getPID() {
PID ret = null;
try {
ret = (PID)this.get("PID");
} 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
* PD1 (Patient Additional Demographic) - creates it if necessary
*/
public PD1 getPD1() {
PD1 ret = null;
try {
ret = (PD1)this.get("PD1");
} 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
* VISIT (a Group object) - creates it if necessary
*/
public ORU_R30_VISIT getVISIT() {
ORU_R30_VISIT ret = null;
try {
ret = (ORU_R30_VISIT)this.get("VISIT");
} 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
* 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
* OBR (Observation Request) - creates it if necessary
*/
public OBR getOBR() {
OBR ret = null;
try {
ret = (OBR)this.get("OBR");
} 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
* NTE (Notes and Comments) - creates it if necessary
*/
public NTE getNTE() {
NTE ret = null;
try {
ret = (NTE)this.get("NTE");
} 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
* NTE (Notes and Comments) - 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 NTE getNTE(int rep) {
NTE ret = null;
try {
ret = (NTE)this.get("NTE", 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 NTE
*/
public int getNTEReps() {
int reps = -1;
try {
reps = this.getAll("NTE").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 NTE (Notes and Comments)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public void insertNTE(NTE structure, int rep) throws HL7Exception {
super.insertRepetition( "NTE", structure, rep);
}
/**
* Inserts a specific repetition of NTE (Notes and Comments)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public NTE insertNTE(int rep) throws HL7Exception {
return (NTE)super.insertRepetition("NTE", rep);
}
/**
* Removes a specific repetition of NTE (Notes and Comments)
* @see AbstractGroup\#removeRepetition(String, int)
*/
public NTE removeNTE(int rep) throws HL7Exception {
return (NTE)super.removeRepetition("NTE", rep);
}
/**
* Returns
* the first repetition of
* TIMING_QTY (a Group object) - creates it if necessary
*/
public ORU_R30_TIMING_QTY getTIMING_QTY() {
ORU_R30_TIMING_QTY ret = null;
try {
ret = (ORU_R30_TIMING_QTY)this.get("TIMING_QTY");
} 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_QTY (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 ORU_R30_TIMING_QTY getTIMING_QTY(int rep) {
ORU_R30_TIMING_QTY ret = null;
try {
ret = (ORU_R30_TIMING_QTY)this.get("TIMING_QTY", 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_QTY
*/
public int getTIMING_QTYReps() {
int reps = -1;
try {
reps = this.getAll("TIMING_QTY").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_QTY (a Group object)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public void insertTIMING_QTY(ORU_R30_TIMING_QTY structure, int rep) throws HL7Exception {
super.insertRepetition( "TIMING_QTY", structure, rep);
}
/**
* Inserts a specific repetition of TIMING_QTY (a Group object)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public ORU_R30_TIMING_QTY insertTIMING_QTY(int rep) throws HL7Exception {
return (ORU_R30_TIMING_QTY)super.insertRepetition("TIMING_QTY", rep);
}
/**
* Removes a specific repetition of TIMING_QTY (a Group object)
* @see AbstractGroup\#removeRepetition(String, int)
*/
public ORU_R30_TIMING_QTY removeTIMING_QTY(int rep) throws HL7Exception {
return (ORU_R30_TIMING_QTY)super.removeRepetition("TIMING_QTY", rep);
}
/**
* Returns
* the first repetition of
* OBSERVATION (a Group object) - creates it if necessary
*/
public ORU_R30_OBSERVATION getOBSERVATION() {
ORU_R30_OBSERVATION ret = null;
try {
ret = (ORU_R30_OBSERVATION)this.get("OBSERVATION");
} 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
* OBSERVATION (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 ORU_R30_OBSERVATION getOBSERVATION(int rep) {
ORU_R30_OBSERVATION ret = null;
try {
ret = (ORU_R30_OBSERVATION)this.get("OBSERVATION", 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 OBSERVATION
*/
public int getOBSERVATIONReps() {
int reps = -1;
try {
reps = this.getAll("OBSERVATION").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 OBSERVATION (a Group object)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public void insertOBSERVATION(ORU_R30_OBSERVATION structure, int rep) throws HL7Exception {
super.insertRepetition( "OBSERVATION", structure, rep);
}
/**
* Inserts a specific repetition of OBSERVATION (a Group object)
* @see AbstractGroup\#insertRepetition(Structure, int)
*/
public ORU_R30_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception {
return (ORU_R30_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
}
/**
* Removes a specific repetition of OBSERVATION (a Group object)
* @see AbstractGroup\#removeRepetition(String, int)
*/
public ORU_R30_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception {
return (ORU_R30_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy