View Javadoc
1   /*
2    * Copyright 2015 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  
17  package org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.message;
18  
19  import ca.uhn.hl7v2.model.Structure;
20  import ca.uhn.hl7v2.model.v25.group.ADT_A01_INSURANCE;
21  import ca.uhn.hl7v2.model.v25.group.ADT_A01_PROCEDURE;
22  import ca.uhn.hl7v2.model.v25.segment.*;
23  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
24  import ca.uhn.hl7v2.parser.ModelClassFactory;
25  import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.segment.ZBE;
26  import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.segment.ZZI;
27  import org.openehealth.ipf.modules.hl7.model.AbstractMessage;
28  
29  import java.util.Map;
30  
31  /**
32   *
33   */
34  public class ADT_A16 extends AbstractMessage {
35  
36      public ADT_A16() {
37          this(new DefaultModelClassFactory());
38      }
39  
40      public ADT_A16(ModelClassFactory factory) {
41          super(factory);
42      }
43  
44      @Override
45      protected Map<Class<? extends Structure>, Cardinality> structures(Map<Class<? extends Structure>, Cardinality> s) {
46          s.put(MSH.class, Cardinality.REQUIRED);
47          s.put(SFT.class, Cardinality.OPTIONAL_REPEATING);
48          s.put(EVN.class, Cardinality.REQUIRED);
49          s.put(PID.class, Cardinality.REQUIRED);
50          s.put(PD1.class, Cardinality.OPTIONAL);
51          s.put(ROL.class, Cardinality.OPTIONAL_REPEATING);
52          s.put(NK1.class, Cardinality.OPTIONAL_REPEATING);
53          s.put(PV1.class, Cardinality.REQUIRED);
54          s.put(PV2.class, Cardinality.OPTIONAL);
55          s.put(ZBE.class, Cardinality.OPTIONAL);
56          s.put(ROL.class, Cardinality.OPTIONAL_REPEATING);
57          s.put(DB1.class, Cardinality.OPTIONAL_REPEATING);
58          s.put(OBX.class, Cardinality.OPTIONAL_REPEATING);
59          s.put(AL1.class, Cardinality.OPTIONAL_REPEATING);
60          s.put(DG1.class, Cardinality.OPTIONAL_REPEATING);
61          s.put(DRG.class, Cardinality.OPTIONAL);
62          s.put(ADT_A01_PROCEDURE.class, Cardinality.OPTIONAL_REPEATING);
63          s.put(GT1.class, Cardinality.OPTIONAL_REPEATING);
64          s.put(ADT_A01_INSURANCE.class, Cardinality.OPTIONAL_REPEATING);
65          s.put(ACC.class, Cardinality.OPTIONAL);
66          s.put(ZZI.class, Cardinality.OPTIONAL);
67          return s;
68      }
69  
70  }