ca.uhn.hl7v2.model.v23.segment.QRD 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.v23.segment;
// import ca.uhn.hl7v2.model.v23.group.*;
import ca.uhn.hl7v2.model.v23.datatype.*;
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.Type;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Varies;
/**
*Represents an HL7 QRD message segment (Query definition segment).
* This segment has the following fields:
*
* - QRD-1: Query Date/Time (TS) optional
*
- QRD-2: Query Format Code (ID)
*
- QRD-3: Query Priority (ID)
*
- QRD-4: Query ID (ST)
*
- QRD-5: Deferred Response Type (ID) optional
*
- QRD-6: Deferred Response Date/Time (TS) optional
*
- QRD-7: Quantity Limited Request (CQ)
*
- QRD-8: Who Subject Filter (XCN) repeating
*
- QRD-9: What Subject Filter (CE) repeating
*
- QRD-10: What Department Data Code (CE) repeating
*
- QRD-11: What Data Code Value Qualifier (CM_VR) optional repeating
*
- QRD-12: Query Results Level (ID) optional
*
*/
public class QRD extends AbstractSegment {
/**
* Creates a new QRD segment
*/
public QRD(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Query Date/Time");
this.add(ID.class, true, 1, 1, new Object[]{ getMessage() }, "Query Format Code");
this.add(ID.class, true, 1, 1, new Object[]{ getMessage() }, "Query Priority");
this.add(ST.class, true, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "Query ID");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Deferred Response Type");
this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Deferred Response Date/Time");
this.add(CQ.class, true, 1, 10, new Object[]{ getMessage(), new Integer(126) }, "Quantity Limited Request");
this.add(XCN.class, true, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Who Subject Filter");
this.add(CE.class, true, 0, 60, new Object[]{ getMessage(), new Integer(48) }, "What Subject Filter");
this.add(CE.class, true, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "What Department Data Code");
this.add(CM_VR.class, false, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "What Data Code Value Qualifier");
this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Query Results Level");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating QRD - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* QRD-1: "Query Date/Time" - creates it if necessary
*/
public TS getQueryDateTime() {
TS ret = null;
try {
Type t = this.getField(1, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-1: "Query Date/Time" - creates it if necessary
*/
public TS getQrd1_QueryDateTime() {
TS ret = null;
try {
Type t = this.getField(1, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-2: "Query Format Code" - creates it if necessary
*/
public ID getQueryFormatCode() {
ID ret = null;
try {
Type t = this.getField(2, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-2: "Query Format Code" - creates it if necessary
*/
public ID getQrd2_QueryFormatCode() {
ID ret = null;
try {
Type t = this.getField(2, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-3: "Query Priority" - creates it if necessary
*/
public ID getQueryPriority() {
ID ret = null;
try {
Type t = this.getField(3, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-3: "Query Priority" - creates it if necessary
*/
public ID getQrd3_QueryPriority() {
ID ret = null;
try {
Type t = this.getField(3, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-4: "Query ID" - creates it if necessary
*/
public ST getQueryID() {
ST ret = null;
try {
Type t = this.getField(4, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-4: "Query ID" - creates it if necessary
*/
public ST getQrd4_QueryID() {
ST ret = null;
try {
Type t = this.getField(4, 0);
ret = (ST)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-5: "Deferred Response Type" - creates it if necessary
*/
public ID getDeferredResponseType() {
ID ret = null;
try {
Type t = this.getField(5, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-5: "Deferred Response Type" - creates it if necessary
*/
public ID getQrd5_DeferredResponseType() {
ID ret = null;
try {
Type t = this.getField(5, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-6: "Deferred Response Date/Time" - creates it if necessary
*/
public TS getDeferredResponseDateTime() {
TS ret = null;
try {
Type t = this.getField(6, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-6: "Deferred Response Date/Time" - creates it if necessary
*/
public TS getQrd6_DeferredResponseDateTime() {
TS ret = null;
try {
Type t = this.getField(6, 0);
ret = (TS)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-7: "Quantity Limited Request" - creates it if necessary
*/
public CQ getQuantityLimitedRequest() {
CQ ret = null;
try {
Type t = this.getField(7, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-7: "Quantity Limited Request" - creates it if necessary
*/
public CQ getQrd7_QuantityLimitedRequest() {
CQ ret = null;
try {
Type t = this.getField(7, 0);
ret = (CQ)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns all repetitions of Who Subject Filter (QRD-8).
*/
public XCN[] getWhoSubjectFilter() {
XCN[] ret = null;
try {
Type[] t = this.getField(8);
ret = new XCN[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (XCN)t[i];
}
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of Who Subject Filter (QRD-8).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getWhoSubjectFilterReps() {
XCN[] ret = null;
try {
Type[] t = this.getField(8);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* QRD-8: "Who Subject Filter" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XCN getWhoSubjectFilter(int rep) {
XCN ret = null;
try {
Type t = this.getField(8, rep);
ret = (XCN)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* QRD-8: "Who Subject Filter" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public XCN getQrd8_WhoSubjectFilter(int rep) {
XCN ret = null;
try {
Type t = this.getField(8, rep);
ret = (XCN)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of Who Subject Filter (QRD-8).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getQrd8_WhoSubjectFilterReps() {
XCN[] ret = null;
try {
Type[] t = this.getField(8);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* QRD-8: "Who Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public XCN insertWhoSubjectFilter(int rep) throws HL7Exception {
return (XCN) super.insertRepetition(8, rep);
}
/**
* Inserts a repetition of
* QRD-8: "Who Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public XCN insertQrd8_WhoSubjectFilter(int rep) throws HL7Exception {
return (XCN) super.insertRepetition(8, rep);
}
/**
* Removes a repetition of
* QRD-8: "Who Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public XCN removeWhoSubjectFilter(int rep) throws HL7Exception {
return (XCN) super.removeRepetition(8, rep);
}
/**
* Removes a repetition of
* QRD-8: "Who Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public XCN removeQrd8_WhoSubjectFilter(int rep) throws HL7Exception {
return (XCN) super.removeRepetition(8, rep);
}
/**
* Returns all repetitions of What Subject Filter (QRD-9).
*/
public CE[] getWhatSubjectFilter() {
CE[] ret = null;
try {
Type[] t = this.getField(9);
ret = new CE[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CE)t[i];
}
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Subject Filter (QRD-9).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getWhatSubjectFilterReps() {
CE[] ret = null;
try {
Type[] t = this.getField(9);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* QRD-9: "What Subject Filter" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getWhatSubjectFilter(int rep) {
CE ret = null;
try {
Type t = this.getField(9, rep);
ret = (CE)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* QRD-9: "What Subject Filter" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getQrd9_WhatSubjectFilter(int rep) {
CE ret = null;
try {
Type t = this.getField(9, rep);
ret = (CE)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Subject Filter (QRD-9).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getQrd9_WhatSubjectFilterReps() {
CE[] ret = null;
try {
Type[] t = this.getField(9);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* QRD-9: "What Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE insertWhatSubjectFilter(int rep) throws HL7Exception {
return (CE) super.insertRepetition(9, rep);
}
/**
* Inserts a repetition of
* QRD-9: "What Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE insertQrd9_WhatSubjectFilter(int rep) throws HL7Exception {
return (CE) super.insertRepetition(9, rep);
}
/**
* Removes a repetition of
* QRD-9: "What Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE removeWhatSubjectFilter(int rep) throws HL7Exception {
return (CE) super.removeRepetition(9, rep);
}
/**
* Removes a repetition of
* QRD-9: "What Subject Filter" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE removeQrd9_WhatSubjectFilter(int rep) throws HL7Exception {
return (CE) super.removeRepetition(9, rep);
}
/**
* Returns all repetitions of What Department Data Code (QRD-10).
*/
public CE[] getWhatDepartmentDataCode() {
CE[] ret = null;
try {
Type[] t = this.getField(10);
ret = new CE[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CE)t[i];
}
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Department Data Code (QRD-10).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getWhatDepartmentDataCodeReps() {
CE[] ret = null;
try {
Type[] t = this.getField(10);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* QRD-10: "What Department Data Code" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getWhatDepartmentDataCode(int rep) {
CE ret = null;
try {
Type t = this.getField(10, rep);
ret = (CE)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* QRD-10: "What Department Data Code" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CE getQrd10_WhatDepartmentDataCode(int rep) {
CE ret = null;
try {
Type t = this.getField(10, rep);
ret = (CE)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Department Data Code (QRD-10).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getQrd10_WhatDepartmentDataCodeReps() {
CE[] ret = null;
try {
Type[] t = this.getField(10);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* QRD-10: "What Department Data Code" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE insertWhatDepartmentDataCode(int rep) throws HL7Exception {
return (CE) super.insertRepetition(10, rep);
}
/**
* Inserts a repetition of
* QRD-10: "What Department Data Code" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE insertQrd10_WhatDepartmentDataCode(int rep) throws HL7Exception {
return (CE) super.insertRepetition(10, rep);
}
/**
* Removes a repetition of
* QRD-10: "What Department Data Code" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE removeWhatDepartmentDataCode(int rep) throws HL7Exception {
return (CE) super.removeRepetition(10, rep);
}
/**
* Removes a repetition of
* QRD-10: "What Department Data Code" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CE removeQrd10_WhatDepartmentDataCode(int rep) throws HL7Exception {
return (CE) super.removeRepetition(10, rep);
}
/**
* Returns all repetitions of What Data Code Value Qualifier (QRD-11).
*/
public CM_VR[] getWhatDataCodeValueQualifier() {
CM_VR[] ret = null;
try {
Type[] t = this.getField(11);
ret = new CM_VR[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (CM_VR)t[i];
}
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Data Code Value Qualifier (QRD-11).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getWhatDataCodeValueQualifierReps() {
CM_VR[] ret = null;
try {
Type[] t = this.getField(11);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Returns a specific repetition of
* QRD-11: "What Data Code Value Qualifier" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_VR getWhatDataCodeValueQualifier(int rep) {
CM_VR ret = null;
try {
Type t = this.getField(11, rep);
ret = (CM_VR)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a specific repetition of
* QRD-11: "What Data Code Value Qualifier" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public CM_VR getQrd11_WhatDataCodeValueQualifier(int rep) {
CM_VR ret = null;
try {
Type t = this.getField(11, rep);
ret = (CM_VR)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns a count of the current number of repetitions of What Data Code Value Qualifier (QRD-11).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getQrd11_WhatDataCodeValueQualifierReps() {
CM_VR[] ret = null;
try {
Type[] t = this.getField(11);
return t.length;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
}
/**
* Inserts a repetition of
* QRD-11: "What Data Code Value Qualifier" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CM_VR insertWhatDataCodeValueQualifier(int rep) throws HL7Exception {
return (CM_VR) super.insertRepetition(11, rep);
}
/**
* Inserts a repetition of
* QRD-11: "What Data Code Value Qualifier" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CM_VR insertQrd11_WhatDataCodeValueQualifier(int rep) throws HL7Exception {
return (CM_VR) super.insertRepetition(11, rep);
}
/**
* Removes a repetition of
* QRD-11: "What Data Code Value Qualifier" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CM_VR removeWhatDataCodeValueQualifier(int rep) throws HL7Exception {
return (CM_VR) super.removeRepetition(11, rep);
}
/**
* Removes a repetition of
* QRD-11: "What Data Code Value Qualifier" at a specific index
*
* @param rep The repetition index (0-indexed)
* @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
*/
public CM_VR removeQrd11_WhatDataCodeValueQualifier(int rep) throws HL7Exception {
return (CM_VR) super.removeRepetition(11, rep);
}
/**
* Returns
* QRD-12: "Query Results Level" - creates it if necessary
*/
public ID getQueryResultsLevel() {
ID ret = null;
try {
Type t = this.getField(12, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/**
* Returns
* QRD-12: "Query Results Level" - creates it if necessary
*/
public ID getQrd12_QueryResultsLevel() {
ID ret = null;
try {
Type t = this.getField(12, 0);
ret = (ID)t;
} catch (ClassCastException cce) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new RuntimeException(cce);
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new RuntimeException(he);
}
return ret;
}
/** {@inheritDoc} */
protected Type createNewTypeWithoutReflection(int field) {
switch (field) {
case 0: return new TS(getMessage());
case 1: return new ID(getMessage(), new Integer( 106 ));
case 2: return new ID(getMessage(), new Integer( 91 ));
case 3: return new ST(getMessage());
case 4: return new ID(getMessage(), new Integer( 107 ));
case 5: return new TS(getMessage());
case 6: return new CQ(getMessage());
case 7: return new XCN(getMessage());
case 8: return new CE(getMessage());
case 9: return new CE(getMessage());
case 10: return new CM_VR(getMessage());
case 11: return new ID(getMessage(), new Integer( 108 ));
default: return null;
}
}
}