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 QBP_K13 message structure (see chapter 5). This structure contains the 
021     * following elements: </p>
022     * <ul>
023                     * <li>1: MSH (Message Header) <b> </b></li>
024                     * <li>2: MSA (Message Acknowledgment) <b> </b></li>
025                     * <li>3: ERR (Error) <b>optional </b></li>
026                     * <li>4: QAK (Query Acknowledgment) <b> </b></li>
027                     * <li>5: QPD (Query Parameter Definition) <b> </b></li>
028                     * <li>6: QBP_K13_ROW_DEFINITION (a Group object) <b>optional </b></li>
029                     * <li>7: DSC (Continuation Pointer) <b>optional </b></li>
030     * </ul>
031     */
032    public class QBP_K13 extends AbstractMessage  {
033    
034        /**
035         * Creates a new QBP_K13 message with DefaultModelClassFactory. 
036         */ 
037        public QBP_K13() { 
038           this(new DefaultModelClassFactory());
039        }
040    
041        /** 
042         * Creates a new QBP_K13 message with custom ModelClassFactory.
043         */
044        public QBP_K13(ModelClassFactory factory) {
045           super(factory);
046           init(factory);
047        }
048    
049        private void init(ModelClassFactory factory) {
050           try {
051                              this.add(MSH.class, true, false);
052                              this.add(MSA.class, true, false);
053                              this.add(ERR.class, false, false);
054                              this.add(QAK.class, true, false);
055                              this.add(QPD.class, true, false);
056                              this.add(QBP_K13_ROW_DEFINITION.class, false, false);
057                              this.add(DSC.class, false, false);
058           } catch(HL7Exception e) {
059              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating QBP_K13 - this is probably a bug in the source code generator.", e);
060           }
061        }
062    
063        /** 
064         * Returns "2.4"
065         */
066        public String getVersion() {
067           return "2.4";
068        }
069    
070    
071    
072        /**
073         * Returns
074         * MSH (Message Header) - creates it if necessary
075         */
076        public MSH getMSH() { 
077           MSH ret = null;
078           try {
079              ret = (MSH)this.get("MSH");
080           } catch(HL7Exception e) {
081              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
082              throw new RuntimeException(e);
083           }
084           return ret;
085        }
086    
087    
088    
089    
090        /**
091         * Returns
092         * MSA (Message Acknowledgment) - creates it if necessary
093         */
094        public MSA getMSA() { 
095           MSA ret = null;
096           try {
097              ret = (MSA)this.get("MSA");
098           } catch(HL7Exception e) {
099              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
100              throw new RuntimeException(e);
101           }
102           return ret;
103        }
104    
105    
106    
107    
108        /**
109         * Returns
110         * ERR (Error) - creates it if necessary
111         */
112        public ERR getERR() { 
113           ERR ret = null;
114           try {
115              ret = (ERR)this.get("ERR");
116           } catch(HL7Exception e) {
117              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
118              throw new RuntimeException(e);
119           }
120           return ret;
121        }
122    
123    
124    
125    
126        /**
127         * Returns
128         * QAK (Query Acknowledgment) - creates it if necessary
129         */
130        public QAK getQAK() { 
131           QAK ret = null;
132           try {
133              ret = (QAK)this.get("QAK");
134           } catch(HL7Exception e) {
135              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
136              throw new RuntimeException(e);
137           }
138           return ret;
139        }
140    
141    
142    
143    
144        /**
145         * Returns
146         * QPD (Query Parameter Definition) - creates it if necessary
147         */
148        public QPD getQPD() { 
149           QPD ret = null;
150           try {
151              ret = (QPD)this.get("QPD");
152           } catch(HL7Exception e) {
153              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
154              throw new RuntimeException(e);
155           }
156           return ret;
157        }
158    
159    
160    
161    
162        /**
163         * Returns
164         * ROW_DEFINITION (a Group object) - creates it if necessary
165         */
166        public QBP_K13_ROW_DEFINITION getROW_DEFINITION() { 
167           QBP_K13_ROW_DEFINITION ret = null;
168           try {
169              ret = (QBP_K13_ROW_DEFINITION)this.get("ROW_DEFINITION");
170           } catch(HL7Exception e) {
171              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
172              throw new RuntimeException(e);
173           }
174           return ret;
175        }
176    
177    
178    
179    
180        /**
181         * Returns
182         * DSC (Continuation Pointer) - creates it if necessary
183         */
184        public DSC getDSC() { 
185           DSC ret = null;
186           try {
187              ret = (DSC)this.get("DSC");
188           } catch(HL7Exception e) {
189              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
190              throw new RuntimeException(e);
191           }
192           return ret;
193        }
194    
195    
196    
197    
198    }
199