/NuGenHL7v22/Genetibase/NuGenHL7/model/v22/segment/GT1.cs

https://github.com/GunioRobot/NuGenHL7 · C# · 620 lines · 529 code · 26 blank · 65 comment · 3 complexity · 46fa3b6cb79a2188b4bc1f40b0e00cd5 MD5 · raw file

  1. using System;
  2. using Genetibase.NuGenHL7.model;
  3. using Genetibase.NuGenHL7.model.v22.datatype;
  4. using ModelClassFactory = Genetibase.NuGenHL7.parser.NuGenModelClassFactory;
  5. using HL7Exception = Genetibase.NuGenHL7.NuGenHL7Exception;
  6. namespace Genetibase.NuGenHL7.model.v22.segment
  7. {
  8. /// <summary> <p>Represents an HL7 GT1 message segment.
  9. /// This segment has the following fields:</p><p>
  10. /// GT1-1: Set ID - guarantor (SI)<br>
  11. /// GT1-2: Guarantor number (CK)<br>
  12. /// GT1-3: Guarantor name (PN)<br>
  13. /// GT1-4: Guarantor spouse name (PN)<br>
  14. /// GT1-5: Guarantor address (AD)<br>
  15. /// GT1-6: Guarantor phone number - home (TN)<br>
  16. /// GT1-7: Guarantor phone number - business (TN)<br>
  17. /// GT1-8: Guarantor date of birth (DT)<br>
  18. /// GT1-9: Guarantor sex (ID)<br>
  19. /// GT1-10: Guarantor type (ID)<br>
  20. /// GT1-11: Guarantor relationship (ID)<br>
  21. /// GT1-12: Guarantor social security number (ST)<br>
  22. /// GT1-13: Guarantor date - begin (DT)<br>
  23. /// GT1-14: Guarantor date - end (DT)<br>
  24. /// GT1-15: Guarantor priority (NM)<br>
  25. /// GT1-16: Guarantor employer name (ST)<br>
  26. /// GT1-17: Guarantor employer address (AD)<br>
  27. /// GT1-18: Guarantor employ phone number (TN)<br>
  28. /// GT1-19: Guarantor employee ID number (ST)<br>
  29. /// GT1-20: Guarantor employment status (ID)<br>
  30. /// GT1-21: Guarantor organization (ST)<br>
  31. /// </p><p>The get...() methods return data from individual fields. These methods
  32. /// do not throw exceptions and may therefore have to handle exceptions internally.
  33. /// If an exception is handled internally, it is logged and null is returned.
  34. /// This is not expected to happen - if it does happen this indicates not so much
  35. /// an exceptional circumstance as a bug in the code for this class.</p>
  36. /// </summary>
  37. [Serializable]
  38. public class GT1:AbstractSegment
  39. {
  40. /// <summary> Returns Set ID - guarantor (GT1-1).</summary>
  41. virtual public SI SetIDGuarantor
  42. {
  43. get
  44. {
  45. SI ret = null;
  46. try
  47. {
  48. Type t = this.getField(1, 0);
  49. ret = (SI) t;
  50. }
  51. catch (System.InvalidCastException )
  52. {
  53. throw new Exception();
  54. }
  55. catch (NuGenHL7Exception)
  56. {
  57. throw new Exception();
  58. }
  59. return ret;
  60. }
  61. }
  62. /// <summary> Returns Guarantor number (GT1-2).</summary>
  63. virtual public CK GuarantorNumber
  64. {
  65. get
  66. {
  67. CK ret = null;
  68. try
  69. {
  70. Type t = this.getField(2, 0);
  71. ret = (CK) t;
  72. }
  73. catch (System.InvalidCastException )
  74. {
  75. throw new Exception();
  76. }
  77. catch (NuGenHL7Exception)
  78. {
  79. throw new Exception();
  80. }
  81. return ret;
  82. }
  83. }
  84. /// <summary> Returns Guarantor name (GT1-3).</summary>
  85. virtual public PN GuarantorName
  86. {
  87. get
  88. {
  89. PN ret = null;
  90. try
  91. {
  92. Type t = this.getField(3, 0);
  93. ret = (PN) t;
  94. }
  95. catch (System.InvalidCastException )
  96. {
  97. throw new Exception();
  98. }
  99. catch (NuGenHL7Exception)
  100. {
  101. throw new Exception();
  102. }
  103. return ret;
  104. }
  105. }
  106. /// <summary> Returns Guarantor spouse name (GT1-4).</summary>
  107. virtual public PN GuarantorSpouseName
  108. {
  109. get
  110. {
  111. PN ret = null;
  112. try
  113. {
  114. Type t = this.getField(4, 0);
  115. ret = (PN) t;
  116. }
  117. catch (System.InvalidCastException )
  118. {
  119. throw new Exception();
  120. }
  121. catch (NuGenHL7Exception)
  122. {
  123. throw new Exception();
  124. }
  125. return ret;
  126. }
  127. }
  128. /// <summary> Returns Guarantor address (GT1-5).</summary>
  129. virtual public AD GuarantorAddress
  130. {
  131. get
  132. {
  133. AD ret = null;
  134. try
  135. {
  136. Type t = this.getField(5, 0);
  137. ret = (AD) t;
  138. }
  139. catch (System.InvalidCastException )
  140. {
  141. throw new Exception();
  142. }
  143. catch (NuGenHL7Exception)
  144. {
  145. throw new Exception();
  146. }
  147. return ret;
  148. }
  149. }
  150. /// <summary> Returns Guarantor date of birth (GT1-8).</summary>
  151. virtual public DT GuarantorDateOfBirth
  152. {
  153. get
  154. {
  155. DT ret = null;
  156. try
  157. {
  158. Type t = this.getField(8, 0);
  159. ret = (DT) t;
  160. }
  161. catch (System.InvalidCastException )
  162. {
  163. throw new Exception();
  164. }
  165. catch (NuGenHL7Exception)
  166. {
  167. throw new Exception();
  168. }
  169. return ret;
  170. }
  171. }
  172. /// <summary> Returns Guarantor sex (GT1-9).</summary>
  173. virtual public ID GuarantorSex
  174. {
  175. get
  176. {
  177. ID ret = null;
  178. try
  179. {
  180. Type t = this.getField(9, 0);
  181. ret = (ID) t;
  182. }
  183. catch (System.InvalidCastException )
  184. {
  185. throw new Exception();
  186. }
  187. catch (NuGenHL7Exception)
  188. {
  189. throw new Exception();
  190. }
  191. return ret;
  192. }
  193. }
  194. /// <summary> Returns Guarantor type (GT1-10).</summary>
  195. virtual public ID GuarantorType
  196. {
  197. get
  198. {
  199. ID ret = null;
  200. try
  201. {
  202. Type t = this.getField(10, 0);
  203. ret = (ID) t;
  204. }
  205. catch (System.InvalidCastException )
  206. {
  207. throw new Exception();
  208. }
  209. catch (NuGenHL7Exception)
  210. {
  211. throw new Exception();
  212. }
  213. return ret;
  214. }
  215. }
  216. /// <summary> Returns Guarantor relationship (GT1-11).</summary>
  217. virtual public ID GuarantorRelationship
  218. {
  219. get
  220. {
  221. ID ret = null;
  222. try
  223. {
  224. Type t = this.getField(11, 0);
  225. ret = (ID) t;
  226. }
  227. catch (System.InvalidCastException )
  228. {
  229. throw new Exception();
  230. }
  231. catch (NuGenHL7Exception)
  232. {
  233. throw new Exception();
  234. }
  235. return ret;
  236. }
  237. }
  238. /// <summary> Returns Guarantor social security number (GT1-12).</summary>
  239. virtual public ST GuarantorSocialSecurityNumber
  240. {
  241. get
  242. {
  243. ST ret = null;
  244. try
  245. {
  246. Type t = this.getField(12, 0);
  247. ret = (ST) t;
  248. }
  249. catch (System.InvalidCastException )
  250. {
  251. throw new Exception();
  252. }
  253. catch (NuGenHL7Exception)
  254. {
  255. throw new Exception();
  256. }
  257. return ret;
  258. }
  259. }
  260. /// <summary> Returns Guarantor date - begin (GT1-13).</summary>
  261. virtual public DT GuarantorDateBegin
  262. {
  263. get
  264. {
  265. DT ret = null;
  266. try
  267. {
  268. Type t = this.getField(13, 0);
  269. ret = (DT) t;
  270. }
  271. catch (System.InvalidCastException )
  272. {
  273. throw new Exception();
  274. }
  275. catch (NuGenHL7Exception)
  276. {
  277. throw new Exception();
  278. }
  279. return ret;
  280. }
  281. }
  282. /// <summary> Returns Guarantor date - end (GT1-14).</summary>
  283. virtual public DT GuarantorDateEnd
  284. {
  285. get
  286. {
  287. DT ret = null;
  288. try
  289. {
  290. Type t = this.getField(14, 0);
  291. ret = (DT) t;
  292. }
  293. catch (System.InvalidCastException )
  294. {
  295. throw new Exception();
  296. }
  297. catch (NuGenHL7Exception)
  298. {
  299. throw new Exception();
  300. }
  301. return ret;
  302. }
  303. }
  304. /// <summary> Returns Guarantor priority (GT1-15).</summary>
  305. virtual public NM GuarantorPriority
  306. {
  307. get
  308. {
  309. NM ret = null;
  310. try
  311. {
  312. Type t = this.getField(15, 0);
  313. ret = (NM) t;
  314. }
  315. catch (System.InvalidCastException )
  316. {
  317. throw new Exception();
  318. }
  319. catch (NuGenHL7Exception)
  320. {
  321. throw new Exception();
  322. }
  323. return ret;
  324. }
  325. }
  326. /// <summary> Returns Guarantor employer name (GT1-16).</summary>
  327. virtual public ST GuarantorEmployerName
  328. {
  329. get
  330. {
  331. ST ret = null;
  332. try
  333. {
  334. Type t = this.getField(16, 0);
  335. ret = (ST) t;
  336. }
  337. catch (System.InvalidCastException )
  338. {
  339. throw new Exception();
  340. }
  341. catch (NuGenHL7Exception)
  342. {
  343. throw new Exception();
  344. }
  345. return ret;
  346. }
  347. }
  348. /// <summary> Returns Guarantor employer address (GT1-17).</summary>
  349. virtual public AD GuarantorEmployerAddress
  350. {
  351. get
  352. {
  353. AD ret = null;
  354. try
  355. {
  356. Type t = this.getField(17, 0);
  357. ret = (AD) t;
  358. }
  359. catch (System.InvalidCastException )
  360. {
  361. throw new Exception();
  362. }
  363. catch (NuGenHL7Exception)
  364. {
  365. throw new Exception();
  366. }
  367. return ret;
  368. }
  369. }
  370. /// <summary> Returns Guarantor employee ID number (GT1-19).</summary>
  371. virtual public ST GuarantorEmployeeIDNumber
  372. {
  373. get
  374. {
  375. ST ret = null;
  376. try
  377. {
  378. Type t = this.getField(19, 0);
  379. ret = (ST) t;
  380. }
  381. catch (System.InvalidCastException )
  382. {
  383. throw new Exception();
  384. }
  385. catch (NuGenHL7Exception)
  386. {
  387. throw new Exception();
  388. }
  389. return ret;
  390. }
  391. }
  392. /// <summary> Returns Guarantor employment status (GT1-20).</summary>
  393. virtual public ID GuarantorEmploymentStatus
  394. {
  395. get
  396. {
  397. ID ret = null;
  398. try
  399. {
  400. Type t = this.getField(20, 0);
  401. ret = (ID) t;
  402. }
  403. catch (System.InvalidCastException )
  404. {
  405. throw new Exception();
  406. }
  407. catch (NuGenHL7Exception)
  408. {
  409. throw new Exception();
  410. }
  411. return ret;
  412. }
  413. }
  414. /// <summary> Returns Guarantor organization (GT1-21).</summary>
  415. virtual public ST GuarantorOrganization
  416. {
  417. get
  418. {
  419. ST ret = null;
  420. try
  421. {
  422. Type t = this.getField(21, 0);
  423. ret = (ST) t;
  424. }
  425. catch (System.InvalidCastException )
  426. {
  427. throw new Exception();
  428. }
  429. catch (NuGenHL7Exception)
  430. {
  431. throw new Exception();
  432. }
  433. return ret;
  434. }
  435. }
  436. /// <summary> Creates a GT1 (GUARANTOR) segment object that belongs to the given
  437. /// message.
  438. /// </summary>
  439. public GT1(Group parent, ModelClassFactory factory):base(parent, factory)
  440. {
  441. Message message = Message;
  442. try
  443. {
  444. this.add(typeof(SI), true, 1, 4, new System.Object[]{message});
  445. this.add(typeof(CK), false, 1, 20, new System.Object[]{message});
  446. this.add(typeof(PN), true, 1, 48, new System.Object[]{message});
  447. this.add(typeof(PN), false, 1, 48, new System.Object[]{message});
  448. this.add(typeof(AD), false, 1, 106, new System.Object[]{message});
  449. this.add(typeof(TN), false, 3, 40, new System.Object[]{message});
  450. this.add(typeof(TN), false, 3, 40, new System.Object[]{message});
  451. this.add(typeof(DT), false, 1, 8, new System.Object[]{message});
  452. this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 1});
  453. this.add(typeof(ID), false, 1, 2, new System.Object[]{message, 68});
  454. this.add(typeof(ID), false, 1, 2, new System.Object[]{message, 63});
  455. this.add(typeof(ST), false, 1, 11, new System.Object[]{message});
  456. this.add(typeof(DT), false, 1, 8, new System.Object[]{message});
  457. this.add(typeof(DT), false, 1, 8, new System.Object[]{message});
  458. this.add(typeof(NM), false, 1, 2, new System.Object[]{message});
  459. this.add(typeof(ST), false, 1, 45, new System.Object[]{message});
  460. this.add(typeof(AD), false, 1, 106, new System.Object[]{message});
  461. this.add(typeof(TN), false, 3, 40, new System.Object[]{message});
  462. this.add(typeof(ST), false, 1, 20, new System.Object[]{message});
  463. this.add(typeof(ID), false, 1, 2, new System.Object[]{message, 66});
  464. this.add(typeof(ST), false, 1, 60, new System.Object[]{message});
  465. }
  466. catch (NuGenHL7Exception)
  467. {
  468. }
  469. }
  470. /// <summary> Returns a single repetition of Guarantor phone number - home (GT1-6).</summary>
  471. /// <param name="rep">the repetition number (this is a repeating field)
  472. /// </param>
  473. /// <throws> HL7Exception if the repetition number is invalid. </throws>
  474. public virtual TN getGuarantorPhoneNumberHome(int rep)
  475. {
  476. TN ret = null;
  477. try
  478. {
  479. Type t = this.getField(6, rep);
  480. ret = (TN) t;
  481. }
  482. catch (System.InvalidCastException )
  483. {
  484. throw new Exception();
  485. }
  486. return ret;
  487. }
  488. /// <summary> Returns all repetitions of Guarantor phone number - home (GT1-6).</summary>
  489. public virtual TN[] getGuarantorPhoneNumberHome()
  490. {
  491. TN[] ret = null;
  492. try
  493. {
  494. Type[] t = this.getField(6);
  495. ret = new TN[t.Length];
  496. for (int i = 0; i < ret.Length; i++)
  497. {
  498. ret[i] = (TN) t[i];
  499. }
  500. }
  501. catch (System.InvalidCastException )
  502. {
  503. throw new Exception();
  504. }
  505. catch (NuGenHL7Exception)
  506. {
  507. throw new Exception();
  508. }
  509. return ret;
  510. }
  511. /// <summary> Returns a single repetition of Guarantor phone number - business (GT1-7).</summary>
  512. /// <param name="rep">the repetition number (this is a repeating field)
  513. /// </param>
  514. /// <throws> HL7Exception if the repetition number is invalid. </throws>
  515. public virtual TN getGuarantorPhoneNumberBusiness(int rep)
  516. {
  517. TN ret = null;
  518. try
  519. {
  520. Type t = this.getField(7, rep);
  521. ret = (TN) t;
  522. }
  523. catch (System.InvalidCastException )
  524. {
  525. throw new Exception();
  526. }
  527. return ret;
  528. }
  529. /// <summary> Returns all repetitions of Guarantor phone number - business (GT1-7).</summary>
  530. public virtual TN[] getGuarantorPhoneNumberBusiness()
  531. {
  532. TN[] ret = null;
  533. try
  534. {
  535. Type[] t = this.getField(7);
  536. ret = new TN[t.Length];
  537. for (int i = 0; i < ret.Length; i++)
  538. {
  539. ret[i] = (TN) t[i];
  540. }
  541. }
  542. catch (System.InvalidCastException )
  543. {
  544. throw new Exception();
  545. }
  546. catch (NuGenHL7Exception)
  547. {
  548. throw new Exception();
  549. }
  550. return ret;
  551. }
  552. /// <summary> Returns a single repetition of Guarantor employ phone number (GT1-18).</summary>
  553. /// <param name="rep">the repetition number (this is a repeating field)
  554. /// </param>
  555. /// <throws> HL7Exception if the repetition number is invalid. </throws>
  556. public virtual TN getGuarantorEmployPhoneNumber(int rep)
  557. {
  558. TN ret = null;
  559. try
  560. {
  561. Type t = this.getField(18, rep);
  562. ret = (TN) t;
  563. }
  564. catch (System.InvalidCastException )
  565. {
  566. throw new Exception();
  567. }
  568. return ret;
  569. }
  570. /// <summary> Returns all repetitions of Guarantor employ phone number (GT1-18).</summary>
  571. public virtual TN[] getGuarantorEmployPhoneNumber()
  572. {
  573. TN[] ret = null;
  574. try
  575. {
  576. Type[] t = this.getField(18);
  577. ret = new TN[t.Length];
  578. for (int i = 0; i < ret.Length; i++)
  579. {
  580. ret[i] = (TN) t[i];
  581. }
  582. }
  583. catch (System.InvalidCastException )
  584. {
  585. throw new Exception();
  586. }
  587. catch (NuGenHL7Exception)
  588. {
  589. throw new Exception();
  590. }
  591. return ret;
  592. }
  593. }
  594. }