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.segment.*;
21  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
22  import ca.uhn.hl7v2.parser.ModelClassFactory;
23  import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.segment.ZBE;
24  import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.segment.ZZI;
25  import org.openehealth.ipf.modules.hl7.model.AbstractMessage;
26  
27  import java.util.Map;
28  
29  /**
30   *
31   */
32  public class ADT_A12 extends AbstractMessage {
33  
34      public ADT_A12() {
35          this(new DefaultModelClassFactory());
36      }
37  
38      public ADT_A12(ModelClassFactory factory) {
39          super(factory);
40      }
41  
42      @Override
43      protected Map<Class<? extends Structure>, Cardinality> structures(Map<Class<? extends Structure>, Cardinality> s) {
44          s.put(MSH.class, Cardinality.REQUIRED);
45          s.put(SFT.class, Cardinality.OPTIONAL_REPEATING);
46          s.put(EVN.class, Cardinality.REQUIRED);
47          s.put(PID.class, Cardinality.REQUIRED);
48          s.put(PD1.class, Cardinality.OPTIONAL);
49          s.put(PV1.class, Cardinality.REQUIRED);
50          s.put(PV2.class, Cardinality.OPTIONAL);
51          s.put(ZBE.class, Cardinality.OPTIONAL);
52          s.put(DB1.class, Cardinality.OPTIONAL_REPEATING);
53          s.put(OBX.class, Cardinality.OPTIONAL_REPEATING);
54          s.put(DG1.class, Cardinality.OPTIONAL);
55          s.put(ZZI.class, Cardinality.OPTIONAL);
56          return s;
57      }
58  
59  }