1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.hl7v2.definitions.pix.v231.message;
17
18 import ca.uhn.hl7v2.HL7Exception;
19 import ca.uhn.hl7v2.model.Structure;
20 import ca.uhn.hl7v2.model.v231.segment.EVN;
21 import ca.uhn.hl7v2.model.v231.segment.MSH;
22 import ca.uhn.hl7v2.parser.ModelClassFactory;
23 import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pix.v231.group.ADT_A39_PATIENT;
24 import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pix.v231.segment.ZZI;
25 import org.openehealth.ipf.modules.hl7.model.AbstractMessage;
26
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33 public class ADT_A39 extends AbstractMessage {
34
35 public ADT_A39() {
36 super();
37 }
38
39 public ADT_A39(ModelClassFactory factory) {
40 super(factory);
41 }
42
43 @Override
44 protected Map<Class<? extends Structure>, Cardinality> structures(Map<Class<? extends Structure>, Cardinality> s) {
45 s.put(MSH.class, Cardinality.REQUIRED);
46 s.put(EVN.class, Cardinality.REQUIRED);
47 s.put(ADT_A39_PATIENT.class, Cardinality.REQUIRED_REPEATING);
48 s.put(ZZI.class, Cardinality.OPTIONAL);
49 return s;
50 }
51
52 public String getVersion() {
53 return "2.3.1";
54 }
55
56 public MSH getMSH() {
57 return getTyped("MSH", MSH.class);
58 }
59
60 public EVN getEVN() {
61 return getTyped("EVN", EVN.class);
62 }
63
64 public ADT_A39_PATIENT getPATIENT() {
65 return this.getTyped("PATIENT", ADT_A39_PATIENT.class);
66 }
67
68 public ADT_A39_PATIENT getPATIENT(int rep) {
69 return this.getTyped("PATIENT", rep, ADT_A39_PATIENT.class);
70 }
71
72 public int getPATIENTReps() {
73 return this.getReps("PATIENT");
74 }
75
76 public List<ADT_A39_PATIENT> getPATIENTAll() throws HL7Exception {
77 return this.getAllAsList("PATIENT", ADT_A39_PATIENT.class);
78 }
79
80 public void insertPATIENT(ADT_A39_PATIENT structure, int rep) throws HL7Exception {
81 super.insertRepetition("PATIENT", structure, rep);
82 }
83
84 public ADT_A39_PATIENT insertPATIENT(int rep) throws HL7Exception {
85 return (ADT_A39_PATIENT)super.insertRepetition("PATIENT", rep);
86 }
87
88 public ADT_A39_PATIENT removePATIENT(int rep) throws HL7Exception {
89 return (ADT_A39_PATIENT)super.removeRepetition("PATIENT", rep);
90 }
91 }