1
2
3
4
5 package ca.uhn.hl7v2.examples.custommodel.v25.segment;
6
7 import ca.uhn.hl7v2.HL7Exception;
8 import ca.uhn.hl7v2.model.AbstractSegment;
9 import ca.uhn.hl7v2.model.Group;
10 import ca.uhn.hl7v2.model.Type;
11 import ca.uhn.hl7v2.model.v25.datatype.NM;
12 import ca.uhn.hl7v2.model.v25.datatype.ST;
13 import ca.uhn.hl7v2.parser.ModelClassFactory;
14
15
16
17
18
19
20 public class ZPI extends AbstractSegment {
21
22
23
24
25 private static final long serialVersionUID = 1;
26
27 public ZPI(Group parent, ModelClassFactory factory) {
28 super(parent, factory);
29
30
31
32 init(factory);
33 }
34
35 private void init(ModelClassFactory factory) {
36 try {
37
38
39
40
41
42
43
44
45 add(ST.class, true, 0, 100, new Object[]{ getMessage() }, "Pet Name(s)");
46 add(NM.class, false, 1, 4, new Object[]{ getMessage() }, "Shoe Size");
47 } catch (HL7Exception e) {
48 log.error("Unexpected error creating ZPI - this is probably a bug in the source code generator.", e);
49 }
50 }
51
52
53
54
55 @Override
56 protected Type createNewTypeWithoutReflection(int field) {
57 return null;
58 }
59
60
61
62
63 public ST[] getPetName() {
64 return getTypedField(1, new ST[0]);
65 }
66
67
68
69
70 public NM getShoeSize() {
71 return getTypedField(2, 0);
72 }
73
74 }