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