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.group;
009    
010    import ca.uhn.hl7v2.model.v24.segment.*;
011    
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.AbstractGroup;
019    import ca.uhn.hl7v2.model.GenericSegment;
020    
021    /**
022     * <p>Represents a ORL_O22_RESPONSE group structure (a Group object).
023     * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
024     * This Group contains the following elements:  
025     * </p>
026     * <ul>
027                     * <li>1: ORL_O22_PATIENT (a Group object) <b>optional </b></li>
028     * </ul>
029     */
030    public class ORL_O22_RESPONSE extends AbstractGroup {
031    
032        /** 
033         * Creates a new ORL_O22_RESPONSE group
034         */
035        public ORL_O22_RESPONSE(Group parent, ModelClassFactory factory) {
036           super(parent, factory);
037           init(factory);
038        }
039    
040        private void init(ModelClassFactory factory) {
041           try {
042                              this.add(ORL_O22_PATIENT.class, false, false);
043           } catch(HL7Exception e) {
044              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ORL_O22_RESPONSE - this is probably a bug in the source code generator.", e);
045           }
046        }
047    
048        /** 
049         * Returns "2.4"
050         */
051        public String getVersion() {
052           return "2.4";
053        }
054    
055    
056    
057        /**
058         * Returns
059         * PATIENT (a Group object) - creates it if necessary
060         */
061        public ORL_O22_PATIENT getPATIENT() { 
062           ORL_O22_PATIENT ret = null;
063           try {
064              ret = (ORL_O22_PATIENT)this.get("PATIENT");
065           } catch(HL7Exception e) {
066              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
067              throw new RuntimeException(e);
068           }
069           return ret;
070        }
071    
072    
073    
074    
075    }
076