View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v28.segment;
35  
36  // import ca.uhn.hl7v2.model.v28.group.*;
37  import ca.uhn.hl7v2.model.v28.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   *<p>Represents an HL7 PYE message segment (Payee Information). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PYE-1: Set ID - PYE (SI) <b> </b>
53       * <li>PYE-2: Payee Type (CWE) <b> </b>
54       * <li>PYE-3: Payee Relationship to Invoice (Patient) (CWE) <b>optional </b>
55       * <li>PYE-4: Payee Identification List (XON) <b>optional </b>
56       * <li>PYE-5: Payee Person Name (XPN) <b>optional </b>
57       * <li>PYE-6: Payee Address (XAD) <b>optional </b>
58       * <li>PYE-7: Payment Method (CWE) <b>optional </b>
59   * </ul>
60   */
61  @SuppressWarnings("unused")
62  public class PYE extends AbstractSegment {
63  
64      /** 
65       * Creates a new PYE segment
66       */
67      public PYE(Group parent, ModelClassFactory factory) {
68         super(parent, factory);
69         init(factory);
70      }
71  
72      private void init(ModelClassFactory factory) {
73         try {
74                                    this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - PYE");
75                                    this.add(CWE.class, true, 1, 0, new Object[]{ getMessage() }, "Payee Type");
76                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Payee Relationship to Invoice (Patient)");
77                                    this.add(XON.class, false, 1, 0, new Object[]{ getMessage() }, "Payee Identification List");
78                                    this.add(XPN.class, false, 1, 0, new Object[]{ getMessage() }, "Payee Person Name");
79                                    this.add(XAD.class, false, 1, 0, new Object[]{ getMessage() }, "Payee Address");
80                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Payment Method");
81         } catch(HL7Exception e) {
82            log.error("Unexpected error creating PYE - this is probably a bug in the source code generator.", e);
83         }
84      }
85  
86  
87  
88      /**
89       * Returns
90       * PYE-1: "Set ID - PYE" - creates it if necessary
91       */
92      public SI getSetIDPYE() { 
93  		SI retVal = this.getTypedField(1, 0);
94  		return retVal;
95      }
96      
97      /**
98       * Returns
99       * PYE-1: "Set ID - PYE" - creates it if necessary
100      */
101     public SI getPye1_SetIDPYE() { 
102 		SI retVal = this.getTypedField(1, 0);
103 		return retVal;
104     }
105 
106 
107 
108     /**
109      * Returns
110      * PYE-2: "Payee Type" - creates it if necessary
111      */
112     public CWE getPayeeType() { 
113 		CWE retVal = this.getTypedField(2, 0);
114 		return retVal;
115     }
116     
117     /**
118      * Returns
119      * PYE-2: "Payee Type" - creates it if necessary
120      */
121     public CWE getPye2_PayeeType() { 
122 		CWE retVal = this.getTypedField(2, 0);
123 		return retVal;
124     }
125 
126 
127 
128     /**
129      * Returns
130      * PYE-3: "Payee Relationship to Invoice (Patient)" - creates it if necessary
131      */
132     public CWE getPayeeRelationshipToInvoicePatient() { 
133 		CWE retVal = this.getTypedField(3, 0);
134 		return retVal;
135     }
136     
137     /**
138      * Returns
139      * PYE-3: "Payee Relationship to Invoice (Patient)" - creates it if necessary
140      */
141     public CWE getPye3_PayeeRelationshipToInvoicePatient() { 
142 		CWE retVal = this.getTypedField(3, 0);
143 		return retVal;
144     }
145 
146 
147 
148     /**
149      * Returns
150      * PYE-4: "Payee Identification List" - creates it if necessary
151      */
152     public XON getPayeeIdentificationList() { 
153 		XON retVal = this.getTypedField(4, 0);
154 		return retVal;
155     }
156     
157     /**
158      * Returns
159      * PYE-4: "Payee Identification List" - creates it if necessary
160      */
161     public XON getPye4_PayeeIdentificationList() { 
162 		XON retVal = this.getTypedField(4, 0);
163 		return retVal;
164     }
165 
166 
167 
168     /**
169      * Returns
170      * PYE-5: "Payee Person Name" - creates it if necessary
171      */
172     public XPN getPayeePersonName() { 
173 		XPN retVal = this.getTypedField(5, 0);
174 		return retVal;
175     }
176     
177     /**
178      * Returns
179      * PYE-5: "Payee Person Name" - creates it if necessary
180      */
181     public XPN getPye5_PayeePersonName() { 
182 		XPN retVal = this.getTypedField(5, 0);
183 		return retVal;
184     }
185 
186 
187 
188     /**
189      * Returns
190      * PYE-6: "Payee Address" - creates it if necessary
191      */
192     public XAD getPayeeAddress() { 
193 		XAD retVal = this.getTypedField(6, 0);
194 		return retVal;
195     }
196     
197     /**
198      * Returns
199      * PYE-6: "Payee Address" - creates it if necessary
200      */
201     public XAD getPye6_PayeeAddress() { 
202 		XAD retVal = this.getTypedField(6, 0);
203 		return retVal;
204     }
205 
206 
207 
208     /**
209      * Returns
210      * PYE-7: "Payment Method" - creates it if necessary
211      */
212     public CWE getPaymentMethod() { 
213 		CWE retVal = this.getTypedField(7, 0);
214 		return retVal;
215     }
216     
217     /**
218      * Returns
219      * PYE-7: "Payment Method" - creates it if necessary
220      */
221     public CWE getPye7_PaymentMethod() { 
222 		CWE retVal = this.getTypedField(7, 0);
223 		return retVal;
224     }
225 
226 
227 
228 
229 
230     /** {@inheritDoc} */   
231     protected Type createNewTypeWithoutReflection(int field) {
232        switch (field) {
233           case 0: return new SI(getMessage());
234           case 1: return new CWE(getMessage());
235           case 2: return new CWE(getMessage());
236           case 3: return new XON(getMessage());
237           case 4: return new XPN(getMessage());
238           case 5: return new XAD(getMessage());
239           case 6: return new CWE(getMessage());
240           default: return null;
241        }
242    }
243 
244 
245 }
246