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