hippo_eyeDoc 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +124 -0
  3. data/Gemfile +10 -0
  4. data/Guardfile +14 -0
  5. data/LICENSE +24 -0
  6. data/README.md +385 -0
  7. data/Rakefile +12 -0
  8. data/hippo_eyeDoc.gemspec +25 -0
  9. data/lib/hippo_eyeDoc.rb +15 -0
  10. data/lib/hippo_eyeDoc/code_lists.rb +10 -0
  11. data/lib/hippo_eyeDoc/code_lists/claim_adjustment_reason_codes.rb +2252 -0
  12. data/lib/hippo_eyeDoc/code_lists/claim_status_category_codes.rb +376 -0
  13. data/lib/hippo_eyeDoc/code_lists/claim_status_codes.rb +5456 -0
  14. data/lib/hippo_eyeDoc/code_lists/remittance_advice_remark_codes.rb +6280 -0
  15. data/lib/hippo_eyeDoc/code_lists/service_type_codes.rb +1299 -0
  16. data/lib/hippo_eyeDoc/code_lists/taxonomy_codes.rb +9224 -0
  17. data/lib/hippo_eyeDoc/exceptions.rb +10 -0
  18. data/lib/hippo_eyeDoc/field.rb +149 -0
  19. data/lib/hippo_eyeDoc/outputters.rb +4 -0
  20. data/lib/hippo_eyeDoc/outputters/html.rb +39 -0
  21. data/lib/hippo_eyeDoc/outputters/paper_claim.rb +7 -0
  22. data/lib/hippo_eyeDoc/outputters/pdf.rb +18 -0
  23. data/lib/hippo_eyeDoc/outputters/pretty_string.rb +45 -0
  24. data/lib/hippo_eyeDoc/parser.rb +70 -0
  25. data/lib/hippo_eyeDoc/parser/segment.rb +35 -0
  26. data/lib/hippo_eyeDoc/parser/transaction_set.rb +45 -0
  27. data/lib/hippo_eyeDoc/segments.rb +111 -0
  28. data/lib/hippo_eyeDoc/segments/AAA.rb +39 -0
  29. data/lib/hippo_eyeDoc/segments/AK1.rb +31 -0
  30. data/lib/hippo_eyeDoc/segments/AK2.rb +31 -0
  31. data/lib/hippo_eyeDoc/segments/AK3.rb +39 -0
  32. data/lib/hippo_eyeDoc/segments/AK4.rb +59 -0
  33. data/lib/hippo_eyeDoc/segments/AK5.rb +55 -0
  34. data/lib/hippo_eyeDoc/segments/AK9.rb +79 -0
  35. data/lib/hippo_eyeDoc/segments/AMT.rb +31 -0
  36. data/lib/hippo_eyeDoc/segments/BHT.rb +55 -0
  37. data/lib/hippo_eyeDoc/segments/BPR.rb +175 -0
  38. data/lib/hippo_eyeDoc/segments/CAS.rb +159 -0
  39. data/lib/hippo_eyeDoc/segments/CL1.rb +39 -0
  40. data/lib/hippo_eyeDoc/segments/CLM.rb +223 -0
  41. data/lib/hippo_eyeDoc/segments/CLP.rb +119 -0
  42. data/lib/hippo_eyeDoc/segments/CN1.rb +55 -0
  43. data/lib/hippo_eyeDoc/segments/CR1.rb +87 -0
  44. data/lib/hippo_eyeDoc/segments/CR2.rb +103 -0
  45. data/lib/hippo_eyeDoc/segments/CR3.rb +47 -0
  46. data/lib/hippo_eyeDoc/segments/CR4.rb +239 -0
  47. data/lib/hippo_eyeDoc/segments/CR5.rb +151 -0
  48. data/lib/hippo_eyeDoc/segments/CR6.rb +175 -0
  49. data/lib/hippo_eyeDoc/segments/CR7.rb +31 -0
  50. data/lib/hippo_eyeDoc/segments/CR8.rb +79 -0
  51. data/lib/hippo_eyeDoc/segments/CRC.rb +63 -0
  52. data/lib/hippo_eyeDoc/segments/CTP.rb +211 -0
  53. data/lib/hippo_eyeDoc/segments/CTX.rb +99 -0
  54. data/lib/hippo_eyeDoc/segments/CUR.rb +175 -0
  55. data/lib/hippo_eyeDoc/segments/DMG.rb +115 -0
  56. data/lib/hippo_eyeDoc/segments/DN1.rb +39 -0
  57. data/lib/hippo_eyeDoc/segments/DN2.rb +55 -0
  58. data/lib/hippo_eyeDoc/segments/DSB.rb +71 -0
  59. data/lib/hippo_eyeDoc/segments/DTM.rb +55 -0
  60. data/lib/hippo_eyeDoc/segments/DTP.rb +31 -0
  61. data/lib/hippo_eyeDoc/segments/EB.rb +207 -0
  62. data/lib/hippo_eyeDoc/segments/EM.rb +63 -0
  63. data/lib/hippo_eyeDoc/segments/EQ.rb +135 -0
  64. data/lib/hippo_eyeDoc/segments/FRM.rb +47 -0
  65. data/lib/hippo_eyeDoc/segments/GE.rb +23 -0
  66. data/lib/hippo_eyeDoc/segments/GS.rb +71 -0
  67. data/lib/hippo_eyeDoc/segments/HCP.rb +127 -0
  68. data/lib/hippo_eyeDoc/segments/HI.rb +919 -0
  69. data/lib/hippo_eyeDoc/segments/HL.rb +44 -0
  70. data/lib/hippo_eyeDoc/segments/HSD.rb +71 -0
  71. data/lib/hippo_eyeDoc/segments/IEA.rb +23 -0
  72. data/lib/hippo_eyeDoc/segments/III.rb +195 -0
  73. data/lib/hippo_eyeDoc/segments/IK3.rb +39 -0
  74. data/lib/hippo_eyeDoc/segments/IK4.rb +59 -0
  75. data/lib/hippo_eyeDoc/segments/IK5.rb +55 -0
  76. data/lib/hippo_eyeDoc/segments/IMM.rb +55 -0
  77. data/lib/hippo_eyeDoc/segments/INS.rb +171 -0
  78. data/lib/hippo_eyeDoc/segments/ISA.rb +136 -0
  79. data/lib/hippo_eyeDoc/segments/K3.rb +147 -0
  80. data/lib/hippo_eyeDoc/segments/LE.rb +15 -0
  81. data/lib/hippo_eyeDoc/segments/LIN.rb +255 -0
  82. data/lib/hippo_eyeDoc/segments/LQ.rb +23 -0
  83. data/lib/hippo_eyeDoc/segments/LS.rb +15 -0
  84. data/lib/hippo_eyeDoc/segments/LX.rb +20 -0
  85. data/lib/hippo_eyeDoc/segments/MEA.rb +219 -0
  86. data/lib/hippo_eyeDoc/segments/MIA.rb +199 -0
  87. data/lib/hippo_eyeDoc/segments/MOA.rb +79 -0
  88. data/lib/hippo_eyeDoc/segments/MPI.rb +63 -0
  89. data/lib/hippo_eyeDoc/segments/MSG.rb +31 -0
  90. data/lib/hippo_eyeDoc/segments/N1.rb +55 -0
  91. data/lib/hippo_eyeDoc/segments/N2.rb +23 -0
  92. data/lib/hippo_eyeDoc/segments/N3.rb +23 -0
  93. data/lib/hippo_eyeDoc/segments/N4.rb +63 -0
  94. data/lib/hippo_eyeDoc/segments/NM1.rb +103 -0
  95. data/lib/hippo_eyeDoc/segments/NTE.rb +23 -0
  96. data/lib/hippo_eyeDoc/segments/OI.rb +55 -0
  97. data/lib/hippo_eyeDoc/segments/PAT.rb +79 -0
  98. data/lib/hippo_eyeDoc/segments/PCT.rb +23 -0
  99. data/lib/hippo_eyeDoc/segments/PDP.rb +31 -0
  100. data/lib/hippo_eyeDoc/segments/PDR.rb +39 -0
  101. data/lib/hippo_eyeDoc/segments/PER.rb +79 -0
  102. data/lib/hippo_eyeDoc/segments/PID.rb +79 -0
  103. data/lib/hippo_eyeDoc/segments/PKD.rb +47 -0
  104. data/lib/hippo_eyeDoc/segments/PLB.rb +191 -0
  105. data/lib/hippo_eyeDoc/segments/PRV.rb +75 -0
  106. data/lib/hippo_eyeDoc/segments/PS1.rb +31 -0
  107. data/lib/hippo_eyeDoc/segments/PWK.rb +115 -0
  108. data/lib/hippo_eyeDoc/segments/QTY.rb +155 -0
  109. data/lib/hippo_eyeDoc/segments/RDM.rb +135 -0
  110. data/lib/hippo_eyeDoc/segments/REF.rb +83 -0
  111. data/lib/hippo_eyeDoc/segments/SBR.rb +79 -0
  112. data/lib/hippo_eyeDoc/segments/SD1.rb +71 -0
  113. data/lib/hippo_eyeDoc/segments/SE.rb +23 -0
  114. data/lib/hippo_eyeDoc/segments/ST.rb +31 -0
  115. data/lib/hippo_eyeDoc/segments/STC.rb +187 -0
  116. data/lib/hippo_eyeDoc/segments/SV1.rb +263 -0
  117. data/lib/hippo_eyeDoc/segments/SV2.rb +147 -0
  118. data/lib/hippo_eyeDoc/segments/SV3.rb +219 -0
  119. data/lib/hippo_eyeDoc/segments/SV4.rb +211 -0
  120. data/lib/hippo_eyeDoc/segments/SV5.rb +123 -0
  121. data/lib/hippo_eyeDoc/segments/SV6.rb +151 -0
  122. data/lib/hippo_eyeDoc/segments/SV7.rb +55 -0
  123. data/lib/hippo_eyeDoc/segments/SVC.rb +183 -0
  124. data/lib/hippo_eyeDoc/segments/SVD.rb +115 -0
  125. data/lib/hippo_eyeDoc/segments/TA1.rb +46 -0
  126. data/lib/hippo_eyeDoc/segments/TOO.rb +67 -0
  127. data/lib/hippo_eyeDoc/segments/TRN.rb +39 -0
  128. data/lib/hippo_eyeDoc/segments/TS2.rb +159 -0
  129. data/lib/hippo_eyeDoc/segments/TS3.rb +199 -0
  130. data/lib/hippo_eyeDoc/segments/UR.rb +23 -0
  131. data/lib/hippo_eyeDoc/segments/VEH.rb +159 -0
  132. data/lib/hippo_eyeDoc/segments/base.rb +190 -0
  133. data/lib/hippo_eyeDoc/separator.rb +79 -0
  134. data/lib/hippo_eyeDoc/transaction_sets.rb +16 -0
  135. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270.rb +15 -0
  136. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000A.rb +43 -0
  137. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000B.rb +42 -0
  138. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000C.rb +52 -0
  139. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000D.rb +41 -0
  140. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100A.rb +21 -0
  141. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100B.rb +55 -0
  142. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100C.rb +97 -0
  143. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100D.rb +0 -0
  144. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2110C.rb +67 -0
  145. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2110D.rb +47 -0
  146. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/base.rb +47 -0
  147. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271.rb +19 -0
  148. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000A.rb +55 -0
  149. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000B.rb +43 -0
  150. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000C.rb +52 -0
  151. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000D.rb +41 -0
  152. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100A.rb +43 -0
  153. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100B.rb +67 -0
  154. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100C.rb +124 -0
  155. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100D.rb +124 -0
  156. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2110C.rb +98 -0
  157. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2110D.rb +98 -0
  158. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2115C.rb +16 -0
  159. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2115D.rb +16 -0
  160. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2120C.rb +54 -0
  161. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2120D.rb +54 -0
  162. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/base.rb +47 -0
  163. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276.rb +19 -0
  164. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000A.rb +32 -0
  165. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000B.rb +32 -0
  166. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000C.rb +32 -0
  167. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000D.rb +52 -0
  168. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000E.rb +50 -0
  169. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100A.rb +21 -0
  170. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100B.rb +21 -0
  171. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100C.rb +21 -0
  172. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100D.rb +21 -0
  173. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100E.rb +20 -0
  174. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2200D.rb +117 -0
  175. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2200E.rb +117 -0
  176. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2210D.rb +37 -0
  177. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2210E.rb +37 -0
  178. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/base.rb +90 -0
  179. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277.rb +22 -0
  180. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000A.rb +42 -0
  181. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000B.rb +42 -0
  182. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000C.rb +52 -0
  183. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000D.rb +41 -0
  184. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000E.rb +40 -0
  185. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100A.rb +21 -0
  186. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100B.rb +21 -0
  187. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100C.rb +21 -0
  188. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100D.rb +21 -0
  189. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100E.rb +20 -0
  190. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200A.rb +41 -0
  191. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200B.rb +69 -0
  192. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200C.rb +79 -0
  193. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200D.rb +77 -0
  194. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200E.rb +104 -0
  195. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2220D.rb +57 -0
  196. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2220E.rb +44 -0
  197. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/base.rb +70 -0
  198. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835.rb +10 -0
  199. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L1000A.rb +74 -0
  200. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L1000B.rb +54 -0
  201. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2000.rb +41 -0
  202. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2100.rb +213 -0
  203. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2110.rb +106 -0
  204. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/base.rb +122 -0
  205. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837.rb +43 -0
  206. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L1000A.rb +32 -0
  207. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L1000B.rb +21 -0
  208. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000A.rb +88 -0
  209. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000B.rb +87 -0
  210. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000C.rb +54 -0
  211. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AA.rb +65 -0
  212. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AB.rb +34 -0
  213. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AC.rb +55 -0
  214. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010BA.rb +76 -0
  215. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010BB.rb +55 -0
  216. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010CA.rb +76 -0
  217. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2300.rb +570 -0
  218. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310A.rb +30 -0
  219. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310B.rb +41 -0
  220. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310C.rb +55 -0
  221. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310D.rb +30 -0
  222. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310E.rb +34 -0
  223. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310F.rb +34 -0
  224. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2320.rb +157 -0
  225. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330A.rb +45 -0
  226. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330B.rb +96 -0
  227. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330C.rb +30 -0
  228. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330D.rb +30 -0
  229. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330E.rb +30 -0
  230. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330F.rb +30 -0
  231. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330G.rb +30 -0
  232. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2400.rb +537 -0
  233. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2410.rb +36 -0
  234. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420A.rb +41 -0
  235. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420B.rb +30 -0
  236. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420C.rb +44 -0
  237. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420D.rb +30 -0
  238. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420E.rb +55 -0
  239. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420F.rb +30 -0
  240. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420G.rb +34 -0
  241. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420H.rb +34 -0
  242. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2430.rb +47 -0
  243. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2440.rb +26 -0
  244. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/base.rb +71 -0
  245. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997.rb +7 -0
  246. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/L2000.rb +36 -0
  247. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/L2100.rb +29 -0
  248. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/base.rb +49 -0
  249. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999.rb +8 -0
  250. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2000 - AK2.rb +30 -0
  251. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2000AK2.rb +36 -0
  252. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2100 - AK2.rb +37 -0
  253. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2100AK2.rb +43 -0
  254. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2110 - AK2.rb +23 -0
  255. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2110AK2.rb +26 -0
  256. data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/base.rb +49 -0
  257. data/lib/hippo_eyeDoc/transaction_sets/base.rb +236 -0
  258. data/lib/hippo_eyeDoc/transaction_sets/component.rb +96 -0
  259. data/lib/hippo_eyeDoc/transaction_sets/repeating_component.rb +48 -0
  260. data/lib/hippo_eyeDoc/utilities.rb +37 -0
  261. data/lib/hippo_eyeDoc/version.rb +3 -0
  262. data/samples/005010X221A1_business_scenario_1.edi +1 -0
  263. data/samples/005010X221A1_tmhp_example.edi +1 -0
  264. data/samples/005010X222A1_anesthesia.edi +1 -0
  265. data/samples/005010X222A1_commercial_health_insurance.edi +1 -0
  266. data/samples/005010X231A1_01.edi +11 -0
  267. data/samples/005010X231A1_02.edi +11 -0
  268. data/samples/200823.EDI +22 -0
  269. data/samples/837_L2000A_01.edi +1 -0
  270. data/samples/837_L2000A_02.edi +1 -0
  271. data/samples/parse_277.rb +127 -0
  272. data/samples/parse_999.rb +122 -0
  273. data/samples/sample835.html +1 -0
  274. data/samples/sample835.pretty_string +28 -0
  275. data/samples/sample837.html +1 -0
  276. data/test/test_helper.rb +155 -0
  277. data/test/test_hipaa_835.rb +229 -0
  278. data/test/test_hipaa_837.rb +596 -0
  279. data/test/test_html_outputter.rb +22 -0
  280. data/test/test_parser.rb +138 -0
  281. data/test/test_pretty_string_outputter.rb +33 -0
  282. data/test/test_segments_base.rb +201 -0
  283. data/test/test_transaction_sets_base.rb +122 -0
  284. metadata +356 -0
@@ -0,0 +1,22 @@
1
+ require File.expand_path('test_helper', File.dirname(__FILE__))
2
+
3
+ class TestHTMLOutputter < MiniTest::Unit::TestCase
4
+ def setup
5
+ @parser = Hippo_eyeDoc::Parser.new
6
+ @sample_835 = @parser.parse_file('samples/005010X221A1_business_scenario_1.edi').first
7
+ @sample_837 = @parser.parse_file('samples/005010X231A1_01.edi').first
8
+ end
9
+
10
+ def test_segment_to_html_returns_segment_to_s
11
+ assert_equal @sample_835.BPR.to_s, @sample_835.BPR.to_html
12
+ end
13
+
14
+ def test_transaction_to_html_returns_string
15
+ assert_kind_of String, @sample_835.to_html
16
+ end
17
+
18
+ def test_verify_output_against_known_good_html
19
+ assert_equal File.read('samples/sample835.html'), @sample_835.to_html
20
+ assert_equal File.read('samples/sample837.html'), @sample_837.to_html
21
+ end
22
+ end
@@ -0,0 +1,138 @@
1
+ require File.expand_path('test_helper', File.dirname(__FILE__))
2
+
3
+ class TestParser < MiniTest::Unit::TestCase
4
+ def setup
5
+ @parser = Hippo_eyeDoc::Parser.new
6
+ end
7
+
8
+ def test_parse_returns_array_of_transaction_sets
9
+ transaction_sets = @parser.parse_file('samples/005010X221A1_business_scenario_1.edi')
10
+
11
+ assert_instance_of Array, transaction_sets
12
+
13
+ transaction_sets.each do |ts|
14
+ assert_kind_of Hippo_eyeDoc::TransactionSets::Base, ts
15
+ end
16
+ end
17
+
18
+ def test_raises_error_on_extra_segments
19
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
20
+ ts.ST
21
+ ts.TSS.Field2 = 'Bar'
22
+ ts.TSS.Field3 = 'Baz'
23
+ ts.TCS.Field1 = 'Blah'
24
+ ts.TCS.CompositeCommonName_02 = 'CNBlah'
25
+ ts.TSS_02.Field2 = 'Boo'
26
+
27
+ # test nested block syntax on non-looping component
28
+ ts.L0001.TSS.Field2 = 'SubBar'
29
+
30
+ # test nested block syntax on non-looping component
31
+ ts.L0002 do |l0002|
32
+ l0002.TCS.Field2 = 'SubBarBlah'
33
+ l0002.TSS.Field2 = 'SubBarRepeater'
34
+ end
35
+
36
+ #'TSS*Blah*Bar*Baz~TCS*Blah*:::CNBlah*Preset Field 7~TSS*Last Segment*Boo~TSS*Foo*SubBar~TCS*:SubBarBlah**Foo2~TSS*Last Segment*SubBarRepeater~', ts.to_s
37
+
38
+ ts_result = @parser.parse_string(ts.to_s).first
39
+
40
+ assert_equal ts.values.to_s, ts_result.values.to_s
41
+ end
42
+
43
+ def test_reads_separators_from_isa
44
+ @parser.parse_file('samples/005010X231A1_01.edi')
45
+
46
+ assert_equal '*', @parser.field_separator
47
+ assert_equal '^', @parser.repetition_separator
48
+ assert_equal ':', @parser.composite_separator
49
+ assert_equal '~', @parser.segment_separator
50
+
51
+ @parser = Hippo_eyeDoc::Parser.new
52
+ transaction_set = @parser.parse_file('samples/005010X231A1_02.edi')
53
+
54
+ assert_equal '!', @parser.field_separator
55
+ assert_equal '@', @parser.repetition_separator
56
+ assert_equal '~', @parser.composite_separator
57
+ assert_equal '^', @parser.segment_separator
58
+
59
+ assert_equal transaction_set.first.ST.ST01, '999'
60
+ end
61
+
62
+ def test_adds_enveloping_to_transaction_set
63
+ transaction_set = @parser.parse_file('samples/005010X231A1_01.edi').first
64
+
65
+ assert_equal 445289179, transaction_set.ISA.ISA13
66
+ assert_equal 1, transaction_set.GS.GS06
67
+ end
68
+
69
+ def test_parses_repeating_loops
70
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
71
+ ts.ST
72
+ [1,2,3,4,5].each do |i|
73
+ ts.TSS.build do |tss|
74
+ tss.Field2 = 'Bar' + i.to_s
75
+ tss.Field3 = 'Baz' + i.to_s
76
+ end
77
+ end
78
+
79
+ ts.TCS.Field1 = 'Blah'
80
+ ts.TSS_02.Field2 = 'Boo'
81
+ ts.SE.SE01 = ts.segment_count
82
+
83
+ # ST*Test~TSS*Blah*Bar1*Baz1~TSS*Blah*Bar2*Baz2~TSS*Blah*Bar3*Baz3~TSS*Blah*Bar4*Baz4~TSS*Blah*Bar5*Baz5~TCS*Blah**Preset Field 7~TSS*Last Standalone Segment*Boo~SE**Test
84
+ assert_equal ts.values.to_s, @parser.parse_string(ts.to_s).first.values.to_s
85
+ end
86
+
87
+ def test_parses_partial_transaction_set
88
+ ts_01 = Hippo_eyeDoc::TransactionSets::Test::Base.new
89
+ ts_01.L0002 do |l0002|
90
+ l0002.TCS.Field2 = 'SubBarBlah'
91
+ l0002.TSS.Field2 = 'SubBarRepeater'
92
+ end
93
+
94
+ # TCS*:SubBarBlah**Foo2~TSS*Last Segment*SubBarRepeater~
95
+ ts_02 = Hippo_eyeDoc::TransactionSets::Test::L0002.new
96
+ ts_02.parse(ts_01.to_s)
97
+
98
+ assert_equal ts_01.L0002.values.to_s, ts_02.values.to_s
99
+ end
100
+
101
+ def test_parse_l2000a
102
+ files = ['samples/837_L2000A_01.edi', 'samples/837_L2000A_02.edi']
103
+ files.each do |f|
104
+ l2000a = Hippo_eyeDoc::TransactionSets::HIPAA_837::L2000A.new.parse(File.read(f))
105
+
106
+ # when L2000B HL04 is '0' we must have a L2000C child
107
+ if l2000a.L2000B.HL.HL04 == '0'
108
+ assert_nil l2000a.L2000B.L2000C.HL.HL02
109
+ else
110
+ assert_equal l2000a.L2000B.HL.HL01, l2000a.L2000B.L2000C.HL.HL02
111
+ end
112
+ end
113
+ end
114
+
115
+ def test_same_child_exists_in_multiple_levels
116
+ no_child_loop_string = "TSS*HAS NO CHILD LOOP~TSS*Multiple Parents~"
117
+ ts = Hippo_eyeDoc::TransactionSets::Test::L0004.new
118
+
119
+ ts.parse(no_child_loop_string)
120
+ assert_equal 'TSS*Multiple Parents~', ts.values[1].TSS.to_s
121
+
122
+
123
+ child_loop_string = "TSS*HAS CHILD LOOP~TSS*Multiple Parents~"
124
+ ts = Hippo_eyeDoc::TransactionSets::Test::L0004.new
125
+
126
+ ts.parse(child_loop_string)
127
+ assert_equal 'TSS*Multiple Parents~', ts.values[2].to_s
128
+ end
129
+
130
+ def test_strips_leading_whitespace_from_segment_identifier
131
+ initial_string = " ST*Test~\n TSS*Blah*BOOM~"
132
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
133
+
134
+ ts.parse(initial_string)
135
+
136
+ assert_equal ts.TSS.TSS02, 'BOOM'
137
+ end
138
+ end
@@ -0,0 +1,33 @@
1
+ require File.expand_path('test_helper', File.dirname(__FILE__))
2
+
3
+ class TestPrettyStringOutputter < MiniTest::Unit::TestCase
4
+ def setup
5
+ @ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
6
+ @ts.parse('ST*Test~TSS*Blah*Bar*Baz~TCS*Blah*:::CNBlah*Preset Field 7~TSS*Last Standalone Segment*Boo~TSS*Foo*SubBar~TCS*:SubBarBlah**Foo2~TSS*Last Segment*SubBarRepeater~')
7
+ end
8
+
9
+ def test_segment_to_pretty_string_returns_segment_to_s
10
+ assert_equal @ts.TSS.to_s + "\n", @ts.TSS.to_pretty_string
11
+ end
12
+
13
+ def test_transaction_to_pretty_string_returns_proper_value
14
+ expected_output = <<-EOF
15
+ ST*Test~
16
+ TSS*Blah*Bar*Baz~
17
+ TCS*Blah*:::CNBlah*Preset Field 7~
18
+ TSS*Last Standalone Segment*Boo~
19
+ TSS*Foo*SubBar~
20
+ TCS*:SubBarBlah**Foo2~
21
+ TSS*Last Segment*SubBarRepeater~
22
+ EOF
23
+
24
+ assert_equal expected_output, @ts.to_pretty_string
25
+ end
26
+
27
+ def test_sample835_output
28
+ sample_835 = Hippo_eyeDoc::TransactionSets::HIPAA_835::Base.new
29
+ sample_835.parse(File.read('samples/005010X221A1_business_scenario_1.edi'))
30
+
31
+ assert_equal File.read('samples/sample835.pretty_string'), sample_835.to_pretty_string
32
+ end
33
+ end
@@ -0,0 +1,201 @@
1
+ require File.expand_path('test_helper', File.dirname(__FILE__))
2
+
3
+ class TestSegmentsBase < MiniTest::Unit::TestCase
4
+ def setup; end;
5
+ def teardown; end;
6
+
7
+ def test_empty_segment
8
+ seg = Hippo_eyeDoc::Segments::TSS.new
9
+
10
+ assert_equal '', seg.to_s
11
+ end
12
+
13
+ def test_basic_populated_segment
14
+ seg = Hippo_eyeDoc::Segments::TSS.new
15
+
16
+ seg.Field1 = 'TestField1'
17
+ seg.Field2 = 'TestField2'
18
+ seg.Field3 = 'TestField3'
19
+ seg.Field4 = 'TestField4'
20
+
21
+ assert_equal 'TSS*TestField1*TestField2*TestField3*TestField4~', seg.to_s
22
+ end
23
+
24
+ def test_empty_field_in_segment
25
+ seg = Hippo_eyeDoc::Segments::TSS.new
26
+
27
+ seg.Field2 = 'TestField2'
28
+ seg.Field3 = 'TestField3'
29
+ seg.Field4 = 'TestField4'
30
+
31
+ assert_equal 'TSS**TestField2*TestField3*TestField4~', seg.to_s
32
+
33
+ seg = Hippo_eyeDoc::Segments::TSS.new
34
+
35
+ seg.Field2 = 'TestField2'
36
+
37
+ assert_equal 'TSS**TestField2~', seg.to_s
38
+ end
39
+
40
+ def test_segment_orders_properly
41
+ seg = Hippo_eyeDoc::Segments::TSS.new
42
+
43
+ seg.Field3 = 'TestField3'
44
+ seg.Field2 = 'TestField2'
45
+ seg.Field1 = 'TestField1'
46
+ seg.Field4 = 'TestField4'
47
+
48
+ assert_equal 'TSS*TestField1*TestField2*TestField3*TestField4~', seg.to_s
49
+ end
50
+
51
+ def test_assign_values_with_same_field_names
52
+ seg = Hippo_eyeDoc::Segments::TSS.new
53
+ seg.CommonName = 'Value1'
54
+ seg.CommonName_02 = 'Value2'
55
+
56
+ assert_equal 'TSS*****Value1*Value2~', seg.to_s
57
+
58
+ seg.CommonName_01 = 'Value3'
59
+ seg.CommonName_02 = 'Value4'
60
+
61
+ assert_equal 'TSS*****Value3*Value4~', seg.to_s
62
+ end
63
+
64
+ def test_compound_segment
65
+ seg = Hippo_eyeDoc::Segments::TCS.new
66
+
67
+ seg.Field1 = 'Comp1Field1'
68
+ seg.Field2 = 'Comp1Field2'
69
+
70
+ assert_equal 'TCS*Comp1Field1:Comp1Field2~', seg.to_s
71
+
72
+ seg.Field7 = 'Field7'
73
+
74
+ assert_equal 'TCS*Comp1Field1:Comp1Field2**Field7~', seg.to_s
75
+ end
76
+
77
+ def test_compound_segment_with_empty_initial_fields
78
+ seg = Hippo_eyeDoc::Segments::TCS.new
79
+
80
+ seg.Field2 = 'Comp1Field2'
81
+
82
+ assert_equal 'TCS*:Comp1Field2~', seg.to_s
83
+ end
84
+
85
+ def test_compound_segment_assign_values_with_same_field_names
86
+
87
+ seg = Hippo_eyeDoc::Segments::TCS.new
88
+
89
+ seg.CompositeCommonName = 'CompVal1'
90
+ seg.CompositeCommonName_02 = 'CompVal2'
91
+
92
+ assert_equal 'TCS*:::CompVal1*:::CompVal2~', seg.to_s
93
+
94
+ seg.CompositeCommonName_1 = 'CompVal3'
95
+ seg.CompositeCommonName_2 = 'CompVal4'
96
+
97
+ assert_equal 'TCS*:::CompVal3*:::CompVal4~', seg.to_s
98
+
99
+ seg.TCS01_04 = 'CompVal5'
100
+ seg.TCS02_04 = 'CompVal6'
101
+
102
+ assert_equal 'TCS*:::CompVal5*:::CompVal6~', seg.to_s
103
+
104
+ assert_equal 'CompVal5', seg.TCS01_04
105
+ end
106
+
107
+ def test_assign_invalid_field_throws_error
108
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidField) do
109
+ seg = Hippo_eyeDoc::Segments::NM1.new
110
+ seg.InvalidField = 'Error should be raised.'
111
+ end
112
+ end
113
+
114
+ def test_raises_invalid_value_for_date_fields
115
+ seg = Hippo_eyeDoc::Segments::TSS.new
116
+
117
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidValue) { seg.DateField = "asdf" }
118
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidValue) { seg.DateField = "0810" }
119
+
120
+ seg.DateField = Date.today
121
+ seg.DateField = "20120120"
122
+ seg.DateField = Time.now
123
+ seg.DateField = nil
124
+ end
125
+
126
+ def test_raises_invalid_value_for_time_fields
127
+ seg = Hippo_eyeDoc::Segments::TSS.new
128
+
129
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidValue) { seg.TimeField = "asdf" }
130
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidValue) { seg.TimeField = "25111201" }
131
+ assert_raises(Hippo_eyeDoc::Exceptions::InvalidValue) { seg.TimeField = Date.today }
132
+
133
+ seg.TimeField = "0120"
134
+ seg.TimeField = Time.now
135
+ seg.TimeField = nil
136
+ end
137
+
138
+ def test_performs_type_conversion
139
+ seg = Hippo_eyeDoc::Segments::TSS.new
140
+
141
+ seg.DateField = '20120121'
142
+ assert_equal Date.new(2012,01,21), seg.DateField
143
+
144
+ seg.TimeField = '231101'
145
+ assert_equal Time.new(Date.today.year, Date.today.month, Date.today.day, 23,11,01), seg.TimeField
146
+
147
+ seg.IntegerField = '2'
148
+ assert_equal 2, seg.IntegerField
149
+
150
+ seg.DecimalField = '123.45'
151
+ assert_equal BigDecimal.new('123.45'), seg.DecimalField
152
+
153
+ assert_equal 'TSS*******20120121*231101*2*123.45~', seg.to_s
154
+ end
155
+
156
+ def test_fixed_width_segment
157
+ isa = Hippo_eyeDoc::Segments::ISA.new
158
+
159
+ assert_equal "ISA* *#{' ' * 10}* *#{' ' * 10}* *#{' ' * 15}* *#{' ' * 15}*#{Date.today.strftime('%y%m%d')}*#{Time.now.strftime('%H%M')}* * *#{'0' * 9}* * * ~", isa.to_s
160
+
161
+ isa.AuthorizationInformationQualifier = '00'
162
+ isa.SecurityInformationQualifier = '00'
163
+ isa.InterchangeIdQualifier_01 = 'ZZ'
164
+ isa.InterchangeSenderId = '593208085'
165
+ isa.InterchangeIdQualifier_02 = 'ZZ'
166
+ isa.InterchangeReceiverId = 'OVERRIDE'
167
+ isa.InterchangeDate = Time.now
168
+ isa.InterchangeTime = Time.now
169
+ isa.RepetitionSeparator = Hippo_eyeDoc::DEFAULT_REPETITION_SEPARATOR
170
+ isa.InterchangeControlVersionNumber = '00501'
171
+ isa.InterchangeControlNumber = 12345
172
+ isa.AcknowledgmentRequested = '1'
173
+ isa.InterchangeUsageIndicator = 'T'
174
+ isa.ComponentElementSeparator = Hippo_eyeDoc::DEFAULT_COMPOSITE_SEPARATOR
175
+
176
+ assert_equal "ISA*00* *00* *ZZ*593208085 *ZZ*OVERRIDE *#{Date.today.strftime('%y%m%d')}*#{Time.now.strftime('%H%M')}*^*00501*000012345*1*T*:~", isa.to_s
177
+ end
178
+
179
+ def test_access_empty_composite_returns_nil
180
+ seg = Hippo_eyeDoc::Segments::TCS.new
181
+
182
+ assert_equal nil, seg.TCS01_01
183
+ end
184
+
185
+ def test_segment_parse_for_composite_fields
186
+ input_string = "STC*A7:755:87*20121127*U*2200******A3:448**REJECTED AT CLEARINGHOUSE PAY-TO PROVIDER PRIMARY ID# IS NOT USED (1235196510) (59141)"
187
+ seg = Hippo_eyeDoc::Segments::STC.new.parse(input_string)
188
+ assert_equal input_string + '~', seg.to_s
189
+ end
190
+
191
+ def test_empty_fields_are_removed
192
+ n1 = Hippo_eyeDoc::Segments::N1.new.parse("N1*PE* *XX*1234567890")
193
+ assert_equal "N1*PE**XX*1234567890~", n1.to_s
194
+ end
195
+
196
+ def test_remove_empty_fields_doesnt_change_populated_fields
197
+ original = "N1*PE*SOME RANDOM NAME HERE*XX*1234567890"
198
+ n1 = Hippo_eyeDoc::Segments::N1.new.parse(original)
199
+ assert_equal original + '~', n1.to_s
200
+ end
201
+ end
@@ -0,0 +1,122 @@
1
+ require File.expand_path('test_helper', File.dirname(__FILE__))
2
+
3
+ class TestTransactionSetBase < MiniTest::Unit::TestCase
4
+ def test_preset_values_are_set
5
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
6
+ ts.TCS
7
+ ts.TSS.build
8
+
9
+ assert_equal 'TSS*Blah~TCS***Preset Field 7~', ts.to_s
10
+ end
11
+
12
+ def test_segment_ordering_is_correct
13
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
14
+ ts.TCS.Field1 = 'Foo'
15
+ ts.TSS.Field2 = 'Bar'
16
+
17
+ assert_equal 'TSS*Blah*Bar~TCS*Foo**Preset Field 7~', ts.to_s
18
+ end
19
+
20
+ def test_raises_error_on_invalid_segment
21
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
22
+ assert_raises Hippo_eyeDoc::Exceptions::InvalidSegment do
23
+ ts.BLAH {|blah| }
24
+ end
25
+ end
26
+
27
+ def test_identified_by_values_are_set
28
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
29
+ ts.L0001 {|l0001| }
30
+
31
+ assert_equal 'TSS*Foo~', ts.to_s
32
+ end
33
+
34
+ def test_accessing_segments_with_same_segment_id
35
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
36
+ ts.TSS.Field2 = 'Bar'
37
+ ts.TCS.Field1 = 'Foo'
38
+ ts.TSS_02.Field2 = 'Baz'
39
+
40
+ assert_equal 'TSS*Blah*Bar~TCS*Foo**Preset Field 7~TSS*Last Standalone Segment*Baz~', ts.to_s
41
+ end
42
+
43
+ def test_accessing_segments_by_name
44
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
45
+ ts.find_by_name('Test Simple Segment #1') do |tss|
46
+ tss.Field2 = 'Baz'
47
+ end
48
+
49
+ assert_equal 'TSS*Blah*Baz~', ts.to_s
50
+ end
51
+
52
+ def test_accessing_segments_by_name_regexp
53
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
54
+ ts.find_by_name(/Segment/) do |tss|
55
+ tss.Field2 = 'Baz'
56
+ end
57
+
58
+ assert_equal 'TSS*Blah*Baz~', ts.to_s
59
+ end
60
+
61
+ def test_assigning_segment_values_with_block_syntax
62
+ ts = Hippo_eyeDoc::TransactionSets::Test::Base.new
63
+
64
+ ts.TSS do |tss|
65
+ tss.Field2 = 'Bar'
66
+ tss.Field3 = 'Baz'
67
+ end
68
+
69
+ ts.TCS do |tcs|
70
+ tcs.Field1 = 'Blah'
71
+ tcs.CompositeCommonName_02 = 'CNBlah'
72
+ end
73
+
74
+ ts.TSS_02 do |tss|
75
+ tss.Field2 = 'Boo'
76
+ end
77
+
78
+ assert_equal 'TSS*Blah*Bar*Baz~TCS*Blah*:::CNBlah*Preset Field 7~TSS*Last Standalone Segment*Boo~', ts.to_s
79
+
80
+ # test nexted block syntax on non-looping component
81
+ ts.L0001 do |l0001|
82
+ l0001.TSS do |tss|
83
+ tss.Field2 = 'SubBar'
84
+ end
85
+ end
86
+
87
+ assert_equal 'TSS*Blah*Bar*Baz~TCS*Blah*:::CNBlah*Preset Field 7~TSS*Last Standalone Segment*Boo~TSS*Foo*SubBar~', ts.to_s
88
+
89
+ # test nexted block syntax on non-looping component
90
+ ts.L0002 do |l0002|
91
+ l0002.TCS do |tcs|
92
+ tcs.Field2 = 'SubBarBlah'
93
+ end
94
+
95
+ l0002.TSS do |tss|
96
+ tss.Field2 = 'SubBarRepeater'
97
+ end
98
+ end
99
+
100
+ assert_equal 'TSS*Blah*Bar*Baz~TCS*Blah*:::CNBlah*Preset Field 7~TSS*Last Standalone Segment*Boo~TSS*Foo*SubBar~TCS*:SubBarBlah**Foo2~TSS*Last Segment*SubBarRepeater~', ts.to_s
101
+ end
102
+
103
+ def test_intializing_with_segment_array_populates_transaction_set
104
+ tss = Hippo_eyeDoc::Segments::TSS.new
105
+ tss.TSS01 = 'Blah'
106
+
107
+ tcs = Hippo_eyeDoc::Segments::TCS.new
108
+ tcs.Field7 = 'Preset Field 7'
109
+
110
+ tss2 = Hippo_eyeDoc::Segments::TSS.new
111
+ tss2.TSS01 = 'Last Standalone Segment'
112
+
113
+ # start L0001 segments
114
+ tss3 = Hippo_eyeDoc::Segments::TSS.new
115
+ tss3.TSS01 = 'Foo'
116
+
117
+ segment_array = [tss, tcs, tss2, tss3]
118
+
119
+ assert_equal segment_array.map(&:to_s).join, Hippo_eyeDoc::TransactionSets::Test::Base.new(:segments => segment_array).to_s
120
+ assert_empty segment_array
121
+ end
122
+ end