1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package ca.uhn.hl7v2.model.v22.segment;
35
36
37 import ca.uhn.hl7v2.model.v22.datatype.*;
38 import ca.uhn.hl7v2.HL7Exception;
39 import ca.uhn.hl7v2.parser.ModelClassFactory;
40 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41 import ca.uhn.hl7v2.model.AbstractMessage;
42 import ca.uhn.hl7v2.model.Group;
43 import ca.uhn.hl7v2.model.Type;
44 import ca.uhn.hl7v2.model.AbstractSegment;
45 import ca.uhn.hl7v2.model.Varies;
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 @SuppressWarnings("unused")
64 public class PV2 extends AbstractSegment {
65
66
67
68
69 public PV2(Group parent, ModelClassFactory factory) {
70 super(parent, factory);
71 init(factory);
72 }
73
74 private void init(ModelClassFactory factory) {
75 try {
76 this.add(CM_INTERNAL_LOCATION.class, false, 1, 12, new Object[]{ getMessage() }, "Prior Pending Location");
77 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Accommodation Code");
78 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Admit Reason");
79 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Transfer Reason");
80 this.add(ST.class, false, 0, 25, new Object[]{ getMessage() }, "Patient Valuables");
81 this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Patient Valuables Location");
82 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(130) }, "Visit User Code");
83 this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Expected Admit Date");
84 this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Expected Discharge Date");
85 } catch(HL7Exception e) {
86 log.error("Unexpected error creating PV2 - this is probably a bug in the source code generator.", e);
87 }
88 }
89
90
91
92
93
94
95
96 public CM_INTERNAL_LOCATION getPriorPendingLocation() {
97 CM_INTERNAL_LOCATION retVal = this.getTypedField(1, 0);
98 return retVal;
99 }
100
101
102
103
104
105 public CM_INTERNAL_LOCATION getPv21_PriorPendingLocation() {
106 CM_INTERNAL_LOCATION retVal = this.getTypedField(1, 0);
107 return retVal;
108 }
109
110
111
112
113
114
115
116 public CE getAccommodationCode() {
117 CE retVal = this.getTypedField(2, 0);
118 return retVal;
119 }
120
121
122
123
124
125 public CE getPv22_AccommodationCode() {
126 CE retVal = this.getTypedField(2, 0);
127 return retVal;
128 }
129
130
131
132
133
134
135
136 public CE getAdmitReason() {
137 CE retVal = this.getTypedField(3, 0);
138 return retVal;
139 }
140
141
142
143
144
145 public CE getPv23_AdmitReason() {
146 CE retVal = this.getTypedField(3, 0);
147 return retVal;
148 }
149
150
151
152
153
154
155
156 public CE getTransferReason() {
157 CE retVal = this.getTypedField(4, 0);
158 return retVal;
159 }
160
161
162
163
164
165 public CE getPv24_TransferReason() {
166 CE retVal = this.getTypedField(4, 0);
167 return retVal;
168 }
169
170
171
172
173
174 public ST[] getPatientValuables() {
175 ST[] retVal = this.getTypedField(5, new ST[0]);
176 return retVal;
177 }
178
179
180
181
182
183 public ST[] getPv25_PatientValuables() {
184 ST[] retVal = this.getTypedField(5, new ST[0]);
185 return retVal;
186 }
187
188
189
190
191
192
193
194 public int getPatientValuablesReps() {
195 return this.getReps(5);
196 }
197
198
199
200
201
202
203
204
205 public ST getPatientValuables(int rep) {
206 ST retVal = this.getTypedField(5, rep);
207 return retVal;
208 }
209
210
211
212
213
214
215
216 public ST getPv25_PatientValuables(int rep) {
217 ST retVal = this.getTypedField(5, rep);
218 return retVal;
219 }
220
221
222
223
224
225
226 public int getPv25_PatientValuablesReps() {
227 return this.getReps(5);
228 }
229
230
231
232
233
234
235
236
237
238 public ST insertPatientValuables(int rep) throws HL7Exception {
239 return (ST) super.insertRepetition(5, rep);
240 }
241
242
243
244
245
246
247
248
249
250 public ST insertPv25_PatientValuables(int rep) throws HL7Exception {
251 return (ST) super.insertRepetition(5, rep);
252 }
253
254
255
256
257
258
259
260
261
262 public ST removePatientValuables(int rep) throws HL7Exception {
263 return (ST) super.removeRepetition(5, rep);
264 }
265
266
267
268
269
270
271
272
273
274 public ST removePv25_PatientValuables(int rep) throws HL7Exception {
275 return (ST) super.removeRepetition(5, rep);
276 }
277
278
279
280
281
282
283
284
285 public ST getPatientValuablesLocation() {
286 ST retVal = this.getTypedField(6, 0);
287 return retVal;
288 }
289
290
291
292
293
294 public ST getPv26_PatientValuablesLocation() {
295 ST retVal = this.getTypedField(6, 0);
296 return retVal;
297 }
298
299
300
301
302
303
304
305 public ID getVisitUserCode() {
306 ID retVal = this.getTypedField(7, 0);
307 return retVal;
308 }
309
310
311
312
313
314 public ID getPv27_VisitUserCode() {
315 ID retVal = this.getTypedField(7, 0);
316 return retVal;
317 }
318
319
320
321
322
323
324
325 public DT getExpectedAdmitDate() {
326 DT retVal = this.getTypedField(8, 0);
327 return retVal;
328 }
329
330
331
332
333
334 public DT getPv28_ExpectedAdmitDate() {
335 DT retVal = this.getTypedField(8, 0);
336 return retVal;
337 }
338
339
340
341
342
343
344
345 public DT getExpectedDischargeDate() {
346 DT retVal = this.getTypedField(9, 0);
347 return retVal;
348 }
349
350
351
352
353
354 public DT getPv29_ExpectedDischargeDate() {
355 DT retVal = this.getTypedField(9, 0);
356 return retVal;
357 }
358
359
360
361
362
363
364 protected Type createNewTypeWithoutReflection(int field) {
365 switch (field) {
366 case 0: return new CM_INTERNAL_LOCATION(getMessage());
367 case 1: return new CE(getMessage());
368 case 2: return new CE(getMessage());
369 case 3: return new CE(getMessage());
370 case 4: return new ST(getMessage());
371 case 5: return new ST(getMessage());
372 case 6: return new ID(getMessage(), new Integer( 130 ));
373 case 7: return new DT(getMessage());
374 case 8: return new DT(getMessage());
375 default: return null;
376 }
377 }
378
379
380 }
381