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.v25.segment;
17
18 import org.openehealth.ipf.modules.hl7.HL7v2Exception;
19
20 import ca.uhn.hl7v2.HL7Exception;
21 import ca.uhn.hl7v2.model.AbstractSegment;
22 import ca.uhn.hl7v2.model.Group;
23 import ca.uhn.hl7v2.model.Message;
24 import ca.uhn.hl7v2.model.Type;
25 import ca.uhn.hl7v2.model.v25.datatype.CE;
26 import ca.uhn.hl7v2.model.v25.datatype.CX;
27 import ca.uhn.hl7v2.model.v25.datatype.ST;
28 import ca.uhn.hl7v2.parser.ModelClassFactory;
29
30
31
32
33
34
35
36
37
38
39
40 @SuppressWarnings("serial")
41 public class QPD extends AbstractSegment {
42
43
44
45
46
47 public QPD(Group parentGroup, ModelClassFactory modelFactory) {
48 super(parentGroup, modelFactory);
49 Message msg = getMessage();
50 try {
51 add(CE.class, true, 1, 250, new Object[]{msg}, "Message Query Name");
52 add(ST.class, true, 1, 32, new Object[]{msg}, "Query Tag");
53 add(CX.class, true, 1, 256, new Object[]{msg}, "Person Identifier");
54 add(CX.class, false, 0, 256, new Object[]{msg}, "What domains returned");
55 } catch (HL7Exception e) {
56 throw new HL7v2Exception(e);
57 }
58 }
59
60
61
62
63 public CE getMessageQueryName() {
64 return getTypedField(1, 0);
65 }
66
67
68
69
70 public CE getQpd1_MessageQueryName() {
71 return getTypedField(1, 0);
72 }
73
74
75
76
77 public ST getQueryTag() {
78 return getTypedField(2, 0);
79 }
80
81
82
83
84 public ST getQpd2_QueryTag() {
85 return getTypedField(2, 0);
86 }
87
88
89
90
91 public CX getPersonIdentifier() {
92 return getTypedField(3, 0);
93 }
94
95
96
97
98 public CX getQpd3_PersonIdentifier() {
99 return getTypedField(3, 0);
100 }
101
102
103
104
105 public CX getWhatDomainsReturned(int rep) {
106 return getTypedField(4, rep);
107 }
108
109
110
111
112 public CX getQpd4_WhatDomainsReturned(int rep) {
113 return getTypedField(4, rep);
114 }
115
116
117
118
119 public CX[] getWhatDomainsReturned() {
120 return getTypedField(4, new CX[0]);
121 }
122
123
124 protected Type createNewTypeWithoutReflection(int field) {
125 switch (field) {
126 case 0: return new CE(getMessage());
127 case 1: return new ST(getMessage());
128 case 2: return new CX(getMessage());
129 case 3: return new CX(getMessage());
130 default: return null;
131 }
132 }
133
134 }