1   
2   
3   
4   
5   
6   package ca.uhn.hl7v2.examples.custommodel.v25.message;
7   
8   import ca.uhn.hl7v2.HL7Exception;
9   import ca.uhn.hl7v2.examples.custommodel.v25.segment.ZPI;
10  import ca.uhn.hl7v2.model.v25.message.ADT_A01;
11  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
12  import ca.uhn.hl7v2.parser.ModelClassFactory;
13  import java.util.Arrays;
14  
15  
16  
17  
18  
19  
20  
21  
22  @SuppressWarnings("serial")
23  public class ZDT_A01 extends ADT_A01 {
24  
25     
26  
27  
28     public ZDT_A01() throws HL7Exception {
29        this(new DefaultModelClassFactory());
30     }
31  
32     
33  
34  
35  
36  
37     public ZDT_A01(ModelClassFactory factory) throws HL7Exception {
38        super(factory);
39  
40        
41        String[] segmentNames = getNames();
42        int indexOfPid = Arrays.asList(segmentNames).indexOf("PID");
43  
44        
45        int index = indexOfPid + 1;
46  
47        Class<ZPI> type = ZPI.class;
48        boolean required = true;
49        boolean repeating = false;
50  
51        this.add(type, required, repeating, index);
52     }
53  
54     
55  
56  
57     public ZPI getZPI() {
58        return getTyped("ZPI", ZPI.class);
59     }
60  
61  }