stupidedi 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (500) hide show
  1. data/README.md +215 -0
  2. data/Rakefile +108 -0
  3. data/bin/edi-ed +71 -0
  4. data/bin/edi-pp +81 -0
  5. data/doc/Defining.md +0 -0
  6. data/doc/Generating.md +321 -0
  7. data/doc/LICENSE.md +0 -0
  8. data/doc/Navigating.md +645 -0
  9. data/doc/Parsing.md +0 -0
  10. data/doc/Serializing.md +7 -0
  11. data/doc/Tokenizing.md +0 -0
  12. data/doc/Validating.md +0 -0
  13. data/doc/design/Parser.md +0 -0
  14. data/doc/design/Reader.md +0 -0
  15. data/lib/ruby/array.rb +164 -0
  16. data/lib/ruby/blank.rb +67 -0
  17. data/lib/ruby/enumerable.rb +35 -0
  18. data/lib/ruby/exception.rb +33 -0
  19. data/lib/ruby/hash.rb +4 -0
  20. data/lib/ruby/instance_exec.rb +26 -0
  21. data/lib/ruby/module.rb +79 -0
  22. data/lib/ruby/object.rb +63 -0
  23. data/lib/ruby/string.rb +73 -0
  24. data/lib/ruby/symbol.rb +24 -0
  25. data/lib/ruby/to_d.rb +81 -0
  26. data/lib/ruby/to_date.rb +33 -0
  27. data/lib/ruby/to_time.rb +24 -0
  28. data/lib/ruby/try.rb +43 -0
  29. data/lib/stupidedi/blank_slate.rb +11 -0
  30. data/lib/stupidedi/builder/builder_dsl.rb +281 -0
  31. data/lib/stupidedi/builder/constraint_table.rb +418 -0
  32. data/lib/stupidedi/builder/generation.rb +112 -0
  33. data/lib/stupidedi/builder/instruction.rb +102 -0
  34. data/lib/stupidedi/builder/instruction_table.rb +204 -0
  35. data/lib/stupidedi/builder/navigation.rb +655 -0
  36. data/lib/stupidedi/builder/state_machine.rb +55 -0
  37. data/lib/stupidedi/builder/states/abstract_state.rb +332 -0
  38. data/lib/stupidedi/builder/states/failure_state.rb +69 -0
  39. data/lib/stupidedi/builder/states/functional_group_state.rb +97 -0
  40. data/lib/stupidedi/builder/states/initial_state.rb +63 -0
  41. data/lib/stupidedi/builder/states/interchange_state.rb +94 -0
  42. data/lib/stupidedi/builder/states/loop_state.rb +79 -0
  43. data/lib/stupidedi/builder/states/table_state.rb +96 -0
  44. data/lib/stupidedi/builder/states/transaction_set_state.rb +112 -0
  45. data/lib/stupidedi/builder/states/transmission_state.rb +59 -0
  46. data/lib/stupidedi/builder/tokenization.rb +196 -0
  47. data/lib/stupidedi/builder.rb +23 -0
  48. data/lib/stupidedi/color.rb +93 -0
  49. data/lib/stupidedi/config/code_list_config.rb +42 -0
  50. data/lib/stupidedi/config/editor_config.rb +51 -0
  51. data/lib/stupidedi/config/functional_group_config.rb +62 -0
  52. data/lib/stupidedi/config/interchange_config.rb +79 -0
  53. data/lib/stupidedi/config/transaction_set_config.rb +91 -0
  54. data/lib/stupidedi/config.rb +101 -0
  55. data/lib/stupidedi/editor/00501.rb +341 -0
  56. data/lib/stupidedi/editor/005010/N2.rb +0 -0
  57. data/lib/stupidedi/editor/005010/N3.rb +0 -0
  58. data/lib/stupidedi/editor/005010/N4.rb +63 -0
  59. data/lib/stupidedi/editor/005010/NM1.rb +0 -0
  60. data/lib/stupidedi/editor/005010.rb +469 -0
  61. data/lib/stupidedi/editor/X222-HC837.rb +195 -0
  62. data/lib/stupidedi/editor/abstract_ed.rb +36 -0
  63. data/lib/stupidedi/editor/claim_ack.rb +9 -0
  64. data/lib/stupidedi/editor/implementation_ack.rb +213 -0
  65. data/lib/stupidedi/editor/interchange_ack.rb +9 -0
  66. data/lib/stupidedi/editor/result.rb +100 -0
  67. data/lib/stupidedi/editor/result_set.rb +69 -0
  68. data/lib/stupidedi/editor/transaction_set_ed.rb +275 -0
  69. data/lib/stupidedi/editor/transmission_ed.rb +90 -0
  70. data/lib/stupidedi/editor.rb +37 -0
  71. data/lib/stupidedi/either.rb +287 -0
  72. data/lib/stupidedi/exceptions/invalid_element_error.rb +8 -0
  73. data/lib/stupidedi/exceptions/invalid_schema_error.rb +8 -0
  74. data/lib/stupidedi/exceptions/output_error.rb +8 -0
  75. data/lib/stupidedi/exceptions/parse_error.rb +8 -0
  76. data/lib/stupidedi/exceptions/stupidedi_error.rb +8 -0
  77. data/lib/stupidedi/exceptions/tokenize_error.rb +8 -0
  78. data/lib/stupidedi/exceptions/zipper_error.rb +8 -0
  79. data/lib/stupidedi/exceptions.rb +11 -0
  80. data/lib/stupidedi/guides/005010/X214-HN277.rb +409 -0
  81. data/lib/stupidedi/guides/005010/X221-HP835.rb +613 -0
  82. data/lib/stupidedi/guides/005010/X221A1-HP835.rb +613 -0
  83. data/lib/stupidedi/guides/005010/X222-HC837P.rb +2291 -0
  84. data/lib/stupidedi/guides/005010/X222A1-HC837P.rb +2297 -0
  85. data/lib/stupidedi/guides/005010/X231-FA999.rb +123 -0
  86. data/lib/stupidedi/guides/005010/X231A1-FA999.rb +119 -0
  87. data/lib/stupidedi/guides/005010/element_reqs.rb +38 -0
  88. data/lib/stupidedi/guides/005010/guide_builder.rb +180 -0
  89. data/lib/stupidedi/guides/005010/segment_reqs.rb +32 -0
  90. data/lib/stupidedi/guides/005010.rb +64 -0
  91. data/lib/stupidedi/guides.rb +5 -0
  92. data/lib/stupidedi/inspect.rb +26 -0
  93. data/lib/stupidedi/reader/input/abstract_input.rb +133 -0
  94. data/lib/stupidedi/reader/input/delegated_input.rb +111 -0
  95. data/lib/stupidedi/reader/input/file_input.rb +155 -0
  96. data/lib/stupidedi/reader/input.rb +30 -0
  97. data/lib/stupidedi/reader/position.rb +69 -0
  98. data/lib/stupidedi/reader/result.rb +168 -0
  99. data/lib/stupidedi/reader/segment_dict.rb +175 -0
  100. data/lib/stupidedi/reader/separators.rb +85 -0
  101. data/lib/stupidedi/reader/stream_reader.rb +172 -0
  102. data/lib/stupidedi/reader/token_reader.rb +466 -0
  103. data/lib/stupidedi/reader/tokens/component_element_tok.rb +56 -0
  104. data/lib/stupidedi/reader/tokens/composite_element_tok.rb +64 -0
  105. data/lib/stupidedi/reader/tokens/repeated_element_tok.rb +64 -0
  106. data/lib/stupidedi/reader/tokens/segment_tok.rb +51 -0
  107. data/lib/stupidedi/reader/tokens/simple_element_tok.rb +63 -0
  108. data/lib/stupidedi/reader.rb +121 -0
  109. data/lib/stupidedi/schema/abstract_def.rb +74 -0
  110. data/lib/stupidedi/schema/abstract_use.rb +73 -0
  111. data/lib/stupidedi/schema/code_list.rb +94 -0
  112. data/lib/stupidedi/schema/element_def.rb +173 -0
  113. data/lib/stupidedi/schema/element_req.rb +56 -0
  114. data/lib/stupidedi/schema/element_use.rb +251 -0
  115. data/lib/stupidedi/schema/functional_group_def.rb +114 -0
  116. data/lib/stupidedi/schema/interchange_def.rb +93 -0
  117. data/lib/stupidedi/schema/loop_def.rb +152 -0
  118. data/lib/stupidedi/schema/repeat_count.rb +85 -0
  119. data/lib/stupidedi/schema/segment_def.rb +108 -0
  120. data/lib/stupidedi/schema/segment_req.rb +43 -0
  121. data/lib/stupidedi/schema/segment_use.rb +98 -0
  122. data/lib/stupidedi/schema/syntax_note.rb +63 -0
  123. data/lib/stupidedi/schema/table_def.rb +139 -0
  124. data/lib/stupidedi/schema/transaction_set_def.rb +88 -0
  125. data/lib/stupidedi/schema.rb +28 -0
  126. data/lib/stupidedi/sets/absolute_set.rb +297 -0
  127. data/lib/stupidedi/sets/abstract_set.rb +174 -0
  128. data/lib/stupidedi/sets/null_set.rb +125 -0
  129. data/lib/stupidedi/sets/relative_complement.rb +137 -0
  130. data/lib/stupidedi/sets/relative_set.rb +269 -0
  131. data/lib/stupidedi/sets/universal_set.rb +104 -0
  132. data/lib/stupidedi/sets.rb +57 -0
  133. data/lib/stupidedi/tail_call.rb +109 -0
  134. data/lib/stupidedi/thread_local.rb +174 -0
  135. data/lib/stupidedi/values/abstract_element_val.rb +19 -0
  136. data/lib/stupidedi/values/abstract_val.rb +130 -0
  137. data/lib/stupidedi/values/composite_element_val.rb +95 -0
  138. data/lib/stupidedi/values/functional_group_val.rb +102 -0
  139. data/lib/stupidedi/values/interchange_val.rb +86 -0
  140. data/lib/stupidedi/values/invalid_envelope_val.rb +61 -0
  141. data/lib/stupidedi/values/invalid_segment_val.rb +78 -0
  142. data/lib/stupidedi/values/loop_val.rb +70 -0
  143. data/lib/stupidedi/values/repeated_element_val.rb +105 -0
  144. data/lib/stupidedi/values/segment_val.rb +104 -0
  145. data/lib/stupidedi/values/segment_val_group.rb +20 -0
  146. data/lib/stupidedi/values/simple_element_val.rb +80 -0
  147. data/lib/stupidedi/values/table_val.rb +66 -0
  148. data/lib/stupidedi/values/transaction_set_val.rb +66 -0
  149. data/lib/stupidedi/values/transmission_val.rb +52 -0
  150. data/lib/stupidedi/values.rb +21 -0
  151. data/lib/stupidedi/version.rb +3 -0
  152. data/lib/stupidedi/versions/functional_groups/004010/element_defs.rb +54 -0
  153. data/lib/stupidedi/versions/functional_groups/004010/element_reqs.rb +18 -0
  154. data/lib/stupidedi/versions/functional_groups/004010/element_types/date_val.rb +527 -0
  155. data/lib/stupidedi/versions/functional_groups/004010/element_types/fixnum_val.rb +335 -0
  156. data/lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb +299 -0
  157. data/lib/stupidedi/versions/functional_groups/004010/element_types/identifier_val.rb +287 -0
  158. data/lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb +338 -0
  159. data/lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb +309 -0
  160. data/lib/stupidedi/versions/functional_groups/004010/element_types.rb +124 -0
  161. data/lib/stupidedi/versions/functional_groups/004010/functional_group_def.rb +30 -0
  162. data/lib/stupidedi/versions/functional_groups/004010/segment_defs/GE.rb +20 -0
  163. data/lib/stupidedi/versions/functional_groups/004010/segment_defs/GS.rb +27 -0
  164. data/lib/stupidedi/versions/functional_groups/004010/segment_defs/SE.rb +20 -0
  165. data/lib/stupidedi/versions/functional_groups/004010/segment_defs/ST.rb +20 -0
  166. data/lib/stupidedi/versions/functional_groups/004010/segment_defs.rb +23 -0
  167. data/lib/stupidedi/versions/functional_groups/004010/segment_reqs.rb +18 -0
  168. data/lib/stupidedi/versions/functional_groups/004010/syntax_notes.rb +174 -0
  169. data/lib/stupidedi/versions/functional_groups/004010.rb +38 -0
  170. data/lib/stupidedi/versions/functional_groups/005010/element_defs.rb +1405 -0
  171. data/lib/stupidedi/versions/functional_groups/005010/element_reqs.rb +18 -0
  172. data/lib/stupidedi/versions/functional_groups/005010/element_types/date_val.rb +577 -0
  173. data/lib/stupidedi/versions/functional_groups/005010/element_types/fixnum_val.rb +322 -0
  174. data/lib/stupidedi/versions/functional_groups/005010/element_types/float_val.rb +354 -0
  175. data/lib/stupidedi/versions/functional_groups/005010/element_types/identifier_val.rb +368 -0
  176. data/lib/stupidedi/versions/functional_groups/005010/element_types/operators.rb +117 -0
  177. data/lib/stupidedi/versions/functional_groups/005010/element_types/string_val.rb +398 -0
  178. data/lib/stupidedi/versions/functional_groups/005010/element_types/time_val.rb +327 -0
  179. data/lib/stupidedi/versions/functional_groups/005010/element_types.rb +132 -0
  180. data/lib/stupidedi/versions/functional_groups/005010/functional_group_def.rb +30 -0
  181. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AK1.rb +21 -0
  182. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AK2.rb +21 -0
  183. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AK9.rb +28 -0
  184. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AMT.rb +21 -0
  185. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/BHT.rb +24 -0
  186. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/BPR.rb +49 -0
  187. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CAS.rb +56 -0
  188. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CL1.rb +22 -0
  189. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CLM.rb +41 -0
  190. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CLP.rb +34 -0
  191. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CN1.rb +24 -0
  192. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CR1.rb +32 -0
  193. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CR2.rb +35 -0
  194. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CR3.rb +25 -0
  195. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CRC.rb +26 -0
  196. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CTP.rb +36 -0
  197. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CTX.rb +24 -0
  198. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/CUR.rb +57 -0
  199. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DMG.rb +34 -0
  200. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DN1.rb +22 -0
  201. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DN2.rb +24 -0
  202. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DTM.rb +24 -0
  203. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DTP.rb +21 -0
  204. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/FRM.rb +25 -0
  205. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/GE.rb +20 -0
  206. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/GS.rb +27 -0
  207. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HCP.rb +39 -0
  208. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HI.rb +31 -0
  209. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HL.rb +22 -0
  210. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/IK3.rb +22 -0
  211. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/IK4.rb +22 -0
  212. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/IK5.rb +24 -0
  213. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/K3.rb +21 -0
  214. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LIN.rb +69 -0
  215. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LQ.rb +22 -0
  216. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LX.rb +19 -0
  217. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MEA.rb +39 -0
  218. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MIA.rb +45 -0
  219. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MOA.rb +28 -0
  220. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/N1.rb +24 -0
  221. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/N2.rb +20 -0
  222. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/N3.rb +20 -0
  223. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/N4.rb +30 -0
  224. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/NM1.rb +35 -0
  225. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/NTE.rb +20 -0
  226. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/OI.rb +24 -0
  227. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PAT.rb +31 -0
  228. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PER.rb +32 -0
  229. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PLB.rb +40 -0
  230. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PRV.rb +26 -0
  231. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PS1.rb +21 -0
  232. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PWK.rb +30 -0
  233. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/QTY.rb +25 -0
  234. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/RDM.rb +23 -0
  235. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/REF.rb +23 -0
  236. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SBR.rb +28 -0
  237. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SE.rb +20 -0
  238. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/ST.rb +21 -0
  239. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/STC.rb +30 -0
  240. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SV1.rb +44 -0
  241. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SV2.rb +29 -0
  242. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SV3.rb +30 -0
  243. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SV5.rb +29 -0
  244. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SVC.rb +26 -0
  245. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/SVD.rb +24 -0
  246. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/TOO.rb +21 -0
  247. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/TRN.rb +22 -0
  248. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/TS2.rb +40 -0
  249. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/TS3.rb +45 -0
  250. data/lib/stupidedi/versions/functional_groups/005010/segment_defs.rb +227 -0
  251. data/lib/stupidedi/versions/functional_groups/005010/segment_reqs.rb +18 -0
  252. data/lib/stupidedi/versions/functional_groups/005010/syntax_notes.rb +165 -0
  253. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/FA999.rb +38 -0
  254. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HB271.rb +85 -0
  255. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HC837.rb +163 -0
  256. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HI278.rb +64 -0
  257. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HN277.rb +74 -0
  258. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HP835.rb +68 -0
  259. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HR276.rb +57 -0
  260. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HS270.rb +53 -0
  261. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/RA820.rb +240 -0
  262. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs.rb +68 -0
  263. data/lib/stupidedi/versions/functional_groups/005010.rb +38 -0
  264. data/lib/stupidedi/versions/functional_groups.rb +8 -0
  265. data/lib/stupidedi/versions/interchanges/00401/element_defs.rb +224 -0
  266. data/lib/stupidedi/versions/interchanges/00401/interchange_def.rb +45 -0
  267. data/lib/stupidedi/versions/interchanges/00401/segment_defs/IEA.rb +20 -0
  268. data/lib/stupidedi/versions/interchanges/00401/segment_defs/ISA.rb +34 -0
  269. data/lib/stupidedi/versions/interchanges/00401/segment_defs/TA1.rb +23 -0
  270. data/lib/stupidedi/versions/interchanges/00401/segment_defs.rb +28 -0
  271. data/lib/stupidedi/versions/interchanges/00401.rb +23 -0
  272. data/lib/stupidedi/versions/interchanges/00501/element_defs.rb +269 -0
  273. data/lib/stupidedi/versions/interchanges/00501/interchange_def.rb +47 -0
  274. data/lib/stupidedi/versions/interchanges/00501/segment_defs/IEA.rb +20 -0
  275. data/lib/stupidedi/versions/interchanges/00501/segment_defs/ISA.rb +34 -0
  276. data/lib/stupidedi/versions/interchanges/00501/segment_defs/ISB.rb +18 -0
  277. data/lib/stupidedi/versions/interchanges/00501/segment_defs/ISE.rb +18 -0
  278. data/lib/stupidedi/versions/interchanges/00501/segment_defs/TA1.rb +23 -0
  279. data/lib/stupidedi/versions/interchanges/00501/segment_defs/TA3.rb +18 -0
  280. data/lib/stupidedi/versions/interchanges/00501/segment_defs.rb +37 -0
  281. data/lib/stupidedi/versions/interchanges/00501.rb +23 -0
  282. data/lib/stupidedi/versions/interchanges.rb +8 -0
  283. data/lib/stupidedi/versions.rb +6 -0
  284. data/lib/stupidedi/writer/claredi.rb +142 -0
  285. data/lib/stupidedi/writer/default.rb +124 -0
  286. data/lib/stupidedi/writer.rb +6 -0
  287. data/lib/stupidedi/zipper/abstract_cursor.rb +351 -0
  288. data/lib/stupidedi/zipper/dangling_cursor.rb +103 -0
  289. data/lib/stupidedi/zipper/edited_cursor.rb +157 -0
  290. data/lib/stupidedi/zipper/memoized_cursor.rb +131 -0
  291. data/lib/stupidedi/zipper/path.rb +124 -0
  292. data/lib/stupidedi/zipper/root_cursor.rb +120 -0
  293. data/lib/stupidedi/zipper.rb +25 -0
  294. data/lib/stupidedi.rb +66 -0
  295. data/spec/examples/integration/generating.example +551 -0
  296. data/spec/examples/integration/navigating.example +214 -0
  297. data/spec/examples/integration/parsing.example +445 -0
  298. data/spec/examples/ruby/array.example +476 -0
  299. data/spec/examples/ruby/blank.example +62 -0
  300. data/spec/examples/ruby/count.example +68 -0
  301. data/spec/examples/ruby/object.example +99 -0
  302. data/spec/examples/ruby/string.example +111 -0
  303. data/spec/examples/ruby/symbol.example +117 -0
  304. data/spec/examples/ruby/to_d.example +90 -0
  305. data/spec/examples/ruby/try.example +50 -0
  306. data/spec/examples/stupidedi/either.example +375 -0
  307. data/spec/examples/stupidedi/reader/failure.example +68 -0
  308. data/spec/examples/stupidedi/reader/input/delegated_input.example +292 -0
  309. data/spec/examples/stupidedi/reader/separators.example +73 -0
  310. data/spec/examples/stupidedi/reader/stream_reader.example +48 -0
  311. data/spec/examples/stupidedi/reader/success.example +34 -0
  312. data/spec/examples/stupidedi/reader/token_reader.example +775 -0
  313. data/spec/examples/stupidedi/reader.example +168 -0
  314. data/spec/examples/stupidedi/sets/absolute_set.example +1577 -0
  315. data/spec/examples/stupidedi/sets/null_set.example +2 -0
  316. data/spec/examples/stupidedi/sets/relative_set.example +2 -0
  317. data/spec/examples/stupidedi/sets/universal_set.example +1 -0
  318. data/spec/examples/stupidedi/versions/005010/element_types/an.example +201 -0
  319. data/spec/examples/stupidedi/versions/005010/element_types/dt.example +258 -0
  320. data/spec/examples/stupidedi/versions/005010/element_types/id.example +192 -0
  321. data/spec/examples/stupidedi/versions/005010/element_types/nn.example +177 -0
  322. data/spec/examples/stupidedi/versions/005010/element_types/r.example +178 -0
  323. data/spec/examples/stupidedi/versions/005010/element_types/tm.example +2 -0
  324. data/spec/examples/stupidedi/zipper/abstract_cursor.example +417 -0
  325. data/spec/examples/stupidedi/zipper.example +9 -0
  326. data/spec/fixtures/X186-AG824/1-bad.txt +21 -0
  327. data/spec/fixtures/X186-AG824/1-good.txt +17 -0
  328. data/spec/fixtures/X186-AG824/2-bad.txt +26 -0
  329. data/spec/fixtures/X186-AG824/2-good.txt +21 -0
  330. data/spec/fixtures/X186-AG824/3-bad.txt +87 -0
  331. data/spec/fixtures/X186-AG824/3-good.txt +61 -0
  332. data/spec/fixtures/X212-HN277/1-bad.txt +54 -0
  333. data/spec/fixtures/X212-HN277/1-good.txt +46 -0
  334. data/spec/fixtures/X212-HN277/2-bad.txt +37 -0
  335. data/spec/fixtures/X212-HN277/2-good.txt +29 -0
  336. data/spec/fixtures/X212-HN277/3-bad.txt +22 -0
  337. data/spec/fixtures/X212-HN277/3-good.txt +17 -0
  338. data/spec/fixtures/X212-HN277/4-bad.txt +30 -0
  339. data/spec/fixtures/X212-HN277/4-good.txt +24 -0
  340. data/spec/fixtures/X212-HR276/1-bad.txt +53 -0
  341. data/spec/fixtures/X212-HR276/1-good.txt +46 -0
  342. data/spec/fixtures/X212-HR276/2-bad.txt +45 -0
  343. data/spec/fixtures/X212-HR276/2-good.txt +38 -0
  344. data/spec/fixtures/X212-HR276/3-bad.txt +32 -0
  345. data/spec/fixtures/X212-HR276/3-good.txt +26 -0
  346. data/spec/fixtures/X212-HR276/4-bad.txt +32 -0
  347. data/spec/fixtures/X212-HR276/4-good.txt +26 -0
  348. data/spec/fixtures/X214-HN277/1-bad.txt +58 -0
  349. data/spec/fixtures/X214-HN277/1-good.txt +47 -0
  350. data/spec/fixtures/X214-HN277/2-bad.txt +34 -0
  351. data/spec/fixtures/X214-HN277/2-good.txt +22 -0
  352. data/spec/fixtures/X214-HN277/3-bad.txt +64 -0
  353. data/spec/fixtures/X214-HN277/3-good.txt +54 -0
  354. data/spec/fixtures/X214-HN277/4-bad.txt +77 -0
  355. data/spec/fixtures/X214-HN277/4-good.txt +63 -0
  356. data/spec/fixtures/X216-HI278/1-bad.txt +42 -0
  357. data/spec/fixtures/X216-HI278/1-good.txt +27 -0
  358. data/spec/fixtures/X216-HI278/2-bad.txt +43 -0
  359. data/spec/fixtures/X216-HI278/2-good.txt +29 -0
  360. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-1.txt +24 -0
  361. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-1_Clean.txt +20 -0
  362. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-2.txt +46 -0
  363. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-2_Clean.txt +30 -0
  364. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-3.txt +38 -0
  365. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-3_Clean.txt +24 -0
  366. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-4a.txt +39 -0
  367. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-4a_Clean.txt +24 -0
  368. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-4b.txt +43 -0
  369. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-4b_Clean.txt +25 -0
  370. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-5.txt +63 -0
  371. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-5_Clean.txt +41 -0
  372. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-6.txt +36 -0
  373. data/spec/fixtures/X217-HI278/Sample_278_Request_5010X217-6_Clean.txt +20 -0
  374. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-1r.txt +34 -0
  375. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-1r_Clean.txt +23 -0
  376. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-2r.txt +46 -0
  377. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-2r_Clean.txt +31 -0
  378. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-3r.txt +44 -0
  379. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-3r_Clean.txt +26 -0
  380. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-4ar_Clean.txt +28 -0
  381. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-4br_Clean.txt +35 -0
  382. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-5r.txt +60 -0
  383. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-5r_Clean.txt +42 -0
  384. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-6r.txt +40 -0
  385. data/spec/fixtures/X217-HI278/Sample_278_Response_5010X217-6r_Clean.txt +24 -0
  386. data/spec/fixtures/X218-RA820/1-bad.txt +31 -0
  387. data/spec/fixtures/X218-RA820/1-good.txt +25 -0
  388. data/spec/fixtures/X218-RA820/2-bad.txt +37 -0
  389. data/spec/fixtures/X218-RA820/2-good.txt +29 -0
  390. data/spec/fixtures/X218-RA820/3-bad.txt +29 -0
  391. data/spec/fixtures/X218-RA820/3-good.txt +23 -0
  392. data/spec/fixtures/X218-RA820/4-bad.txt +36 -0
  393. data/spec/fixtures/X218-RA820/4-good.txt +27 -0
  394. data/spec/fixtures/X220-BE834/1-bad.txt +35 -0
  395. data/spec/fixtures/X220-BE834/1-good.txt +29 -0
  396. data/spec/fixtures/X220-BE834/10-bad.txt +26 -0
  397. data/spec/fixtures/X220-BE834/10-good.txt +19 -0
  398. data/spec/fixtures/X220-BE834/2-bad.txt +31 -0
  399. data/spec/fixtures/X220-BE834/2-good.txt +23 -0
  400. data/spec/fixtures/X220-BE834/3-bad.txt +36 -0
  401. data/spec/fixtures/X220-BE834/3-good.txt +26 -0
  402. data/spec/fixtures/X220-BE834/4-bad.txt +27 -0
  403. data/spec/fixtures/X220-BE834/4-good.txt +21 -0
  404. data/spec/fixtures/X220-BE834/5-bad.txt +26 -0
  405. data/spec/fixtures/X220-BE834/5-good.txt +17 -0
  406. data/spec/fixtures/X220-BE834/6-bad.txt +25 -0
  407. data/spec/fixtures/X220-BE834/6-good.txt +20 -0
  408. data/spec/fixtures/X220-BE834/7-bad.txt +25 -0
  409. data/spec/fixtures/X220-BE834/7-good.txt +20 -0
  410. data/spec/fixtures/X220-BE834/8-bad.txt +25 -0
  411. data/spec/fixtures/X220-BE834/8-good.txt +20 -0
  412. data/spec/fixtures/X220-BE834/9-bad.txt +27 -0
  413. data/spec/fixtures/X220-BE834/9-good.txt +21 -0
  414. data/spec/fixtures/X221-HP835/1-bad.txt +58 -0
  415. data/spec/fixtures/X221-HP835/1-good.txt +40 -0
  416. data/spec/fixtures/X221-HP835/2-bad.txt +51 -0
  417. data/spec/fixtures/X221-HP835/2-good.txt +40 -0
  418. data/spec/fixtures/X221-HP835/3a-bad.txt +78 -0
  419. data/spec/fixtures/X221-HP835/3a-good.txt +49 -0
  420. data/spec/fixtures/X221-HP835/3b-bad.txt +60 -0
  421. data/spec/fixtures/X221-HP835/3b-good.txt +32 -0
  422. data/spec/fixtures/X221-HP835/3c-bad.txt +55 -0
  423. data/spec/fixtures/X221-HP835/3c-good.txt +34 -0
  424. data/spec/fixtures/X222-HC837/1-bad.txt +60 -0
  425. data/spec/fixtures/X222-HC837/1-good.txt +53 -0
  426. data/spec/fixtures/X222-HC837/10a-bad.txt +52 -0
  427. data/spec/fixtures/X222-HC837/10a-good.txt +40 -0
  428. data/spec/fixtures/X222-HC837/10b-bad.txt +99 -0
  429. data/spec/fixtures/X222-HC837/10b-good.txt +80 -0
  430. data/spec/fixtures/X222-HC837/10c-bad.txt +105 -0
  431. data/spec/fixtures/X222-HC837/10c-good.txt +80 -0
  432. data/spec/fixtures/X222-HC837/11-bad.txt +69 -0
  433. data/spec/fixtures/X222-HC837/11-good.txt +45 -0
  434. data/spec/fixtures/X222-HC837/12-bad.txt +73 -0
  435. data/spec/fixtures/X222-HC837/12-good.txt +51 -0
  436. data/spec/fixtures/X222-HC837/13-bad.txt +64 -0
  437. data/spec/fixtures/X222-HC837/13-good.txt +46 -0
  438. data/spec/fixtures/X222-HC837/3a-bad.txt +83 -0
  439. data/spec/fixtures/X222-HC837/3a-good.txt +59 -0
  440. data/spec/fixtures/X222-HC837/3b-bad.txt +97 -0
  441. data/spec/fixtures/X222-HC837/3b-good.txt +70 -0
  442. data/spec/fixtures/X222-HC837/3c-bad.txt +95 -0
  443. data/spec/fixtures/X222-HC837/3c-good.txt +74 -0
  444. data/spec/fixtures/X222-HC837/4-bad.txt +67 -0
  445. data/spec/fixtures/X222-HC837/4-good.txt +48 -0
  446. data/spec/fixtures/X222-HC837/5-bad.txt +73 -0
  447. data/spec/fixtures/X222-HC837/5-good.txt +60 -0
  448. data/spec/fixtures/X222-HC837/6-bad.txt +50 -0
  449. data/spec/fixtures/X222-HC837/6-good.txt +39 -0
  450. data/spec/fixtures/X222-HC837/7-bad.txt +93 -0
  451. data/spec/fixtures/X222-HC837/7-good.txt +78 -0
  452. data/spec/fixtures/X222-HC837/8-bad.txt +64 -0
  453. data/spec/fixtures/X222-HC837/8-good.txt +52 -0
  454. data/spec/fixtures/X222-HC837/9-bad.txt +56 -0
  455. data/spec/fixtures/X222-HC837/9-good.txt +38 -0
  456. data/spec/fixtures/X223-HC837/1-bad.txt +66 -0
  457. data/spec/fixtures/X223-HC837/1-good.txt +53 -0
  458. data/spec/fixtures/X223-HC837/2-bad.txt +69 -0
  459. data/spec/fixtures/X223-HC837/2-good.txt +60 -0
  460. data/spec/fixtures/X223-HC837/3-bad.txt +89 -0
  461. data/spec/fixtures/X223-HC837/3-good.txt +61 -0
  462. data/spec/fixtures/X223-HC837/4-bad.txt +60 -0
  463. data/spec/fixtures/X223-HC837/4-good.txt +40 -0
  464. data/spec/fixtures/X223-HC837/5-bad.txt +75 -0
  465. data/spec/fixtures/X223-HC837/5-good.txt +58 -0
  466. data/spec/fixtures/X224-HC837/1-bad.txt +54 -0
  467. data/spec/fixtures/X224-HC837/1-good.txt +44 -0
  468. data/spec/fixtures/X224-HC837/2a-bad.txt +52 -0
  469. data/spec/fixtures/X224-HC837/2a-good.txt +42 -0
  470. data/spec/fixtures/X224-HC837/2b-bad.txt +67 -0
  471. data/spec/fixtures/X224-HC837/2b-good.txt +52 -0
  472. data/spec/fixtures/X224-HC837/3-bad.txt +67 -0
  473. data/spec/fixtures/X224-HC837/3-good.txt +51 -0
  474. data/spec/fixtures/X224-HC837/4-bad.txt +49 -0
  475. data/spec/fixtures/X224-HC837/4-good.txt +40 -0
  476. data/spec/fixtures/X230-FA997/1-bad.txt +19 -0
  477. data/spec/fixtures/X230-FA997/1-good.txt +16 -0
  478. data/spec/fixtures/X231-FA999/1-bad.txt +20 -0
  479. data/spec/fixtures/X231-FA999/1-good.txt +20 -0
  480. data/spec/fixtures/X279-HB271/1-bad.txt +36 -0
  481. data/spec/fixtures/X279-HB271/1-good.txt +30 -0
  482. data/spec/fixtures/X279-HB271/2-bad.txt +22 -0
  483. data/spec/fixtures/X279-HB271/2-good.txt +16 -0
  484. data/spec/fixtures/X279-HB271/3-bad.txt +44 -0
  485. data/spec/fixtures/X279-HB271/3-good.txt +36 -0
  486. data/spec/fixtures/X279-HS270/1-bad.txt +29 -0
  487. data/spec/fixtures/X279-HS270/1-good.txt +23 -0
  488. data/spec/fixtures/X279-HS270/2-bad.txt +32 -0
  489. data/spec/fixtures/X279-HS270/2-good.txt +25 -0
  490. data/spec/spec_helper.rb +34 -0
  491. data/spec/support/fixtures.rb +26 -0
  492. data/spec/support/matchers/either_matchers.rb +26 -0
  493. data/spec/support/matchers/navigation_matchers.rb +247 -0
  494. data/spec/support/node.rb +41 -0
  495. data/spec/support/quickcheck/characters.rb +28 -0
  496. data/spec/support/quickcheck/property.rb +105 -0
  497. data/spec/support/quickcheck/serialized_edi.rb +399 -0
  498. data/spec/support/quickcheck.rb +302 -0
  499. data/spec/support/rcov.rb +34 -0
  500. metadata +577 -0
@@ -0,0 +1,1405 @@
1
+ module Stupidedi
2
+ module Versions
3
+ module FunctionalGroups
4
+ module FiftyTen
5
+ module ElementDefs
6
+
7
+ t = ElementTypes
8
+ r = ElementReqs
9
+ s = Schema
10
+
11
+ E2 = t::Nn.new(:E2 , "Number of Accepted Transaction Sets" , 1, 6, 0)
12
+ E19 = t::AN.new(:E19 , "City Name" , 2, 30)
13
+ E26 = t::ID.new(:E26 , "Country Code" , 2, 3,
14
+ s::CodeList.external("5"))
15
+
16
+ E28 = t::Nn.new(:E28 , "Group Control Number" , 1, 9, 0)
17
+ E61 = t::AN.new(:E61 , "Free-form Information" , 1, 30)
18
+ E66 = t::ID.new(:E66 , "Identification Code Qualifier" , 1, 2,
19
+ s::CodeList.build(
20
+ "1" => s::CodeList.external("16"),
21
+ "9" => s::CodeList.external("16"),
22
+ "21" => s::CodeList.external("121"),
23
+ "34" => "Social Security Number",
24
+ "38" => s::CodeList.external("5"),
25
+ "46" => "Electronic Transmitter Identification Number (ETIN)",
26
+ "51" => s::CodeList.external("51"),
27
+ "AC" => "Attachment Control Number",
28
+ "AD" => "Blue Cross Blue Shield Associtation Plan Code",
29
+ "BD" => "Blue Cross Provider Number",
30
+ "BS" => "Blue Shield Provider Number",
31
+ "C" => "Insured's Changed Unique Identification Number",
32
+ "CF" => s::CodeList.external("91"),
33
+ "FI" => "Fediral Taxpayer's Identification Number",
34
+ "HN" => "Health Insurance Claim (HIC) Number",
35
+ "II" => "Standard Unique Health Identifier for each Individual in the United States",
36
+ "LD" => s::CodeList.external("457"),
37
+ "LE" => s::CodeList.external("102"),
38
+ "NI" => "National Association of Insurance Commisioners (NAIC) Identification",
39
+ "MI" => "Member Identification Number",
40
+ "MC" => "Medicaid Provider",
41
+ "MR" => "Medicaid Recipient Identification Number",
42
+ "PC" => "Provider Commercial Number",
43
+ "PI" => "Payor Identification",
44
+ "PP" => "Pharmacy Processor Number",
45
+ "SJ" => s::CodeList.external("22"),
46
+ "SL" => "State License Number",
47
+ "UP" => "Unique Physician Identification Number (UPIN)",
48
+ "XV" => s::CodeList.external("540"),
49
+ "XX" => s::CodeList.external("537")))
50
+
51
+ E67 = t::AN.new(:E67 , "Identification Code" , 2, 80)
52
+ E81 = t:: R.new(:E81 , "Weight" , 1, 10)
53
+ E93 = t::AN.new(:E93 , "Name" , 1, 60)
54
+ E96 = t::Nn.new(:E96 , "Number of Included Segments" , 1, 10, 0)
55
+ E97 = t::Nn.new(:E97 , "Number of Transaction Sets Included" , 1, 6, 0)
56
+ E98 = t::ID.new(:E98 , "Entity Identifier Code" , 2, 3,
57
+ s::CodeList.build(
58
+ "03" => "Dependent",
59
+ "1P" => "Provider",
60
+ "1Z" => "Home Health Care",
61
+ "36" => "Employer",
62
+ "40" => "Receiver",
63
+ "41" => "Submitter",
64
+ "45" => "Drop-off Location",
65
+ "71" => "Attending Physician",
66
+ "72" => "Operating Physician",
67
+ "73" => "Other Physician",
68
+ "74" => "Corrected Insured",
69
+ "77" => "Service Location",
70
+ "82" => "Rendering Provider",
71
+ "85" => "Billing Provider",
72
+ "87" => "Pay-to Provider",
73
+ "98" => "Receiver",
74
+ "AY" => "Clearinghouse",
75
+ "DK" => "Ordering Physician",
76
+ "DN" => "Referring Provider",
77
+ "DQ" => "Supervising Physician",
78
+ "FA" => "Facility",
79
+ "GB" => "Other Insured",
80
+ "HK" => "Subscriber",
81
+ "IL" => "Insured or Subscriber",
82
+ "LI" => "Independent Lab",
83
+ "MSC" => "Mammography Screening Center",
84
+ "P3" => "Primary Care Provider",
85
+ "PE" => "Payee",
86
+ "PR" => "Payer",
87
+ "PRP" => "Primary Payer",
88
+ "PW" => "Pickup Address",
89
+ "TT" => "Transfer To",
90
+ "QB" => "Purchase Service Provider",
91
+ "QC" => "Patient",
92
+ "QD" => "Responsible Party",
93
+ "SEP" => "Secondary Payer",
94
+ "TL" => "Testing Laboratory",
95
+ "TTP" => "Tertiary Payer",
96
+ "TU" => "Third Party Repricing Organization (TPO)"))
97
+
98
+ E100 = t::ID.new(:E100 , "Currency Code" , 3, 3,
99
+ s::CodeList.external("5"))
100
+
101
+ E116 = t::ID.new(:E116 , "Postal Code" , 3, 15,
102
+ s::CodeList.external("51"),
103
+ s::CodeList.external("166"))
104
+
105
+ E118 = t:: R.new(:E118 , "Rate" , 1, 9)
106
+ E123 = t::Nn.new(:E123 , "Number of Received Transaction Sets" , 1, 6, 0)
107
+ E124 = t::AN.new(:E124 , "Application Receiver's Code" , 2, 15)
108
+ E127 = t::AN.new(:E127 , "Reference Identification" , 1, 50)
109
+ E128 = t::ID.new(:E128 , "Reference Identification Qualifier" , 2, 3,
110
+ s::CodeList.build(
111
+ "04" => s::CodeList.external("91"),
112
+ "0B" => "State License Number",
113
+ "0K" => "Policy Form Identifying Number",
114
+ "1A" => "Blue Cross Provider Number",
115
+ "1B" => "Blue Shield Provider Number",
116
+ "1C" => "Medicare Provider Number",
117
+ "1D" => "Medicaid Provider Number",
118
+ "1G" => "Provider UPIN Number",
119
+ "1H" => "CHAMPUS Identification Number",
120
+ "1J" => "Facility ID Number",
121
+ "1K" => "Payor's Claim Number",
122
+ "1L" => "Group or Policy Number",
123
+ "1S" => "Ambulatory Patient Group (APG) Number",
124
+ "1W" => "Member Identification Number",
125
+ "28" => "Employee Identification Number",
126
+ "2U" => "Payer Identification Number",
127
+ "4N" => "Special Payment Reference Number",
128
+ "6P" => "Group Number",
129
+ "6R" => "Provider Control Number",
130
+ "9A" => "Repriced Claim Reference Number",
131
+ "9B" => "Repriced Line Item Reference Number",
132
+ "9C" => "Adjusted Repriced Claim Reference Number",
133
+ "9D" => "Adjusted Repriced Line Item Reference Number",
134
+ "9F" => "Referral Number",
135
+ "ABY" => s::CodeList.external("540"),
136
+ "AP" => "Ambulatory Payment Classification",
137
+ "APC" => s::CodeList.external("468"),
138
+ "BB" => "Authorization Number",
139
+ "BLT" => "Billing Type",
140
+ "BT" => "Batch Number",
141
+ "CE" => "Class of Contract Code",
142
+ "CPT" => s::CodeList.external("133"),
143
+ "D3" => s::CodeList.external("307"),
144
+ "D9" => "Claim Number",
145
+ "DNS" => s::CodeList.external("16"),
146
+ "DUN" => s::CodeList.external("16"),
147
+ "E9" => "Attachment Code",
148
+ "EA" => "Medical Record Identification Number",
149
+ "EI" => "Employer's Identification Number",
150
+ "EO" => "Submitter Identification Number",
151
+ "EV" => "Receiver Identification Number",
152
+ "EW" => "Mammography Certification Number",
153
+ "F2" => "Version Code - Local",
154
+ "F4" => "Facility Certification Number",
155
+ "F5" => "Medicare Version Code",
156
+ "F8" => "Original Reference Number",
157
+ "FJ" => "Line Item Control Number",
158
+ "FY" => "Claim Office Number",
159
+ "G1" => "Prior Authorization Number",
160
+ "G2" => "Provider Commercial Number",
161
+ "G3" => "Predetermination of Benefits Identification Number",
162
+ "HI" => s::CodeList.external("121"),
163
+ "HPI" => s::CodeList.external("537"),
164
+ "ICD" => s::CodeList.external("131"),
165
+ "IG" => "Insurance Policy Number",
166
+ "LOI" => s::CodeList.external("663"),
167
+ "LU" => "Location Number",
168
+ "LX" => "Qualified Products List",
169
+ "MRC" => s::CodeList.external("844"),
170
+ "NF" => s::CodeList.external("245"),
171
+ "P4" => "Project Code",
172
+ "PQ" => "Payee Indentification",
173
+ "PXC" => s::CodeList.external("682"),
174
+ "RB" => "Rate code number",
175
+ "SY" => "Social Security Number",
176
+ "T4" => "Signal Code",
177
+ "TJ" => "Federal Taxpayer's Identification Number",
178
+ "VY" => "Link Sequence Number",
179
+ "Y4" => "Agency Claim Number",
180
+ "X4" => "Clinical Laboratory Improvement Amendment Number",
181
+ "XZ" => "Pharmacy Prescription Number"))
182
+
183
+ E142 = t::AN.new(:E142 , "Application's Sender Code" , 2, 15)
184
+ E143 = t::ID.new(:E143 , "Transaction Set Identifier Number" , 3, 3,
185
+ s::CodeList.build(
186
+ "277" => "Health Care Information Status Notification",
187
+ "835" => "Health Care Claim Payment/Advice",
188
+ "837" => "Health Care Claim",
189
+ "999" => "Implementation Acknowledgement"))
190
+
191
+ E156 = t::ID.new(:E156 , "State or Province Code" , 2, 2,
192
+ s::CodeList.external("22"))
193
+
194
+ E166 = t::AN.new(:E166 , "Address Information" , 1, 55)
195
+ E212 = t:: R.new(:E212 , "Unit Price" , 1, 17)
196
+ E234 = t::AN.new(:E234 , "Product/Service ID" , 1, 48)
197
+ E235 = t::ID.new(:E235 , "Product/Service ID Qualifier" , 2, 2,
198
+ s::CodeList.build(
199
+ "AD" => s::CodeList.external("135"),
200
+ "A5" => s::CodeList.external("22"),
201
+ "CH" => s::CodeList.external("5"),
202
+ "CJ" => s::CodeList.external("135"),
203
+ "DC" => s::CodeList.external("897"),
204
+ "DX" => s::CodeList.external("131"),
205
+ "EN" => "EAN/UCC - 13",
206
+ "EO" => "EAN/UCC - 8",
207
+ "ER" => s::CodeList.external("576"),
208
+ "HC" => s::CodeList.external("130"),
209
+ "HP" => s::CodeList.external("716"),
210
+ "ID" => s::CodeList.external("131"),
211
+ "IP" => s::CodeList.external("896"),
212
+ "IV" => s::CodeList.external("513"),
213
+ "HI" => "HIBC (Health Care Industry Bar Code) Supplier Labeling Standard Primary Data Message",
214
+ "LB" => s::CodeList.external("663"),
215
+ "N1" => s::CodeList.external("240"),
216
+ "N2" => s::CodeList.external("240"),
217
+ "N3" => s::CodeList.external("240"),
218
+ "N4" => s::CodeList.external("240"),
219
+ "N5" => s::CodeList.external("240"),
220
+ "N6" => s::CodeList.external("240"),
221
+ "NU" => s::CodeList.external("132"),
222
+ "ON" => "Customer Order Number",
223
+ "TD" => s::CodeList.external("359"),
224
+ "UI" => "U.P.C. Consumer Package (1-5-5)",
225
+ "UK" => "GTIN 14-digit Data Structure",
226
+ "UP" => "UCC - 12",
227
+ "RB" => s::CodeList.external("132"),
228
+ "WK" => s::CodeList.external("843")))
229
+
230
+ E236 = t::ID.new(:E236 , "Price Identifier Code" , 3, 3)
231
+ E280 = t:: R.new(:E280 , "Exchange Rate" , 4, 10)
232
+ E289 = t::Nn.new(:E289 , "Multiple Price Quantity" , 1, 2, 0)
233
+ E305 = t::ID.new(:E305 , "Transaction Handling Code" , 1, 2,
234
+ s::CodeList.build(
235
+ "C" => "Payment Accompanies Remittance Advice",
236
+ "D" => "Make Payment Only",
237
+ "H" => "Notification Only",
238
+ "I" => "Remittance Information Only",
239
+ "P" => "Prenotification of Future Transfers",
240
+ "U" => "Split Payment and Remittance",
241
+ "X" => "Handling Party's Option to Split Payment and Remittance"))
242
+
243
+ E306 = t::ID.new(:E306 , "Action Code" , 1, 2,
244
+ s::CodeList.build(
245
+ "U" => "Reject",
246
+ "WQ" => "Accept"))
247
+
248
+ E309 = t::ID.new(:E309 , "Location Qualifier" , 1, 2,
249
+ s::CodeList.build(
250
+ "PQ" => s::CodeList.external("51"),
251
+ "PR" => s::CodeList.external("51"),
252
+ "PS" => s::CodeList.external("51"),
253
+ "RJ" => s::CodeList.external("DOD1")))
254
+
255
+ E310 = t::ID.new(:E310 , "Location Identifier" , 1, 30)
256
+ E329 = t::AN.new(:E329 , "Transaction Set Control Number" , 4, 9)
257
+ E332 = t:: R.new(:E332 , "Percent, Decimal Format" , 1, 6)
258
+ E337 = t::TM.new(:E337 , "Time" , 4, 8)
259
+ E338 = t:: R.new(:E338 , "Terms Discount Percent" , 1, 6)
260
+ E350 = t::AN.new(:E350 , "Assigned Identification" , 1, 20)
261
+ E352 = t::AN.new(:E352 , "Description" , 1, 80)
262
+ E353 = t::ID.new(:E353 , "Transaction Set Purpose Code" , 2, 2,
263
+ s::CodeList.build(
264
+ "00" => "Original",
265
+ "08" => "Status",
266
+ "18" => "Reissue"))
267
+
268
+ E355 = t::ID.new(:E355 , "Unit or Basis for Measurement Code" , 2, 2,
269
+ s::CodeList.build(
270
+ "01" => "Actual Pounds",
271
+ "DA" => "Days",
272
+ "DH" => "Miles",
273
+ "F2" => "International Unit",
274
+ "GR" => "Gram",
275
+ "LB" => "Pound",
276
+ "ME" => "Milligram",
277
+ "MJ" => "Minutes",
278
+ "ML" => "Milliliter",
279
+ "MO" => "Months",
280
+ "UN" => "Units"))
281
+
282
+ E363 = t::ID.new(:E363 , "Note Reference Code" , 3, 3,
283
+ s::CodeList.build(
284
+ "ADD" => "Additional Information",
285
+ "CER" => "Certification Narrative",
286
+ "DCP" => "Goals, Rehabilitation Potential, or Discharge Plans",
287
+ "DGN" => "Diagnosis Description",
288
+ "TPO" => "Third Party Organization Notes"))
289
+
290
+ E364 = t::AN.new(:E364 , "Communication Number" , 1, 256)
291
+ E365 = t::ID.new(:E365 , "Communication Number Qualifier" , 2, 2,
292
+ s::CodeList.build(
293
+ "EM" => "Electronic Mail",
294
+ "EX" => "Telephone Extension",
295
+ "FX" => "Facsimile",
296
+ "TE" => "Telephone",
297
+ "UR" => "Uniform Resource Locator (URL)"))
298
+
299
+ E366 = t::ID.new(:E366 , "Contract Function Code" , 2, 2,
300
+ s::CodeList.build(
301
+ "BL" => "Technical Department",
302
+ "CX" => "Payers Claim Office",
303
+ "IC" => "Information Contact"))
304
+
305
+ E373 = t::DT.new(:E373 , "Date" , 8, 8)
306
+ E374 = t::ID.new(:E374 , "Date/Time Qualifier" , 3, 3,
307
+ s::CodeList.build(
308
+ "009" => "Process",
309
+ "011" => "Shipped",
310
+ "036" => "Expiration",
311
+ "050" => "Received",
312
+ "090" => "Report Start",
313
+ "091" => "Report End",
314
+ "096" => "Discharge",
315
+ "150" => "Service Period Start",
316
+ "151" => "Service Period End",
317
+ "232" => "Claim Statement Period Start",
318
+ "233" => "Claim Statement Period End",
319
+ "296" => "Initial Disability Period Return To Work",
320
+ "297" => "Initial Disability Period Last Day Worked",
321
+ "304" => "Latest Visit or Consultation",
322
+ "314" => "Disability",
323
+ "360" => "Initial Disability Period Start",
324
+ "361" => "Initial Disability Period End",
325
+ "405" => "Production",
326
+ "431" => "Onset of Current Symptoms or Illness",
327
+ "435" => "Admission",
328
+ "439" => "Accident",
329
+ "444" => "First Visit or Consultation",
330
+ "453" => "Acute Manifestation of a Chronic Condition",
331
+ "454" => "Initial Treatment",
332
+ "455" => "Last X-Ray",
333
+ "461" => "Last Certification",
334
+ "463" => "Begin Therapy",
335
+ "471" => "Prescription",
336
+ "472" => "Service",
337
+ "484" => "Last Menstrual Period",
338
+ "573" => "Date Claim Paid",
339
+ "607" => "Certification Revision",
340
+ "738" => "Most Recent Hemoglobin or Hematocrit or Both",
341
+ "739" => "Most Recent Serum Creatine"))
342
+
343
+ E380 = t:: R.new(:E380 , "Quantity" , 1, 15)
344
+ E426 = t::ID.new(:E426 , "Adjustment Reason Code" , 2, 2,
345
+ s::CodeList.build(
346
+ "50" => "Late Charge",
347
+ "51" => "Interest Penalty Charge",
348
+ "72" => "Authorized Return",
349
+ "90" => "Early Payment Allowance",
350
+ "AH" => "Origination Fee",
351
+ "AM" => "Applied to Borrower's Account",
352
+ "AP" => "Acceleration of Benefits",
353
+ "B2" => "Rebate",
354
+ "B3" => "Recovery Allowance",
355
+ "BD" => "Bad Debt Adjustment",
356
+ "BN" => "Bonus",
357
+ "C5" => "Temporary Allowance",
358
+ "CR" => "Capitation Interest",
359
+ "CS" => "Adjustment",
360
+ "CT" => "Capitation Payment",
361
+ "CV" => "Capital Passthru",
362
+ "CW" => "Certified Registered Nurse Anesthetist Passthru",
363
+ "DM" => "Direct Medical Education Passthru",
364
+ "E3" => "Withholding",
365
+ "FB" => "Forwarding Balance",
366
+ "FC" => "Fund Allocation",
367
+ "GO" => "Graduate Medicale Education Passthru",
368
+ "HM" => "Hemophelia Clotting Factor Supplement",
369
+ "IP" => "Incentive Premium Payment",
370
+ "IR" => "Internal Revenue Service Withholding",
371
+ "IS" => "Interim Settlement",
372
+ "J1" => "Nonreimbursable",
373
+ "L3" => "Penalty",
374
+ "L6" => "Interest Owed",
375
+ "LE" => "Levy",
376
+ "LS" => "Lump Sum",
377
+ "OA" => "Organ Acquisition Passthru",
378
+ "OB" => "Offset for Affiliated Providers",
379
+ "PI" => "Periodic Interim Payment",
380
+ "PL" => "Payment Final",
381
+ "RA" => "Retro-activity Adjustment",
382
+ "RE" => "Return on Equity",
383
+ "SL" => "Student Loan Repayment",
384
+ "TL" => "Third Party Liability",
385
+ "WO" => "Overpayment Recovery",
386
+ "WU" => "Unspecified Recovery"))
387
+
388
+ E429 = t::AN.new(:E429 , "Check Number" , 1, 16)
389
+ E443 = t::AN.new(:E443 , "Contract Inquiry Reference" , 1, 20)
390
+ E447 = t::AN.new(:E447 , "Loop Identifier Code" , 1, 4)
391
+ E449 = t::AN.new(:E449 , "Fixed Format Information" , 1, 80)
392
+ E478 = t::ID.new(:E478 , "Credit/Debit Flag Code" , 1, 1,
393
+ s::CodeList.build(
394
+ "C" => "Credit",
395
+ "D" => "Debit",
396
+ "ACH" => "Automated Clearing House (ACH)",
397
+ "BOP" => "Financial Institution Option",
398
+ "CHK" => "Check",
399
+ "FWT" => "Federal Reserve Funds/Wire Transfer - Nonrepetitive",
400
+ "NON" => "Non-Payment Data"))
401
+
402
+ E479 = t::ID.new(:E479 , "Functional Identifier Code" , 2, 2,
403
+ s::CodeList.build(
404
+ "BE" => "Benefit Enrollment and Maintenance",
405
+ "FA" => "Functional or Implementation Acknowledgment Transaction Sets",
406
+ "HC" => "Health Care Claim",
407
+ "HI" => "Health Care Services Review Information",
408
+ "HN" => "Health Care Information Status Notification",
409
+ "HP" => "Health Care Claim Payment/Advice",
410
+ "HS" => "Eligibility, Coverage or Benefit Inquiry",
411
+ "HR" => "Health Care Claim Status Request",
412
+ "RA" => "Payment Order/Remittance Advice"))
413
+
414
+ E455 = t::ID.new(:E455 , "Responsible Agency Code" , 1, 2,
415
+ s::CodeList.build(
416
+ "X" => "Accredited Standards Committee X12"))
417
+
418
+ E480 = t::AN.new(:E480 , "Version / Release / Identifier Code" , 1, 12,
419
+ s::CodeList.external("881"))
420
+
421
+ E481 = t::ID.new(:E481 , "Trace Type Code" , 1, 2,
422
+ s::CodeList.build(
423
+ "1" => "Current Transaction Trace Numbers",
424
+ "2" => "Referenced Transaction Trace Numbers"))
425
+
426
+ E499 = t::AN.new(:E499 , "Condition Value" , 1, 10)
427
+ E506 = t::ID.new(:E506 , "DFI Identification Number Qualifier" , 2, 2,
428
+ s::CodeList.build(
429
+ "01" => s::CodeList.external("4"),
430
+ "04" => s::CodeList.external("91")))
431
+
432
+ E507 = t::AN.new(:E507 , "DFI Identification Number" , 3, 12,
433
+ s::CodeList.external("60"))
434
+
435
+ E508 = t::AN.new(:E508 , "Account Number" , 1, 35)
436
+ E509 = t::AN.new(:E509 , "Originating Company Identifier" , 10,10)
437
+ E510 = t::AN.new(:E510 , "Originating Company Supplemental Code", 9, 9)
438
+ E522 = t::ID.new(:E522 , "Amount Qualifier Code" , 1, 3,
439
+ s::CodeList.build(
440
+ "A8" => "Noncovered Charges - Actual",
441
+ "AU" => "Coverage Amount",
442
+ "B6" => "Allowed Amount",
443
+ "D" => "Payor Amount Paid",
444
+ "D8" => "Discount Amount",
445
+ "DY" => "Per Day Limit",
446
+ "EAF" => "Amount Owed",
447
+ "F4" => "Postage Claimed",
448
+ "F5" => "Patient Amount Paid",
449
+ "I" => "Interest",
450
+ "KH" => "Deduction Amount",
451
+ "NL" => "Negative Ledger Balance",
452
+ "T" => "Tax",
453
+ "T2" => "Total Claim Before Taxes",
454
+ "YU" => "In Process",
455
+ "YY" => "Returned",
456
+ "ZK" => "Federal Medicare or Medicaid Payment Mandate Category 1",
457
+ "ZL" => "Federal Medicare or Medicaid Payment Mandate Category 2",
458
+ "ZM" => "Federal Medicare or Medicaid Payment Mandate Category 3",
459
+ "ZN" => "Federal Medicare or Medicaid Payment Mandate Category 4",
460
+ "ZO" => "Federal Medicare or Medicaid Payment Mandate Category 5"))
461
+
462
+ E554 = t::Nn.new(:E554 , "Assigned Number" , 1, 6, 0)
463
+ E559 = t::ID.new(:E559 , "Agency Qualifier Code" , 2, 2,
464
+ s::CodeList.build(
465
+ "LB" => s::CodeList.external("407")))
466
+
467
+ E569 = t::ID.new(:E569 , "Account Number Qualifier" , 1, 3,
468
+ s::CodeList.build(
469
+ "DA" => "Demand Deposit",
470
+ "SG" => "Savings"))
471
+
472
+ E584 = t::ID.new(:E584 , "Employment Status Code" , 2, 2)
473
+ E591 = t::ID.new(:E591 , "Payment Method Code" , 3, 3)
474
+ E594 = t::ID.new(:E594 , "Frequency Code" , 1, 1,
475
+ s::CodeList.build(
476
+ "1" => "Weekly",
477
+ "4" => "Monthly",
478
+ "6" => "Daily"))
479
+
480
+ E609 = t::Nn.new(:E609 , "Count" , 1, 9, 0)
481
+ E618 = t::ID.new(:E618 , "Implementation Transaction Set Syntax Error Code", 1, 3,
482
+ s::CodeList.build(
483
+ "1" => "Transaction Set Not Supported",
484
+ "2" => "Transaction Set Trailer Missing",
485
+ "3" => "Transaction Set Control Number in Header and Trailer Do Not Match",
486
+ "4" => "Number of Included Segments Does Not Match Actual Content",
487
+ "5" => "One or More Segments in Error",
488
+ "6" => "Missing or Invalid Transaction Set Identifier",
489
+ "7" => "Missing or Invalid Transaction Set Control Number",
490
+ "8" => "Authentication Key Name Unknown",
491
+ "9" => "Encryption Key Name Unknown",
492
+ "10" => "Requested Service (Authentication or Encrypted) Not Available",
493
+ "11" => "Unknown Security Recipient",
494
+ "12" => "Incorrect Message Length (Encryption Only)",
495
+ "13" => "Message Authentication Code Failed",
496
+ "15" => "Unknown Security Originator",
497
+ "16" => "Syntax Error in Decrypted Text",
498
+ "17" => "Security Not Supported",
499
+ "18" => "Transaction Set not in Functional Group",
500
+ "19" => "Invalid Transaction Set Implementation Convention Reference",
501
+ "23" => "Transaction Set Control Number Not Unique within the Functional Group",
502
+ "24" => "S3E Security End Segment Missing for S3S Security Start Segment",
503
+ "25" => "S3S Security Start Segment Missing for S3E Security End Segment",
504
+ "26" => "S4E Security End Segment Missing for S4S Security Start Segment",
505
+ "27" => "S4S Security Start Segment Missing for S4E Security End Segment",
506
+ "I5" => "Implementation One or More Segments In Error",
507
+ "I6" => "Implementation Convention Not Supported"))
508
+
509
+
510
+ E620 = t::ID.new(:E620 , "Implementation Segment Syntax Error Code", 1, 3,
511
+ s::CodeList.build(
512
+ "1" => "Unrecognized segment ID",
513
+ "2" => "Unexpected segment",
514
+ "3" => "Required Segment Missing",
515
+ "4" => "Loop Occurs Over Maximum Times",
516
+ "5" => "Segment Exceeds Maximum Use",
517
+ "6" => "Segment Not in Defined Transaction Set",
518
+ "7" => "Segment Not in Proper Sequence",
519
+ "8" => "Segment Has Data Element Errors",
520
+ "I4" => "Implementation 'Not Used' Segment Present",
521
+ "I6" => "Implementation Dependent Segment Missing",
522
+ "I7" => "Implementation Loop Occurs Under Minimum Times",
523
+ "I8" => "Implementation Segment Below Minimum Use",
524
+ "I9" => "Implementation Dependent 'Not Used' Segment Present"))
525
+
526
+ E621 = t::ID.new(:E621 , "Implementation Data Element Syntax Error Code", 1, 3,
527
+ s::CodeList.build(
528
+ "1" => "Required Data Element Missing",
529
+ "2" => "Conditional Required Data Element Missing",
530
+ "3" => "Too Many Data Elements",
531
+ "4" => "Data Element Too Short",
532
+ "5" => "Data Element Too Long",
533
+ "6" => "Invalid Character In Data Element",
534
+ "7" => "Invalid Code Value",
535
+ "8" => "Invalid Date",
536
+ "9" => "Invalid Time",
537
+ "10" => "Exclusion Conditional Violated",
538
+ "12" => "Too Many Repetitions",
539
+ "13" => "Too Many Components",
540
+ "I6" => "Code Value Not Used in Implementation",
541
+ "I9" => "Implementation Dependent Data Element Missing",
542
+ "I10" => "Implementation 'Not Used' Data Element Present",
543
+ "I11" => "Implementation Too Few Repetitions",
544
+ "I12" => "Implementation Pattern Match Failure",
545
+ "I13" => "Implementation Dependent 'Not Used' Data Element Present"))
546
+
547
+ E623 = t::ID.new(:E623 , "Time Code" , 2, 2,
548
+ s::CodeList.external("94"))
549
+
550
+ E628 = t::AN.new(:E628 , "Hierachical ID Number" , 1, 12)
551
+ E639 = t::ID.new(:E639 , "Basis of Unit Price Code" , 2, 2)
552
+ E640 = t::ID.new(:E640 , "Transaction Type Code" , 2, 2,
553
+ s::CodeList.build(
554
+ "31" => "Subrogation Demand",
555
+ "CH" => "Chargeable",
556
+ "DG" => "Response",
557
+ "NO" => "Notice",
558
+ "RP" => "Reporting",
559
+ "RQ" => "Request",
560
+ "TH" => "Receipt Acknowledgement Advice"))
561
+
562
+ E648 = t::ID.new(:E648 , "Price Multiplier Qualifier" , 3, 3)
563
+ E649 = t:: R.new(:E649 , "Multiplier" , 1, 10)
564
+ E659 = t::ID.new(:E659 , "Basis of Verification Code" , 1, 2)
565
+ E669 = t::ID.new(:E669 , "Currency Market/Exchnage Code" , 3, 3)
566
+ E673 = t::ID.new(:E673 , "Quantity Qualifier" , 2, 2,
567
+ s::CodeList.build(
568
+ "90" => "Acknowledged Quantity",
569
+ "AA" => "Unacknowledged Quantity",
570
+ "CA" => "Covered - Actual",
571
+ "CD" => "Co-insured - Actual",
572
+ "FL" => "Units",
573
+ "LA" => "Life-time Reserve - Actual",
574
+ "LE" => "Life-time Reserve - Estimated",
575
+ "NE" => "Non-Covered Amount - Estimated",
576
+ "NR" => "Not Replaced Blood Units",
577
+ "OU" => "Outlier Days",
578
+ "PS" => "Prescription",
579
+ "PT" => "Patients",
580
+ "QA" => "Quantity Approved",
581
+ "QC" => "Quantity Disapproved",
582
+ "VS" => "Visits",
583
+ "ZK" => "Federal Medicare or Medicaid Payment Mandate Category 1",
584
+ "ZL" => "Federal Medicare or Medicaid Payment Mandate Category 2",
585
+ "ZM" => "Federal Medicare or Medicaid Payment Mandate Category 3",
586
+ "ZN" => "Federal Medicare or Medicaid Payment Mandate Category 4",
587
+ "ZO" => "Federal Medicare or Medicaid Payment Mandate Category 5"))
588
+
589
+ E687 = t::ID.new(:E687 , "Class of Trade Code" , 2, 2)
590
+ E704 = t::ID.new(:E704 , "Paperwork/Report Action Code" , 1, 2)
591
+ # @note Copied from an unverified 4010 internet source
592
+
593
+ E706 = t::ID.new(:E706 , "Entity Relation Code" , 2, 2)
594
+ E715 = t::ID.new(:E715 , "Functional Group Acknowledgment Code" , 1, 1,
595
+ s::CodeList.build(
596
+ "A" => "Accepted",
597
+ "E" => "Accepted, But Errors Were Noted",
598
+ "M" => "Rejected, Message Authentication Code (MAC) Failed",
599
+ "P" => "Partially Accepted, At Least One Transaction Set Was Rejected",
600
+ "R" => "Rejected",
601
+ "W" => "Rejected, Assurance Failed Validity Tests",
602
+ "X" => "Rejected, Content After Decryption Could Not Be Analyzed"))
603
+
604
+ E716 = t::ID.new(:E716 , "Functional Group Syntax Error Code" , 1, 3,
605
+ s::CodeList.build(
606
+ "1" => "Functional Group Not Supported",
607
+ "2" => "Functional Group Version Not Supported",
608
+ "3" => "Functional Group Trailer Missing",
609
+ "4" => "Group Control Number in the Functional Group Header and Trailer Do Not Agree",
610
+ "5" => "Number of Included Transaction Sets Does Not Match Actual Count",
611
+ "6" => "Group Control Number Violates Syntax",
612
+ "10" => "Authentication Key Name Unknown",
613
+ "11" => "Encryption Key Name Unknown",
614
+ "12" => "Requested Service (Authentication or Encryption) Not Available",
615
+ "13" => "Unknown Security Recipient",
616
+ "14" => "Unknown Security Originator",
617
+ "15" => "Syntax Error in Decrypted Text",
618
+ "16" => "Security Not Supported",
619
+ "17" => "Incorrect Message Length (Encryption Only)",
620
+ "18" => "Message Authentication Code Failed",
621
+ "19" => "Functional Group Control Number not Unique within Interchange",
622
+ "23" => "S3E Security End Segment Missing for S3S Security Start Segment",
623
+ "24" => "S3S Security Start Segment Missing for S3E Security End Segment",
624
+ "25" => "S4E Security End Segment Missing for S4S Security Start Segment",
625
+ "26" => "S4S Security Start Segment Missing for S4E Security End Segment"))
626
+
627
+ E717 = t::ID.new(:E717 , "Transaction Set Acknowledgment Code" , 1, 1,
628
+ s::CodeList.build(
629
+ "A" => "Accepted",
630
+ "E" => "Accepted But Errors Were Reported",
631
+ "M" => "Rejected, Message Authentication Code (MAC) Failed",
632
+ "R" => "Rejected",
633
+ "W" => "Rejected, Assurance Failed Validity Tests",
634
+ "X" => "Rejected, Content After Decryption Could Not Be Analyzed"))
635
+
636
+ E719 = t::Nn.new(:E719 , "Segment Position in Transaction Set" , 1, 10, 0)
637
+ E721 = t::ID.new(:E721 , "Segment ID Code" , 2, 3)
638
+ # S77
639
+
640
+ E722 = t::Nn.new(:E722 , "Element Position in Segment" , 1, 2, 0)
641
+ E724 = t::AN.new(:E724 , "Copy of Bad Data Element" , 1, 99)
642
+ E725 = t::Nn.new(:E725 , "Data Element Reference Number" , 1, 4, 0)
643
+ # S77
644
+
645
+ E734 = t::AN.new(:E734 , "Hierarchical Parent ID Number" , 1, 12)
646
+ E735 = t::ID.new(:E735 , "Hierarchical Level Code" , 1, 2,
647
+ s::CodeList.build(
648
+ "19" => "Provider of Service",
649
+ "20" => "Information Source",
650
+ "21" => "Information Receiver",
651
+ "22" => "Subscriber",
652
+ "23" => "Dependent",
653
+ "PT" => "Patient"))
654
+
655
+ E736 = t::ID.new(:E736 , "Hierarchical Child Code" , 1, 1,
656
+ s::CodeList.build(
657
+ "0" => "No Subordinate HL Segment in This Hierarchical Structure",
658
+ "1" => "Additional Subordinate HL Data Segment in This Hierarchical Structure"))
659
+
660
+ E737 = t::ID.new(:E737 , "Measurement Reference ID Code" , 2, 2,
661
+ s::CodeList.build(
662
+ "OG" => "Original",
663
+ "TR" => "Test Results"))
664
+
665
+ E738 = t::ID.new(:E738 , "Measurement Qualifier" , 2, 2,
666
+ s::CodeList.build(
667
+ "HT" => "Height",
668
+ "R1" => "Hemoglobin",
669
+ "R2" => "Hematocrit",
670
+ "R3" => "Epoetin Starting Dosage",
671
+ "R4" => "Creatinine"))
672
+
673
+ E739 = t:: R.new(:E739 , "Measurement Value" , 1, 20)
674
+ E740 = t:: R.new(:E740 , "Range Minimum" , 1, 20)
675
+ E741 = t:: R.new(:E741 , "Range Maximum" , 1, 20)
676
+ E752 = t::ID.new(:E752 , "Surface/Layer/Position Code" , 2, 2)
677
+ E753 = t::ID.new(:E753 , "Measurement Method or Device" , 2, 4)
678
+ E755 = t::ID.new(:E755 , "Report Type Code" , 2, 2,
679
+ s::CodeList.build(
680
+ "03" => "Report Justifying Treatment Beyond Utilization Guidelines",
681
+ "04" => "Drugs Administered",
682
+ "05" => "Treatment Diagnosis",
683
+ "06" => "Initial Assesment",
684
+ "07" => "Functional Goals",
685
+ "08" => "Plan of Treatment",
686
+ "09" => "Progress Report",
687
+ "10" => "Continued Treatment",
688
+ "11" => "Chemical Analysis",
689
+ "13" => "Certified Test Report",
690
+ "15" => "Justification for Admission",
691
+ "21" => "Recovery Plan",
692
+ "A3" => "Allergies/Sensitivies Document",
693
+ "A4" => "Autopsy Report",
694
+ "AM" => "Ambulance Certification",
695
+ "AS" => "Admission Summary",
696
+ "B2" => "Prescription",
697
+ "B3" => "Physician Order",
698
+ "B4" => "Referral Form",
699
+ "BR" => "Benchmark Testing Results",
700
+ "BS" => "Baseline",
701
+ "BT" => "Blanket Test Results",
702
+ "CB" => "Chiropractic Justification",
703
+ "CK" => "Conset Form(s)",
704
+ "CT" => "Certification",
705
+ "D2" => "Drug Profile Document",
706
+ "DA" => "Dental Models",
707
+ "DB" => "Durable Medical Equipment Prescription",
708
+ "DG" => "Diagnostic Report",
709
+ "DJ" => "Discharge Monitoring Report",
710
+ "DS" => "Discharge Summary",
711
+ "EB" => "Explanation of Benefits (Coordination of Benefits or Medicare Secondary Payer)",
712
+ "HC" => "Health Cerification",
713
+ "HR" => "Health Clinic Records",
714
+ "I5" => "Immunization Record",
715
+ "IR" => "State School Immunization Records",
716
+ "LA" => "Laboratory Results",
717
+ "M1" => "Medical Record Attachment",
718
+ "MT" => "Models",
719
+ "NN" => "Nursing Notes",
720
+ "OB" => "Operative Note",
721
+ "OC" => "Oxygen Content Averaging Report",
722
+ "OD" => "Orders and Treatments Document",
723
+ "OE" => "Objective Physical Examination (including vital signs) Document",
724
+ "OX" => "Oxygen Therapy Certification",
725
+ "OZ" => "Support Data for Claim",
726
+ "P4" => "Pathology Report",
727
+ "P5" => "Patient Medical History Document",
728
+ "PE" => "Parenteral or Enteral Certification",
729
+ "PN" => "Physical Therapy Notes",
730
+ "PO" => "Prosthetics or Orthotic Certification",
731
+ "PQ" => "Paramedical Results",
732
+ "PY" => "Physician's Report",
733
+ "PZ" => "Physical Therapy Certification",
734
+ "RB" => "Radiology Films",
735
+ "RR" => "Radiology Reports",
736
+ "RT" => "Report of Tests and Analysis Report",
737
+ "RX" => "Renewable Oxygen Content Averaging Report",
738
+ "SG" => "Symptoms Document",
739
+ "V5" => "Death Notification",
740
+ "XP" => "Photographs"))
741
+
742
+ E756 = t::ID.new(:E756 , "Report Transmission Code" , 1, 2,
743
+ s::CodeList.build(
744
+ "AA" => "Available on Request at Provider Site",
745
+ "AB" => "Previously Submitted to Payer",
746
+ "AD" => "Certification Included in this Claim",
747
+ "AF" => "Narrative Segment Included in this Claim",
748
+ "AG" => "No Documentation is Required",
749
+ "BM" => "By Mail",
750
+ "EL" => "Electronically Only",
751
+ "EM" => "E-Mail",
752
+ "FT" => "File Transfer",
753
+ "FX" => "By Fax",
754
+ "NS" => "Not Specified",
755
+ "OL" => "On-Line"))
756
+
757
+ E757 = t::Nn.new(:E757 , "Report Copies Needed" , 1, 2, 0)
758
+ E782 = t:: R.new(:E782 , "Monetary Amount" , 1, 18)
759
+ E799 = t::AN.new(:E799 , "Version Identifier" , 1, 30)
760
+ E812 = t::ID.new(:E812 , "Payment Format Code" , 3, 3,
761
+ s::CodeList.build(
762
+ "CCP" => "Cash Concentration/Disbursement plus Addenda (CCD+)(ACH)",
763
+ "CTX" => "Corporate Trade Exchange (CTX) (ACH)"))
764
+
765
+ E901 = t::ID.new(:E901 , "Reject Reason Code" , 2, 2,
766
+ s::CodeList.build(
767
+ "T1" => "Cannot Identify Provider as TPO (Third Party Organization) Participant",
768
+ "T2" => "Cannot Identify Payer as TPO (Third Party Organization) Participant",
769
+ "T3" => "Cannot Identify Insured as TPO (Third Party Organization) Participant",
770
+ "T4" => "Payer Name or Identifier Missing",
771
+ "T5" => "Certification Information Missing",
772
+ "T6" => "Claim does not contain enough information for re-pricing"))
773
+
774
+ E923 = t::ID.new(:E923 , "Prognosis Code" , 1, 1)
775
+
776
+ E933 = t::AN.new(:E933 , "Free-form Message Text" , 1, 264)
777
+ E935 = t::ID.new(:E935 , "Measurement Significance Code" , 2, 2)
778
+ E936 = t::ID.new(:E936 , "Measurement Attribute Code" , 2, 2)
779
+ E954 = t:: R.new(:E954 , "Percentage as Decimal" , 1, 10)
780
+ E1005 = t::ID.new(:E1005, "Hierarchical Structure Code" , 4, 4,
781
+ s::CodeList.build(
782
+ "0019" => "Information Source, Subscriber, Dependent",
783
+ "0085" => "Information Source, Information Receiver, Provider of Service, Patient"))
784
+
785
+ E1018 = t:: R.new(:E1018, "Exponent" , 1, 15)
786
+ E1028 = t::AN.new(:E1028, "Claim Submitter's Identifier" , 1, 38)
787
+ E1029 = t::ID.new(:E1029, "Claim Status Code" , 1, 2,
788
+ s::CodeList.build(
789
+ "1" => "Processed as Primary",
790
+ "2" => "Processed as Secondary",
791
+ "3" => "Processed as Tertiary",
792
+ "4" => "Denied",
793
+ "19" => "Processed as Primary, Forwarded to Additional Payer(s)",
794
+ "20" => "Processed as Secondary, Forwarded to Additional Payer(s)",
795
+ "21" => "Processed as Tertiary, Forwarded to Additional Payer(s)",
796
+ "22" => "Reversal of Previous Payment",
797
+ "23" => "Not Our Claim, Forwarded to Additional Payer(s)",
798
+ "25" => "Predetermination Pricing Only - No Payment"))
799
+
800
+ E1032 = t::ID.new(:E1032, "Claim Filing Indicator Code" , 1, 2,
801
+ s::CodeList.build(
802
+ "11" => "Other Non-Federal Programs",
803
+ "12" => "Preferred Provider Organization (PPO)",
804
+ "13" => "Point of Service (POS)",
805
+ "14" => "Exclusive Provider Organization (EPO)",
806
+ "15" => "Indemnity Insurance",
807
+ "16" => "Health Maintenance Organization (HMO) Medicare Risk",
808
+ "17" => "Dentail Maintenance Organization",
809
+ "AM" => "Automobile Medical",
810
+ "BL" => "Blue Cross/Blue Shield",
811
+ "CH" => "Champus",
812
+ "CI" => "Commercial Insurance Co.",
813
+ "DS" => "Disability",
814
+ "FI" => "Federal Employees Program",
815
+ "HM" => "Health Maintenance Organization",
816
+ "LM" => "Liability Medical",
817
+ "MA" => "Medicare Part A",
818
+ "MB" => "Medicare Part B",
819
+ "MC" => "Medicaid",
820
+ "OF" => "Other Federal Program",
821
+ "TV" => "Title V",
822
+ "VA" => "Veterans Affairs Plan",
823
+ "WC" => "Worker's Compensation Health Claim",
824
+ "ZZ" => "Mutually Defined"))
825
+
826
+ E1033 = t::ID.new(:E1033, "Claim Adjustment Group Code" , 1, 12,
827
+ s::CodeList.build(
828
+ "CO" => "Contractual Obligations",
829
+ "CR" => "Corrections and Reversals",
830
+ "OA" => "Other adjustments",
831
+ "PI" => "Payor Initiated Reductions",
832
+ "PR" => "Patient Responsibility"))
833
+
834
+ E1034 = t::ID.new(:E1034, "Claim Adjustment Reason Code" , 1, 5,
835
+ s::CodeList.external("139"))
836
+
837
+ E1035 = t::AN.new(:E1035, "Name Last or Organization Name" , 1, 60)
838
+ E1036 = t::AN.new(:E1036, "Name First" , 1, 35)
839
+ E1037 = t::AN.new(:E1037, "Name Middle" , 1, 25)
840
+ E1038 = t::AN.new(:E1038, "Name Prefix" , 1, 10)
841
+ E1039 = t::AN.new(:E1039, "Name Suffix" , 1, 10)
842
+ E1048 = t::ID.new(:E1048, "Business Function Code" , 1, 3)
843
+ E1065 = t::ID.new(:E1065, "Entity Type Qualifier" , 1, 1,
844
+ s::CodeList.build(
845
+ "1" => "Person",
846
+ "2" => "Non-Person Entity"))
847
+
848
+ E1066 = t::ID.new(:E1066, "Citizenship Status Code" , 1, 2)
849
+ E1067 = t::ID.new(:E1067, "Marital Status Code" , 1, 1)
850
+ E1068 = t::ID.new(:E1068, "Gender Code" , 1, 1,
851
+ s::CodeList.build(
852
+ "F" => "Female",
853
+ "M" => "Male",
854
+ "U" => "Unknown"))
855
+
856
+ E1069 = t::ID.new(:E1069, "Individual Relationship Code" , 2, 2,
857
+ s::CodeList.build(
858
+ "01" => "Spouse",
859
+ "18" => "Self",
860
+ "19" => "Child",
861
+ "20" => "Employee",
862
+ "21" => "Unknown",
863
+ "39" => "Organ Donor",
864
+ "40" => "Cadaver Donor",
865
+ "53" => "Life Partner",
866
+ "G8" => "Other Relationship"))
867
+
868
+ E1073 = t::ID.new(:E1073, "Yes/No Condition or Response Code" , 1, 1,
869
+ s::CodeList.build(
870
+ "N" => "No",
871
+ "Y" => "Yes",
872
+ "W" => "Not Applicable"))
873
+
874
+ E1109 = t::ID.new(:E1109, "Race or Ethnicity Code" , 1, 1)
875
+ E1136 = t::ID.new(:E1136, "Code Category" , 2, 2,
876
+ s::CodeList.build(
877
+ "07" => "Ambulance Certification",
878
+ "09" => "Durable Medical Equipment Certification",
879
+ "12" => "Medicare Secondary Working Aged Beneficiary or Spouse with Employer Group Health Plan",
880
+ "13" => "Medicare Secondary End-Stage Renal Disease Beneficiary in Mandated Coordination Period with an Employer's Group Health Plan",
881
+ "14" => "Medicare Secondary, No-fault Insurance including Auto is Primary",
882
+ "15" => "Medicare Secondary Worker's Compensation",
883
+ "16" => "Medicare Secondary Public Health Service (PHS) or Other Federal Agency",
884
+ "41" => "Medicare Secondary Blank Lung",
885
+ "42" => "Medicare Secondary Veteran's Administration",
886
+ "43" => "Medicare Secondary Disabled Beneficiary Under Age 65 with Large Group Health Plan (LGHP)",
887
+ "47" => "Medicare Secondary, Other Liability Insurance is Primary",
888
+ "70" => "Hospice",
889
+ "75" => "Functional Limitations",
890
+ "E1" => "Spectacle Lenses",
891
+ "E2" => "Contact Lenses",
892
+ "E3" => "Spectacle Frames",
893
+ "ZZ" => "Mutually Defined"))
894
+
895
+ E1138 = t::ID.new(:E1138, "Payer Responsibility Sequence" , 1, 1,
896
+ s::CodeList.build(
897
+ "P" => "Primary",
898
+ "S" => "Secondary",
899
+ "T" => "Tertiary",
900
+ "U" => "Unknown",
901
+ "A" => "Payer Responsibility Four",
902
+ "B" => "Payer Responsibility Five",
903
+ "C" => "Payer Responsibility Six",
904
+ "D" => "Payer Responsibility Seven",
905
+ "E" => "Payer Responsibility Eight",
906
+ "F" => "Payer Responsibility Nine",
907
+ "G" => "Payer Responsibility Ten",
908
+ "H" => "Payer Responsibility Eleven"))
909
+
910
+ E1143 = t::ID.new(:E1143, "Coordination of Benefits Code" , 1, 1)
911
+ E1166 = t::ID.new(:E1166, "Contract Type Code" , 2, 2,
912
+ s::CodeList.build(
913
+ "01" => "Diagnosis Related Group (DRG)",
914
+ "02" => "Per Diem",
915
+ "03" => "Variable Per Diem",
916
+ "04" => "Flat",
917
+ "05" => "Captitated",
918
+ "06" => "Percent",
919
+ "09" => "Other"))
920
+
921
+ E1220 = t::ID.new(:E1220, "Student Status Code" , 1, 1)
922
+ E1221 = t::ID.new(:E1221, "Provider Code" , 1, 3,
923
+ s::CodeList.build(
924
+ "BI" => "Billing",
925
+ "PE" => "Performing"))
926
+
927
+ E1222 = t::AN.new(:E1222, "Provider Specialty Code" , 1, 3)
928
+ # @note Copied from an unverified 4010 internet source
929
+
930
+ E1223 = t::ID.new(:E1223, "Provider Organization Code" , 3, 3)
931
+ E1250 = t::ID.new(:E1250, "Date Time Period Format Qualifier" , 2, 3,
932
+ s::CodeList.build(
933
+ "CC" => "First Two Digits of Year Expressed in Format CCYY",
934
+ "CD" => "Month and Year Expressed in Format MMMYYY",
935
+ "CM" => "Date in Format CCYYMM",
936
+ "CQ" => "Date in Format CCYYQ",
937
+ "CY" => "Year Expressed in Format CCYY",
938
+ "D6" => "Date Expressed in Format YYMMDD",
939
+ "D8" => "Date Expressed in Format CCYYMMDD",
940
+ "DA" => "Range of Dates within a Single Month Expressed in Format DD-DD",
941
+ "DB" => "Date Expressed in Format MMDDCCYY",
942
+ "DD" => "Day of Month in Numeric Format",
943
+ "DDT" => "Range of Dates and Time Expressed in Format CCYYMMDD-CCYYMMDDHHMM",
944
+ "DT" => "Date and Time Expressed in Format CCYYMMDDHHMM",
945
+ "DTD" => "Range of Dates and Time Expressed in Format CCYYMMDDHHMM-CCYYMMDD",
946
+ "DTS" => "Range of Date and Time Expressed in Format CCYYMMDDHHMMSS-CCYYMMDDHHMMSS",
947
+ "EH" => "Last Digit of Year and Julian Date Expressed in Format YDDD",
948
+ "KA" => "Date Expressed in Format YYMMMDD",
949
+ "MD" => "Month of Year and Day of Month Expressed in Format MMDD",
950
+ "MM" => "Month of Year in Numeric Format",
951
+ "RD" => "Range of Dates Expressed in Format MMDDCCYY-MMDDCCYY",
952
+ "RD2" => "Range of Years Expressed in Format YY-YY",
953
+ "RD4" => "Range of Years Expressed in Format CCYY-CCYY",
954
+ "RD5" => "Range of Years and Months Expressed in Format CCYYMM-CCYYMM",
955
+ "RD6" => "Range of Dates Expressed in Format YYMMDD-YYMMDD",
956
+ "RD8" => "Range of Dates Expressed in Format CCYYMMDD-CCYYMMDD",
957
+ "RDM" => "Range of Dates Expressed in Format YYMMDD-MMDD",
958
+ "RDT" => "Range of Date and Time Expressed in Format CCYYMMDDHHMM-CCYYMMDDHHMM",
959
+ "RMD" => "Range of Months and Days Expressed in Format MMDD-MMDD",
960
+ "RMY" => "Range of Years and Months Expressed in Format YYMM-YYMM",
961
+ "RTM" => "Range of Time Expressed in Format HHMM-HHMM",
962
+ "RTS" => "Date and Time Expressed in Format CCYYMMDDHHMMSS",
963
+ "TC" => "Julian Date Expressed in Format DDD",
964
+ "TM" => "Time Expressed in Format HHMM",
965
+ "TQ" => "Date Expressed in Format MMYY",
966
+ "TR" => "Date and Time Expressed in Format DDMMYYHHMM",
967
+ "TS" => "Time Expressed in Format HHMMSS",
968
+ "TT" => "Date Expressed in Format MMDDYY",
969
+ "TU" => "Date EXpressed in Format YYDDD",
970
+ "UN" => "Unstructured",
971
+ "YM" => "Year and Month Expressed in Format YYMM",
972
+ "YMM" => "Range of Year and Month Expressed in Format CCYYMM-MMM",
973
+ "YY" => "Last Two Digits of Year Expressed in Format CCYY"))
974
+
975
+ E1251 = t::AN.new(:E1251, "Date Time Period" , 1, 35)
976
+ E1270 = t::ID.new(:E1270, "Code List Qualifier Code" , 1, 3,
977
+ s::CodeList.build(
978
+ "65" => s::CodeList.external("508"),
979
+ "68" => s::CodeList.external("682"),
980
+ "AAU" => s::CodeList.external("131"),
981
+ "AAW" => s::CodeList.external("133"),
982
+ "AAX" => s::CodeList.external("131"),
983
+ "AAY" => s::CodeList.external("135"),
984
+ "ABF" => s::CodeList.external("897"),
985
+ "ABJ" => s::CodeList.external("897"),
986
+ "ABK" => s::CodeList.external("897"),
987
+ "ABN" => s::CodeList.external("897"),
988
+ "ABU" => s::CodeList.external("897"),
989
+ "ABV" => s::CodeList.external("897"),
990
+ "ADD" => s::CodeList.external("897"),
991
+ "APR" => s::CodeList.external("897"),
992
+ "AS" => s::CodeList.external("656"),
993
+ "ASD" => s::CodeList.external("897"),
994
+ "ATD" => s::CodeList.external("897"),
995
+ "CAH" => s::CodeList.external("843"),
996
+ "BBQ" => s::CodeList.external("896"),
997
+ "BBR" => s::CodeList.external("896"),
998
+ "BE" => s::CodeList.external("132"),
999
+ "BF" => s::CodeList.external("131"),
1000
+ "BG" => s::CodeList.external("132"),
1001
+ "BH" => s::CodeList.external("132"),
1002
+ "BI" => s::CodeList.external("132"),
1003
+ "BK" => s::CodeList.external("131"),
1004
+ "BJ" => s::CodeList.external("131"),
1005
+ "BN" => s::CodeList.external("131"),
1006
+ "BO" => s::CodeList.external("130"),
1007
+ "BP" => s::CodeList.external("130"),
1008
+ "BQ" => s::CodeList.external("131"),
1009
+ "BR" => s::CodeList.external("131"),
1010
+ "BT" => s::CodeList.external("407"),
1011
+ "BU" => s::CodeList.external("407"),
1012
+ "BS" => s::CodeList.external("133"),
1013
+ "DD" => s::CodeList.external("131"),
1014
+ "DR" => s::CodeList.external("229"),
1015
+ "EK" => s::CodeList.external("407"),
1016
+ "GR" => s::CodeList.external("284"),
1017
+ "GS" => s::CodeList.external("407"),
1018
+ "GU" => s::CodeList.external("407"),
1019
+ "GW" => s::CodeList.external("407"),
1020
+ "HE" => s::CodeList.external("411"),
1021
+ "HI" => s::CodeList.external("121"),
1022
+ "HO" => s::CodeList.external("537"),
1023
+ "JO" => s::CodeList.external("135"),
1024
+ "JP" => s::CodeList.external("135"),
1025
+ "LOI" => s::CodeList.external("663"),
1026
+ "NUB" => s::CodeList.external("132"),
1027
+ "NDC" => s::CodeList.external("240"),
1028
+ "PR" => s::CodeList.external("131"),
1029
+ "PB" => s::CodeList.external("407"),
1030
+ "REC" => s::CodeList.external("860"),
1031
+ "RET" => s::CodeList.external("859"),
1032
+ "RX" => s::CodeList.external("530"),
1033
+ "S" => s::CodeList.external("327"),
1034
+ "SD" => s::CodeList.external("131"),
1035
+ "SJ" => s::CodeList.external("407"),
1036
+ "SL" => s::CodeList.external("407"),
1037
+ "TC" => s::CodeList.external("359"),
1038
+ "TD" => s::CodeList.external("131"),
1039
+ "TQ" => s::CodeList.external("135"),
1040
+ "UT" => s::CodeList.external("528")))
1041
+
1042
+ E1271 = t::AN.new(:E1271, "Industry Code" , 1, 30,
1043
+ s::CodeList.external("508"))
1044
+
1045
+ E1314 = t::ID.new(:E1314, "Admission Source Code" , 1, 1,
1046
+ s::CodeList.external("230"))
1047
+
1048
+ E1315 = t::ID.new(:E1315, "Admission Type Code" , 1, 1,
1049
+ s::CodeList.external("231"))
1050
+
1051
+ E1316 = t::ID.new(:E1316, "Ambulance Transport Code" , 1, 1)
1052
+ E1317 = t::ID.new(:E1317, "Ambulance Transport Reason Code" , 1, 1,
1053
+ s::CodeList.build(
1054
+ "A" => "Patient was transported to nearest facility for care of symptoms, complaints, or both",
1055
+ "B" => "Patient was transported for the benefit of a preferred physician",
1056
+ "C" => "Patient was transported for the nearness of family members",
1057
+ "D" => "Patient was transported for the care of a specialist or for availability of specialized equipment",
1058
+ "E" => "Patient Transferred to Rehabilitation Facility"))
1059
+
1060
+ E1321 = t::ID.new(:E1321, "Condition Indicator" , 2, 3,
1061
+ s::CodeList.build(
1062
+ "01" => "Patient was admitted to a hospital",
1063
+ "04" => "Patient was moved by stretcher",
1064
+ "05" => "Patient was unconscious or in shock",
1065
+ "06" => "Patient was transported in an emergency situation",
1066
+ "07" => "Patient had to be physically restrained",
1067
+ "08" => "Patient had visible hemorrhaging",
1068
+ "09" => "Ambulance service was medically necessary",
1069
+ "12" => "Patient is confined to a bed or chair",
1070
+ "38" => "Certification signed by the physician is on file at the supplier's office",
1071
+ "65" => "Open",
1072
+ "AV" => "Available - Not Used",
1073
+ "IH" => "Independent at Home",
1074
+ "L1" => "General Standard of 20 Degree or .5 Diopter Sphere or Cylinder Change Met",
1075
+ "L2" => "Replacement Due to Loss or Theft",
1076
+ "L3" => "Replacement Due to Breakage or Damage",
1077
+ "L4" => "Replacement Due to Patient Preference",
1078
+ "L5" => "Replacement Due to Medical Reason",
1079
+ "NU" => "Not Used",
1080
+ "S2" => "Under Treatment",
1081
+ "ST" => "New Services Requested",
1082
+ "ZV" => "Replacement Item"))
1083
+
1084
+ E1322 = t::ID.new(:E1322, "Certification Type Code" , 1, 1,
1085
+ s::CodeList.build(
1086
+ "I" => "Initial",
1087
+ "R" => "Renewal",
1088
+ "S" => "Revised"))
1089
+
1090
+ E1325 = t::ID.new(:E1325, "Claim Frequency Type Code" , 1, 1,
1091
+ s::CodeList.external("235"))
1092
+
1093
+ E1327 = t::ID.new(:E1327, "Copay Status Code" , 1, 1,
1094
+ s::CodeList.build(
1095
+ "0" => "Copay exempt"))
1096
+
1097
+ E1328 = t::Nn.new(:E1328, "Diagnosis Code Pointer" , 1, 2, 0)
1098
+ E1331 = t::AN.new(:E1331, "Facility Code Value" , 1, 2)
1099
+ # S237
1100
+
1101
+ E1332 = t::ID.new(:E1332, "Facility Code Qualifier" , 1, 2,
1102
+ s::CodeList.build(
1103
+ "A" => s::CodeList.external("236"),
1104
+ "B" => s::CodeList.external("237")))
1105
+
1106
+ E1333 = t::ID.new(:E1333, "Record Format Code" , 1, 2)
1107
+ E1334 = t::ID.new(:E1334, "Professional Shortage Area Code" , 1, 1)
1108
+ E1335 = t::ID.new(:E1335, "Insulin Type Code" , 1, 3)
1109
+ E1336 = t::ID.new(:E1336, "Insurance Type Code" , 1, 3,
1110
+ s::CodeList.build(
1111
+ "02" => "Physically Handicapped Children's Program",
1112
+ "03" => "Special Federal Funding",
1113
+ "05" => "Disability",
1114
+ "09" => "Second Opinion or Surgery",
1115
+ "12" => "Medicare Secondary Working Aged Beneficiary or Spouse with Employer Group Health Plan",
1116
+ "13" => "Medicare Secondary End-Stage Renal Disease Beneficiary in the Mandated Coordination Period",
1117
+ "14" => "Medicare Secondary, No-fault Insurance including Auto is Primary",
1118
+ "15" => "Medicare Secondary Worker's Compensation",
1119
+ "16" => "Medicare Secondary Public Health Service (PHS) or Other Federal Agency",
1120
+ "41" => "Medicare Secondary Blank Lung",
1121
+ "42" => "Medicare Secondary Veteran's Administration",
1122
+ "43" => "Medicare Secondary Disabled Beneficiary Under Age 65 with Large Group Health Plan (LGHP)",
1123
+ "47" => "Medicare Secondary, Other Liability Insurance is Primary"))
1124
+
1125
+ E1337 = t::ID.new(:E1337, "Level of Care Code" , 1, 1)
1126
+ E1338 = t::ID.new(:E1338, "Level of Service Code" , 1, 3)
1127
+ E1339 = t::AN.new(:E1339, "Procedure Modifier" , 2, 2)
1128
+ E1340 = t::ID.new(:E1340, "Multiple Procedure Code" , 1, 2)
1129
+ E1341 = t::AN.new(:E1341, "National or Local Assigned Review" , 1, 2)
1130
+ E1342 = t::ID.new(:E1342, "Nature of Condition Code" , 1, 1,
1131
+ s::CodeList.build(
1132
+ "A" => "Acute Condition",
1133
+ "C" => "Chronic Condition",
1134
+ "D" => "Non-acute",
1135
+ "E" => "Non-Life Threatening",
1136
+ "F" => "Routine",
1137
+ "G" => "Symptomatic",
1138
+ "M" => "Acute Manifestation of a Chronic Condition"))
1139
+
1140
+ E1343 = t::ID.new(:E1343, "Non-Institutional Claim Type Code" , 1, 2)
1141
+ E1345 = t::ID.new(:E1345, "Nursing Home Residential Status Code" , 1, 1)
1142
+ E1351 = t::ID.new(:E1351, "Patient Signature Source Code" , 1, 1,
1143
+ s::CodeList.build(
1144
+ "P" => "Signature generated by provider because the patient was not physically present for services"))
1145
+
1146
+ E1352 = t::ID.new(:E1352, "Patient Status Code" , 1, 2,
1147
+ s::CodeList.external("239"))
1148
+
1149
+ E1354 = t::ID.new(:E1354, "Diagnosis Related Group (DRG) Code" , 1, 4,
1150
+ s::CodeList.external("229"))
1151
+
1152
+ E1358 = t::ID.new(:E1358, "Prosthesis, Crown, or Inlay Code" , 1, 1)
1153
+ E1359 = t::ID.new(:E1359, "Provider Accept Assignment Code" , 1, 1,
1154
+ s::CodeList.build(
1155
+ "A" => "Assigned",
1156
+ "B" => "Assigned Accepted on Clinical Lab Services Only",
1157
+ "C" => "Not Assigned"))
1158
+
1159
+ E1360 = t::ID.new(:E1360, "Provider Agreement Code" , 1, 1)
1160
+ E1361 = t::ID.new(:E1361, "Oral Cavity Designation Code" , 1, 3,
1161
+ s::CodeList.external("135"))
1162
+
1163
+ E1362 = t::ID.new(:E1362, "Related-Causes Code" , 2, 3,
1164
+ s::CodeList.build(
1165
+ "AA" => "Auto Accident",
1166
+ "EM" => "Employment",
1167
+ "OA" => "Other Accident"))
1168
+
1169
+ E1363 = t::ID.new(:E1363, "Release of Information Code" , 1, 1,
1170
+ s::CodeList.build(
1171
+ "I" => "Informed Consent to Release Medical Information for Conditions or Diagnoses Regulated by Federal Statutes",
1172
+ "Y" => "Yes, Provider has a Signed Statement Permitting Release of Medical Billing Data Related to a Claim"))
1173
+
1174
+ E1364 = t::ID.new(:E1364, "Review Code" , 1, 2)
1175
+ E1365 = t::ID.new(:E1365, "Service Type Code" , 1, 2)
1176
+ E1366 = t::ID.new(:E1366, "Special Program Code" , 2, 3)
1177
+ E1367 = t::ID.new(:E1367, "Sublaxation Level Code" , 2, 3)
1178
+ E1368 = t::ID.new(:E1368, "Tooth Status Code" , 1, 2)
1179
+ E1369 = t::ID.new(:E1369, "Tooth Surface Code" , 1, 2)
1180
+ E1371 = t:: R.new(:E1371, "Unit Rate" , 1, 10)
1181
+ E1383 = t::ID.new(:E1383, "Claim Submission Reason Code" , 2, 2)
1182
+ E1384 = t::ID.new(:E1384, "Patient Location Code" , 1, 1)
1183
+ E1473 = t::ID.new(:E1473, "Pricing Methodology" , 2, 2,
1184
+ s::CodeList.build(
1185
+ "00" => "Zero Pricing (Not Covered Under Contract)",
1186
+ "01" => "Priced as Billed at 100%",
1187
+ "02" => "Priced at the Standard Fee Schedule",
1188
+ "03" => "Priced at a Contractual Percentage",
1189
+ "04" => "Bundled Pricing",
1190
+ "05" => "Peer Review Pricing",
1191
+ "06" => "Per Diem Pricing",
1192
+ "07" => "Flat Rate Pricing",
1193
+ "08" => "Combination Pricing",
1194
+ "09" => "Maternity Pricing",
1195
+ "10" => "Other Pricing",
1196
+ "11" => "Lower of Cost",
1197
+ "12" => "Ratio of Cost",
1198
+ "13" => "Cost Reimbursed",
1199
+ "14" => "Adjustment Pricing"))
1200
+
1201
+ E1514 = t::ID.new(:E1514, "Delay Reason Code" , 1, 2,
1202
+ s::CodeList.build(
1203
+ "1" => "Proof of Eligibility Unknown or Unavailable",
1204
+ "2" => "Litigation",
1205
+ "3" => "Authorization Delays",
1206
+ "4" => "Delay in Certifying Provider",
1207
+ "5" => "Delay in Shipping Billing Forms",
1208
+ "6" => "Delay in Delivery of Custom-made Appliances",
1209
+ "7" => "Third Party Processing Delay",
1210
+ "8" => "Delay in Eligibility Determination",
1211
+ "9" => "Original Claim Rejected or Denied Due to a Reason Unrelated to the Billing Limitation Rules",
1212
+ "10" => "Administration Delay in the Prior Approval Process",
1213
+ "11" => "Other",
1214
+ "15" => "Natural Disaster"))
1215
+
1216
+ E1525 = t::ID.new(:E1525, "Request Category Code" , 1, 2)
1217
+ E1526 = t::ID.new(:E1526, "Policy Compliance Code" , 1, 2,
1218
+ s::CodeList.build(
1219
+ "1" => "Procedure Followed (Compliance)",
1220
+ "2" => "Not Followed - Call Not Made (Non-Compliance Call Not Made)",
1221
+ "3" => "Not Medically Necessary (Non-Compliance Non-Medically Necessary)",
1222
+ "4" => "Not Followed Other (Non-Compliance Other)",
1223
+ "5" => "Emergency Admit to Non-Network Hospital"))
1224
+
1225
+ E1527 = t::ID.new(:E1527, "Exception Code" , 1, 2,
1226
+ s::CodeList.build(
1227
+ "1" => "Non-Network Professional Provider in Network Hospital",
1228
+ "2" => "Emergency Care",
1229
+ "3" => "Services or Specialist not in Network",
1230
+ "4" => "Out-of-Service Area",
1231
+ "5" => "State Mandates",
1232
+ "6" => "Other"))
1233
+
1234
+ E1528 = t::Nn.new(:E1528, "Component Data Element Position in Composite", 1, 2, 0)
1235
+ E1686 = t::Nn.new(:E1686, "Repeating Data Element Position" , 1, 4, 0)
1236
+ E1705 = t::AN.new(:E1705, "Implementation Convention Reference" , 1, 35)
1237
+ E1715 = t::ID.new(:E1715, "Country Subdivision Code" , 1, 3,
1238
+ s::CodeList.external("5"))
1239
+
1240
+ E9998 = t::AN.new(:E9998, "Context Reference" , 1, 35)
1241
+ E9999 = t::AN.new(:E9998, "Context Name" , 1, 35)
1242
+
1243
+ C001 = Schema::CompositeElementDef.build(:C001,
1244
+ "Composite Unit of Measure",
1245
+ "To identify a composite unit of measure",
1246
+ E355 .component_use(r::Mandatory),
1247
+ E1018.component_use(r::Optional),
1248
+ E649 .component_use(r::Optional),
1249
+ E355 .component_use(r::Optional),
1250
+ E1018.component_use(r::Optional),
1251
+ E649 .component_use(r::Optional),
1252
+ E355 .component_use(r::Optional),
1253
+ E1018.component_use(r::Optional),
1254
+ E649 .component_use(r::Optional),
1255
+ E355 .component_use(r::Optional),
1256
+ E1018.component_use(r::Optional), # If not used, value is interpreted as 1
1257
+ E649 .component_use(r::Optional), # If not used, value is interpreted as 1
1258
+ E355 .component_use(r::Optional),
1259
+ E1018.component_use(r::Optional), # If not used, value is interpreted as 1
1260
+ E649 .component_use(r::Optional)) # If not used, value is interpreted as 1
1261
+
1262
+ # @note Copied from an unverified 4010 internet source
1263
+ C002 = Schema::CompositeElementDef.build(:C002,
1264
+ "Actions Indicated",
1265
+ "",
1266
+ E704.component_use(r::Mandatory),
1267
+ E704.component_use(r::Optional),
1268
+ E704.component_use(r::Optional),
1269
+ E704.component_use(r::Optional),
1270
+ E704.component_use(r::Optional))
1271
+
1272
+ C003 = Schema::CompositeElementDef.build(:C003,
1273
+ "Composite Medical Procedure Identifier",
1274
+ "To identify a procedure by its standardized codes and applicable modifiers",
1275
+ E235 .component_use(r::Mandatory),
1276
+ E234 .component_use(r::Mandatory), # Qualified by C003-01
1277
+ E1339.component_use(r::Optional),
1278
+ E1339.component_use(r::Optional),
1279
+ E1339.component_use(r::Optional),
1280
+ E1339.component_use(r::Optional),
1281
+ E352 .component_use(r::Optional),
1282
+ E234 .component_use(r::Optional)) # Qualified by C003-01
1283
+
1284
+ C004 = Schema::CompositeElementDef.build(:C004,
1285
+ "Composite Diagnosis Code Pointer",
1286
+ "To identify one or more diagnosis code pointers",
1287
+ E1328.component_use(r::Mandatory),
1288
+ E1328.component_use(r::Optional),
1289
+ E1328.component_use(r::Optional),
1290
+ E1328.component_use(r::Optional))
1291
+
1292
+ C005 = Schema::CompositeElementDef.build(:C005,
1293
+ "Tooth Surface",
1294
+ "To identify one or more tooth surface codes",
1295
+ E1369.component_use(r::Mandatory),
1296
+ E1369.component_use(r::Optional),
1297
+ E1369.component_use(r::Optional),
1298
+ E1369.component_use(r::Optional),
1299
+ E1369.component_use(r::Optional))
1300
+
1301
+ C006 = Schema::CompositeElementDef.build(:C006,
1302
+ "Oral Cavity Designation",
1303
+ "To identify one or more areas of oral cavity",
1304
+ E1361.component_use(r::Mandatory),
1305
+ E1361.component_use(r::Optional),
1306
+ E1361.component_use(r::Optional),
1307
+ E1361.component_use(r::Optional),
1308
+ E1361.component_use(r::Optional))
1309
+
1310
+ C022 = Schema::CompositeElementDef.build(:C022,
1311
+ "Health Care Code Information",
1312
+ "To send health care codes and their associated dates, amounts and quantities",
1313
+ E1270.component_use(r::Mandatory),
1314
+ E1271.component_use(r::Mandatory),
1315
+ E1250.component_use(r::Relational),
1316
+ E1251.component_use(r::Relational),
1317
+ E782 .component_use(r::Optional),
1318
+ E380 .component_use(r::Optional),
1319
+ E799 .component_use(r::Optional),
1320
+ E1271.component_use(r::Relational),
1321
+ E1073.component_use(r::Relational),
1322
+ SyntaxNotes::P.build(3, 4),
1323
+ SyntaxNotes::E.build(8, 9))
1324
+
1325
+ C023 = Schema::CompositeElementDef.build(:C023,
1326
+ "Health Care Service Location Information",
1327
+ "To provide information that identifies the place of service or the type of bill related to the location at which a health care service was rendered",
1328
+ E1331 .component_use(r::Mandatory),
1329
+ E1332 .component_use(r::Optional),
1330
+ E1325 .component_use(r::Optional))
1331
+
1332
+ C024 = Schema::CompositeElementDef.build(:C024,
1333
+ "Related Causes Information",
1334
+ "To identify one or more related causes and associated state or country information",
1335
+ E1362.component_use(r::Optional),
1336
+ E1362.component_use(r::Mandatory),
1337
+ E1362.component_use(r::Optional),
1338
+ E156 .component_use(r::Optional),
1339
+ E26 .component_use(r::Optional))
1340
+
1341
+ C030 = Schema::CompositeElementDef.build(:C030,
1342
+ "Position in Segment",
1343
+ "Code indicating the relative position of the simple data element or composite data structure in error within a segment, count beginning with 1 for the position immediately following the segment ID; additionally, indicating the relative position of a repeating structure in error, count beginning with 1 for the position immediately following the preceding element separator; additionally indicating the relative position of a component of a composite data structure in error, count beginning with 1 for the position following the preceding element or repetition separator",
1344
+ E722 .component_use(r::Mandatory),
1345
+ E1528.component_use(r::Optional),
1346
+ E1686.component_use(r::Optional))
1347
+
1348
+ # @note Copied from an unverified 4010 internet source
1349
+ C035 = Schema::CompositeElementDef.build(:C035,
1350
+ "Provider Specialty Information",
1351
+ "",
1352
+ E1222.component_use(r::Mandatory),
1353
+ E559 .component_use(r::Optional),
1354
+ E1073.component_use(r::Optional))
1355
+
1356
+ C040 = Schema::CompositeElementDef.build(:C040,
1357
+ "Reference Identifier",
1358
+ "To identify one or more reference numbers or identification numbers as specified by the Reference Qualifier",
1359
+ E128 .component_use(r::Mandatory),
1360
+ E127 .component_use(r::Mandatory),
1361
+ E128 .component_use(r::Relational),
1362
+ E127 .component_use(r::Relational),
1363
+ E128 .component_use(r::Relational),
1364
+ E127 .component_use(r::Relational),
1365
+ SyntaxNotes::P.build(3, 4),
1366
+ SyntaxNotes::P.build(5, 6))
1367
+
1368
+ C042 = Schema::CompositeElementDef.build(:C042,
1369
+ "Adjustment Identifier",
1370
+ "To provide the category and identifying reference information for an adjustment",
1371
+ E426 .component_use(r::Mandatory),
1372
+ E127 .component_use(r::Optional))
1373
+
1374
+ C043 = Schema::CompositeElementDef.build(:C043,
1375
+ "Health Care Claim Status",
1376
+ "Used to convey status of the entire claim or a specific service line",
1377
+ E1271.component_use(r::Mandatory),
1378
+ E1271.component_use(r::Mandatory),
1379
+ E98 .component_use(r::Optional),
1380
+ E1270.component_use(r::Optional))
1381
+
1382
+ C056 = Schema::CompositeElementDef.build(:C056,
1383
+ "Composite Race or Ethnicity Information",
1384
+ "",
1385
+ E1109.component_use(r::Optional),
1386
+ E1270.component_use(r::Relational),
1387
+ E1271.component_use(r::Relational))
1388
+
1389
+ C998 = Schema::CompositeElementDef.build(:C998,
1390
+ "Context Identification",
1391
+ "Holds information to identify a context",
1392
+ E9999.component_use(r::Mandatory),
1393
+ E9998.component_use(r::Optional))
1394
+
1395
+ C999 = Schema::CompositeElementDef.build(:C999,
1396
+ "Reference in Segment",
1397
+ "To hold the reference number of a data element and optionally component data element within a composite",
1398
+ E725.component_use(r::Mandatory),
1399
+ E725.component_use(r::Mandatory))
1400
+
1401
+ end
1402
+ end
1403
+ end
1404
+ end
1405
+ end