001 /*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 */
007
008 package ca.uhn.hl7v2.model.v24.message;
009
010 import ca.uhn.hl7v2.model.v24.group.*;
011 import ca.uhn.hl7v2.model.v24.segment.*;
012
013 import ca.uhn.log.HapiLogFactory;
014 import ca.uhn.hl7v2.HL7Exception;
015 import ca.uhn.hl7v2.parser.ModelClassFactory;
016 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
017 import ca.uhn.hl7v2.model.AbstractMessage;
018
019 /**
020 * <p>Represents a QRY_T12 message structure (see chapter ?). This structure contains the
021 * following elements: </p>
022 * <ul>
023 * <li>1: MSH (Message Header) <b> </b></li>
024 * <li>2: QRD (Original-Style Query Definition) <b> </b></li>
025 * <li>3: QRF (Original Style Query Filter) <b>optional </b></li>
026 * </ul>
027 */
028 public class QRY_T12 extends AbstractMessage {
029
030 /**
031 * Creates a new QRY_T12 message with DefaultModelClassFactory.
032 */
033 public QRY_T12() {
034 this(new DefaultModelClassFactory());
035 }
036
037 /**
038 * Creates a new QRY_T12 message with custom ModelClassFactory.
039 */
040 public QRY_T12(ModelClassFactory factory) {
041 super(factory);
042 init(factory);
043 }
044
045 private void init(ModelClassFactory factory) {
046 try {
047 this.add(MSH.class, true, false);
048 this.add(QRD.class, true, false);
049 this.add(QRF.class, false, false);
050 } catch(HL7Exception e) {
051 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating QRY_T12 - this is probably a bug in the source code generator.", e);
052 }
053 }
054
055 /**
056 * Returns "2.4"
057 */
058 public String getVersion() {
059 return "2.4";
060 }
061
062
063
064 /**
065 * Returns
066 * MSH (Message Header) - creates it if necessary
067 */
068 public MSH getMSH() {
069 MSH ret = null;
070 try {
071 ret = (MSH)this.get("MSH");
072 } catch(HL7Exception e) {
073 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
074 throw new RuntimeException(e);
075 }
076 return ret;
077 }
078
079
080
081
082 /**
083 * Returns
084 * QRD (Original-Style Query Definition) - creates it if necessary
085 */
086 public QRD getQRD() {
087 QRD ret = null;
088 try {
089 ret = (QRD)this.get("QRD");
090 } catch(HL7Exception e) {
091 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
092 throw new RuntimeException(e);
093 }
094 return ret;
095 }
096
097
098
099
100 /**
101 * Returns
102 * QRF (Original Style Query Filter) - creates it if necessary
103 */
104 public QRF getQRF() {
105 QRF ret = null;
106 try {
107 ret = (QRF)this.get("QRF");
108 } catch(HL7Exception e) {
109 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
110 throw new RuntimeException(e);
111 }
112 return ret;
113 }
114
115
116
117
118 }
119