View Javadoc
1   /*
2    * Copyright 2008 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.modules.hl7.parser.test.hl7v2.def.v25.message;
17  
18  import org.openehealth.ipf.modules.hl7.parser.test.hl7v2.def.v25.segment.ZBE;
19  
20  import ca.uhn.hl7v2.HL7Exception;
21  import ca.uhn.hl7v2.parser.ModelClassFactory;
22  
23  @SuppressWarnings("serial")
24  public class MDM_T02 extends ca.uhn.hl7v2.model.v25.message.MDM_T02 {
25  
26      public MDM_T02() {
27          super();
28      }
29  
30      public MDM_T02(ModelClassFactory factory) {
31          super(factory);
32          init(factory);
33      }
34  
35      /**
36       * Add the ZBE segment at the end of the structure
37       * 
38       * @param factory
39       */
40      private void init(ModelClassFactory factory) {
41          try {
42              add(ZBE.class, false, false);
43          } catch (HL7Exception e) {
44             log.error("Unexpected error creating message structure", e);
45          }
46      }
47  
48      public ZBE getZBE() {
49          try {
50              return (ZBE) get("ZBE");
51          } catch (HL7Exception e) {
52              throw new RuntimeException(e);
53          }
54      }
55  
56  }