ca.uhn.hl7v2.model.v26.segment.MSH 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.v26.segment;
// import ca.uhn.hl7v2.model.v26.group.*;
import ca.uhn.hl7v2.model.v26.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 MSH message segment (Message Header).
* This segment has the following fields:
*
* - MSH-1: Field Separator (ST)
*
- MSH-2: Encoding Characters (ST)
*
- MSH-3: Sending Application (HD) optional
*
- MSH-4: Sending Facility (HD) optional
*
- MSH-5: Receiving Application (HD) optional
*
- MSH-6: Receiving Facility (HD) optional
*
- MSH-7: Date/Time of Message (DTM)
*
- MSH-8: Security (ST) optional
*
- MSH-9: Message Type (MSG)
*
- MSH-10: Message Control ID (ST)
*
- MSH-11: Processing ID (PT)
*
- MSH-12: Version ID (VID)
*
- MSH-13: Sequence Number (NM) optional
*
- MSH-14: Continuation Pointer (ST) optional
*
- MSH-15: Accept Acknowledgment Type (ID) optional
*
- MSH-16: Application Acknowledgment Type (ID) optional
*
- MSH-17: Country Code (ID) optional
*
- MSH-18: Character Set (ID) optional repeating
*
- MSH-19: Principal Language Of Message (CWE) optional
*
- MSH-20: Alternate Character Set Handling Scheme (ID) optional
*
- MSH-21: Message Profile Identifier (EI) optional repeating
*
- MSH-22: Sending Responsible Organization (XON) optional
*
- MSH-23: Receiving Responsible Organization (XON) optional
*
- MSH-24: Sending Network Address (HD) optional
*
- MSH-25: Receiving Network Address (HD) optional
*
*/
public class MSH extends AbstractSegment {
/**
* Creates a new MSH segment
*/
public MSH(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(ST.class, true, 1, 1, new Object[]{ getMessage(), new Integer(0) }, "Field Separator");
this.add(ST.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Encoding Characters");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(361) }, "Sending Application");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(362) }, "Sending Facility");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(361) }, "Receiving Application");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(362) }, "Receiving Facility");
this.add(DTM.class, true, 1, 24, new Object[]{ getMessage(), new Integer(0) }, "Date/Time of Message");
this.add(ST.class, false, 1, 40, new Object[]{ getMessage(), new Integer(0) }, "Security");
this.add(MSG.class, true, 1, 15, new Object[]{ getMessage(), new Integer(0) }, "Message Type");
this.add(ST.class, true, 1, 199, new Object[]{ getMessage(), new Integer(0) }, "Message Control ID");
this.add(PT.class, true, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Processing ID");
this.add(VID.class, true, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Version ID");
this.add(NM.class, false, 1, 15, new Object[]{ getMessage(), new Integer(0) }, "Sequence Number");
this.add(ST.class, false, 1, 180, new Object[]{ getMessage(), new Integer(0) }, "Continuation Pointer");
this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Accept Acknowledgment Type");
this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Application Acknowledgment Type");
this.add(ID.class, false, 1, 3, new Object[]{ getMessage() }, "Country Code");
this.add(ID.class, false, 0, 16, new Object[]{ getMessage() }, "Character Set");
this.add(CWE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Principal Language Of Message");
this.add(ID.class, false, 1, 20, new Object[]{ getMessage() }, "Alternate Character Set Handling Scheme");
this.add(EI.class, false, 0, 427, new Object[]{ getMessage(), new Integer(0) }, "Message Profile Identifier");
this.add(XON.class, false, 1, 567, new Object[]{ getMessage(), new Integer(0) }, "Sending Responsible Organization");
this.add(XON.class, false, 1, 567, new Object[]{ getMessage(), new Integer(0) }, "Receiving Responsible Organization");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(0) }, "Sending Network Address");
this.add(HD.class, false, 1, 227, new Object[]{ getMessage(), new Integer(0) }, "Receiving Network Address");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating MSH - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns
* MSH-1: "Field Separator" - creates it if necessary
*/
public ST getFieldSeparator() {
ST ret = null;
try {
Type t = this.getField(1, 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
* MSH-1: "Field Separator" - creates it if necessary
*/
public ST getMsh1_FieldSeparator() {
ST ret = null;
try {
Type t = this.getField(1, 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
* MSH-2: "Encoding Characters" - creates it if necessary
*/
public ST getEncodingCharacters() {
ST ret = null;
try {
Type t = this.getField(2, 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
* MSH-2: "Encoding Characters" - creates it if necessary
*/
public ST getMsh2_EncodingCharacters() {
ST ret = null;
try {
Type t = this.getField(2, 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
* MSH-3: "Sending Application" - creates it if necessary
*/
public HD getSendingApplication() {
HD ret = null;
try {
Type t = this.getField(3, 0);
ret = (HD)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
* MSH-3: "Sending Application" - creates it if necessary
*/
public HD getMsh3_SendingApplication() {
HD ret = null;
try {
Type t = this.getField(3, 0);
ret = (HD)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
* MSH-4: "Sending Facility" - creates it if necessary
*/
public HD getSendingFacility() {
HD ret = null;
try {
Type t = this.getField(4, 0);
ret = (HD)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
* MSH-4: "Sending Facility" - creates it if necessary
*/
public HD getMsh4_SendingFacility() {
HD ret = null;
try {
Type t = this.getField(4, 0);
ret = (HD)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
* MSH-5: "Receiving Application" - creates it if necessary
*/
public HD getReceivingApplication() {
HD ret = null;
try {
Type t = this.getField(5, 0);
ret = (HD)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
* MSH-5: "Receiving Application" - creates it if necessary
*/
public HD getMsh5_ReceivingApplication() {
HD ret = null;
try {
Type t = this.getField(5, 0);
ret = (HD)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
* MSH-6: "Receiving Facility" - creates it if necessary
*/
public HD getReceivingFacility() {
HD ret = null;
try {
Type t = this.getField(6, 0);
ret = (HD)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
* MSH-6: "Receiving Facility" - creates it if necessary
*/
public HD getMsh6_ReceivingFacility() {
HD ret = null;
try {
Type t = this.getField(6, 0);
ret = (HD)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
* MSH-7: "Date/Time of Message" - creates it if necessary
*/
public DTM getDateTimeOfMessage() {
DTM ret = null;
try {
Type t = this.getField(7, 0);
ret = (DTM)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
* MSH-7: "Date/Time of Message" - creates it if necessary
*/
public DTM getMsh7_DateTimeOfMessage() {
DTM ret = null;
try {
Type t = this.getField(7, 0);
ret = (DTM)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
* MSH-8: "Security" - creates it if necessary
*/
public ST getSecurity() {
ST ret = null;
try {
Type t = this.getField(8, 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
* MSH-8: "Security" - creates it if necessary
*/
public ST getMsh8_Security() {
ST ret = null;
try {
Type t = this.getField(8, 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
* MSH-9: "Message Type" - creates it if necessary
*/
public MSG getMessageType() {
MSG ret = null;
try {
Type t = this.getField(9, 0);
ret = (MSG)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
* MSH-9: "Message Type" - creates it if necessary
*/
public MSG getMsh9_MessageType() {
MSG ret = null;
try {
Type t = this.getField(9, 0);
ret = (MSG)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
* MSH-10: "Message Control ID" - creates it if necessary
*/
public ST getMessageControlID() {
ST ret = null;
try {
Type t = this.getField(10, 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
* MSH-10: "Message Control ID" - creates it if necessary
*/
public ST getMsh10_MessageControlID() {
ST ret = null;
try {
Type t = this.getField(10, 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
* MSH-11: "Processing ID" - creates it if necessary
*/
public PT getProcessingID() {
PT ret = null;
try {
Type t = this.getField(11, 0);
ret = (PT)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
* MSH-11: "Processing ID" - creates it if necessary
*/
public PT getMsh11_ProcessingID() {
PT ret = null;
try {
Type t = this.getField(11, 0);
ret = (PT)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
* MSH-12: "Version ID" - creates it if necessary
*/
public VID getVersionID() {
VID ret = null;
try {
Type t = this.getField(12, 0);
ret = (VID)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
* MSH-12: "Version ID" - creates it if necessary
*/
public VID getMsh12_VersionID() {
VID ret = null;
try {
Type t = this.getField(12, 0);
ret = (VID)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
* MSH-13: "Sequence Number" - creates it if necessary
*/
public NM getSequenceNumber() {
NM ret = null;
try {
Type t = this.getField(13, 0);
ret = (NM)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
* MSH-13: "Sequence Number" - creates it if necessary
*/
public NM getMsh13_SequenceNumber() {
NM ret = null;
try {
Type t = this.getField(13, 0);
ret = (NM)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
* MSH-14: "Continuation Pointer" - creates it if necessary
*/
public ST getContinuationPointer() {
ST ret = null;
try {
Type t = this.getField(14, 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
* MSH-14: "Continuation Pointer" - creates it if necessary
*/
public ST getMsh14_ContinuationPointer() {
ST ret = null;
try {
Type t = this.getField(14, 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
* MSH-15: "Accept Acknowledgment Type" - creates it if necessary
*/
public ID getAcceptAcknowledgmentType() {
ID ret = null;
try {
Type t = this.getField(15, 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
* MSH-15: "Accept Acknowledgment Type" - creates it if necessary
*/
public ID getMsh15_AcceptAcknowledgmentType() {
ID ret = null;
try {
Type t = this.getField(15, 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
* MSH-16: "Application Acknowledgment Type" - creates it if necessary
*/
public ID getApplicationAcknowledgmentType() {
ID ret = null;
try {
Type t = this.getField(16, 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
* MSH-16: "Application Acknowledgment Type" - creates it if necessary
*/
public ID getMsh16_ApplicationAcknowledgmentType() {
ID ret = null;
try {
Type t = this.getField(16, 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
* MSH-17: "Country Code" - creates it if necessary
*/
public ID getCountryCode() {
ID ret = null;
try {
Type t = this.getField(17, 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
* MSH-17: "Country Code" - creates it if necessary
*/
public ID getMsh17_CountryCode() {
ID ret = null;
try {
Type t = this.getField(17, 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 all repetitions of Character Set (MSH-18).
*/
public ID[] getCharacterSet() {
ID[] ret = null;
try {
Type[] t = this.getField(18);
ret = new ID[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (ID)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 Character Set (MSH-18).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getCharacterSetReps() {
ID[] ret = null;
try {
Type[] t = this.getField(18);
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
* MSH-18: "Character Set" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public ID getCharacterSet(int rep) {
ID ret = null;
try {
Type t = this.getField(18, rep);
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 a specific repetition of
* MSH-18: "Character Set" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public ID getMsh18_CharacterSet(int rep) {
ID ret = null;
try {
Type t = this.getField(18, rep);
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 a count of the current number of repetitions of Character Set (MSH-18).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getMsh18_CharacterSetReps() {
ID[] ret = null;
try {
Type[] t = this.getField(18);
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
* MSH-18: "Character Set" 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 ID insertCharacterSet(int rep) throws HL7Exception {
return (ID) super.insertRepetition(18, rep);
}
/**
* Inserts a repetition of
* MSH-18: "Character Set" 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 ID insertMsh18_CharacterSet(int rep) throws HL7Exception {
return (ID) super.insertRepetition(18, rep);
}
/**
* Removes a repetition of
* MSH-18: "Character Set" 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 ID removeCharacterSet(int rep) throws HL7Exception {
return (ID) super.removeRepetition(18, rep);
}
/**
* Removes a repetition of
* MSH-18: "Character Set" 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 ID removeMsh18_CharacterSet(int rep) throws HL7Exception {
return (ID) super.removeRepetition(18, rep);
}
/**
* Returns
* MSH-19: "Principal Language Of Message" - creates it if necessary
*/
public CWE getPrincipalLanguageOfMessage() {
CWE ret = null;
try {
Type t = this.getField(19, 0);
ret = (CWE)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
* MSH-19: "Principal Language Of Message" - creates it if necessary
*/
public CWE getMsh19_PrincipalLanguageOfMessage() {
CWE ret = null;
try {
Type t = this.getField(19, 0);
ret = (CWE)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
* MSH-20: "Alternate Character Set Handling Scheme" - creates it if necessary
*/
public ID getAlternateCharacterSetHandlingScheme() {
ID ret = null;
try {
Type t = this.getField(20, 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
* MSH-20: "Alternate Character Set Handling Scheme" - creates it if necessary
*/
public ID getMsh20_AlternateCharacterSetHandlingScheme() {
ID ret = null;
try {
Type t = this.getField(20, 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 all repetitions of Message Profile Identifier (MSH-21).
*/
public EI[] getMessageProfileIdentifier() {
EI[] ret = null;
try {
Type[] t = this.getField(21);
ret = new EI[t.length];
for (int i = 0; i < ret.length; i++) {
ret[i] = (EI)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 Message Profile Identifier (MSH-21).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getMessageProfileIdentifierReps() {
EI[] ret = null;
try {
Type[] t = this.getField(21);
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
* MSH-21: "Message Profile Identifier" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public EI getMessageProfileIdentifier(int rep) {
EI ret = null;
try {
Type t = this.getField(21, rep);
ret = (EI)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
* MSH-21: "Message Profile Identifier" - creates it if necessary
*
* @param rep The repetition index (0-indexed)
*/
public EI getMsh21_MessageProfileIdentifier(int rep) {
EI ret = null;
try {
Type t = this.getField(21, rep);
ret = (EI)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 Message Profile Identifier (MSH-21).
* This method does not create a repetition, so if no repetitions have currently been defined or accessed,
* it will return zero.
*/
public int getMsh21_MessageProfileIdentifierReps() {
EI[] ret = null;
try {
Type[] t = this.getField(21);
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
* MSH-21: "Message Profile Identifier" 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 EI insertMessageProfileIdentifier(int rep) throws HL7Exception {
return (EI) super.insertRepetition(21, rep);
}
/**
* Inserts a repetition of
* MSH-21: "Message Profile Identifier" 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 EI insertMsh21_MessageProfileIdentifier(int rep) throws HL7Exception {
return (EI) super.insertRepetition(21, rep);
}
/**
* Removes a repetition of
* MSH-21: "Message Profile Identifier" 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 EI removeMessageProfileIdentifier(int rep) throws HL7Exception {
return (EI) super.removeRepetition(21, rep);
}
/**
* Removes a repetition of
* MSH-21: "Message Profile Identifier" 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 EI removeMsh21_MessageProfileIdentifier(int rep) throws HL7Exception {
return (EI) super.removeRepetition(21, rep);
}
/**
* Returns
* MSH-22: "Sending Responsible Organization" - creates it if necessary
*/
public XON getSendingResponsibleOrganization() {
XON ret = null;
try {
Type t = this.getField(22, 0);
ret = (XON)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
* MSH-22: "Sending Responsible Organization" - creates it if necessary
*/
public XON getMsh22_SendingResponsibleOrganization() {
XON ret = null;
try {
Type t = this.getField(22, 0);
ret = (XON)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
* MSH-23: "Receiving Responsible Organization" - creates it if necessary
*/
public XON getReceivingResponsibleOrganization() {
XON ret = null;
try {
Type t = this.getField(23, 0);
ret = (XON)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
* MSH-23: "Receiving Responsible Organization" - creates it if necessary
*/
public XON getMsh23_ReceivingResponsibleOrganization() {
XON ret = null;
try {
Type t = this.getField(23, 0);
ret = (XON)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
* MSH-24: "Sending Network Address" - creates it if necessary
*/
public HD getSendingNetworkAddress() {
HD ret = null;
try {
Type t = this.getField(24, 0);
ret = (HD)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
* MSH-24: "Sending Network Address" - creates it if necessary
*/
public HD getMsh24_SendingNetworkAddress() {
HD ret = null;
try {
Type t = this.getField(24, 0);
ret = (HD)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
* MSH-25: "Receiving Network Address" - creates it if necessary
*/
public HD getReceivingNetworkAddress() {
HD ret = null;
try {
Type t = this.getField(25, 0);
ret = (HD)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
* MSH-25: "Receiving Network Address" - creates it if necessary
*/
public HD getMsh25_ReceivingNetworkAddress() {
HD ret = null;
try {
Type t = this.getField(25, 0);
ret = (HD)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 ST(getMessage());
case 1: return new ST(getMessage());
case 2: return new HD(getMessage());
case 3: return new HD(getMessage());
case 4: return new HD(getMessage());
case 5: return new HD(getMessage());
case 6: return new DTM(getMessage());
case 7: return new ST(getMessage());
case 8: return new MSG(getMessage());
case 9: return new ST(getMessage());
case 10: return new PT(getMessage());
case 11: return new VID(getMessage());
case 12: return new NM(getMessage());
case 13: return new ST(getMessage());
case 14: return new ID(getMessage(), new Integer( 155 ));
case 15: return new ID(getMessage(), new Integer( 155 ));
case 16: return new ID(getMessage(), new Integer( 399 ));
case 17: return new ID(getMessage(), new Integer( 211 ));
case 18: return new CWE(getMessage());
case 19: return new ID(getMessage(), new Integer( 356 ));
case 20: return new EI(getMessage());
case 21: return new XON(getMessage());
case 22: return new XON(getMessage());
case 23: return new HD(getMessage());
case 24: return new HD(getMessage());
default: return null;
}
}
}