hippo_eyeDoc 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG +124 -0
- data/Gemfile +10 -0
- data/Guardfile +14 -0
- data/LICENSE +24 -0
- data/README.md +385 -0
- data/Rakefile +12 -0
- data/hippo_eyeDoc.gemspec +25 -0
- data/lib/hippo_eyeDoc.rb +15 -0
- data/lib/hippo_eyeDoc/code_lists.rb +10 -0
- data/lib/hippo_eyeDoc/code_lists/claim_adjustment_reason_codes.rb +2252 -0
- data/lib/hippo_eyeDoc/code_lists/claim_status_category_codes.rb +376 -0
- data/lib/hippo_eyeDoc/code_lists/claim_status_codes.rb +5456 -0
- data/lib/hippo_eyeDoc/code_lists/remittance_advice_remark_codes.rb +6280 -0
- data/lib/hippo_eyeDoc/code_lists/service_type_codes.rb +1299 -0
- data/lib/hippo_eyeDoc/code_lists/taxonomy_codes.rb +9224 -0
- data/lib/hippo_eyeDoc/exceptions.rb +10 -0
- data/lib/hippo_eyeDoc/field.rb +149 -0
- data/lib/hippo_eyeDoc/outputters.rb +4 -0
- data/lib/hippo_eyeDoc/outputters/html.rb +39 -0
- data/lib/hippo_eyeDoc/outputters/paper_claim.rb +7 -0
- data/lib/hippo_eyeDoc/outputters/pdf.rb +18 -0
- data/lib/hippo_eyeDoc/outputters/pretty_string.rb +45 -0
- data/lib/hippo_eyeDoc/parser.rb +70 -0
- data/lib/hippo_eyeDoc/parser/segment.rb +35 -0
- data/lib/hippo_eyeDoc/parser/transaction_set.rb +45 -0
- data/lib/hippo_eyeDoc/segments.rb +111 -0
- data/lib/hippo_eyeDoc/segments/AAA.rb +39 -0
- data/lib/hippo_eyeDoc/segments/AK1.rb +31 -0
- data/lib/hippo_eyeDoc/segments/AK2.rb +31 -0
- data/lib/hippo_eyeDoc/segments/AK3.rb +39 -0
- data/lib/hippo_eyeDoc/segments/AK4.rb +59 -0
- data/lib/hippo_eyeDoc/segments/AK5.rb +55 -0
- data/lib/hippo_eyeDoc/segments/AK9.rb +79 -0
- data/lib/hippo_eyeDoc/segments/AMT.rb +31 -0
- data/lib/hippo_eyeDoc/segments/BHT.rb +55 -0
- data/lib/hippo_eyeDoc/segments/BPR.rb +175 -0
- data/lib/hippo_eyeDoc/segments/CAS.rb +159 -0
- data/lib/hippo_eyeDoc/segments/CL1.rb +39 -0
- data/lib/hippo_eyeDoc/segments/CLM.rb +223 -0
- data/lib/hippo_eyeDoc/segments/CLP.rb +119 -0
- data/lib/hippo_eyeDoc/segments/CN1.rb +55 -0
- data/lib/hippo_eyeDoc/segments/CR1.rb +87 -0
- data/lib/hippo_eyeDoc/segments/CR2.rb +103 -0
- data/lib/hippo_eyeDoc/segments/CR3.rb +47 -0
- data/lib/hippo_eyeDoc/segments/CR4.rb +239 -0
- data/lib/hippo_eyeDoc/segments/CR5.rb +151 -0
- data/lib/hippo_eyeDoc/segments/CR6.rb +175 -0
- data/lib/hippo_eyeDoc/segments/CR7.rb +31 -0
- data/lib/hippo_eyeDoc/segments/CR8.rb +79 -0
- data/lib/hippo_eyeDoc/segments/CRC.rb +63 -0
- data/lib/hippo_eyeDoc/segments/CTP.rb +211 -0
- data/lib/hippo_eyeDoc/segments/CTX.rb +99 -0
- data/lib/hippo_eyeDoc/segments/CUR.rb +175 -0
- data/lib/hippo_eyeDoc/segments/DMG.rb +115 -0
- data/lib/hippo_eyeDoc/segments/DN1.rb +39 -0
- data/lib/hippo_eyeDoc/segments/DN2.rb +55 -0
- data/lib/hippo_eyeDoc/segments/DSB.rb +71 -0
- data/lib/hippo_eyeDoc/segments/DTM.rb +55 -0
- data/lib/hippo_eyeDoc/segments/DTP.rb +31 -0
- data/lib/hippo_eyeDoc/segments/EB.rb +207 -0
- data/lib/hippo_eyeDoc/segments/EM.rb +63 -0
- data/lib/hippo_eyeDoc/segments/EQ.rb +135 -0
- data/lib/hippo_eyeDoc/segments/FRM.rb +47 -0
- data/lib/hippo_eyeDoc/segments/GE.rb +23 -0
- data/lib/hippo_eyeDoc/segments/GS.rb +71 -0
- data/lib/hippo_eyeDoc/segments/HCP.rb +127 -0
- data/lib/hippo_eyeDoc/segments/HI.rb +919 -0
- data/lib/hippo_eyeDoc/segments/HL.rb +44 -0
- data/lib/hippo_eyeDoc/segments/HSD.rb +71 -0
- data/lib/hippo_eyeDoc/segments/IEA.rb +23 -0
- data/lib/hippo_eyeDoc/segments/III.rb +195 -0
- data/lib/hippo_eyeDoc/segments/IK3.rb +39 -0
- data/lib/hippo_eyeDoc/segments/IK4.rb +59 -0
- data/lib/hippo_eyeDoc/segments/IK5.rb +55 -0
- data/lib/hippo_eyeDoc/segments/IMM.rb +55 -0
- data/lib/hippo_eyeDoc/segments/INS.rb +171 -0
- data/lib/hippo_eyeDoc/segments/ISA.rb +136 -0
- data/lib/hippo_eyeDoc/segments/K3.rb +147 -0
- data/lib/hippo_eyeDoc/segments/LE.rb +15 -0
- data/lib/hippo_eyeDoc/segments/LIN.rb +255 -0
- data/lib/hippo_eyeDoc/segments/LQ.rb +23 -0
- data/lib/hippo_eyeDoc/segments/LS.rb +15 -0
- data/lib/hippo_eyeDoc/segments/LX.rb +20 -0
- data/lib/hippo_eyeDoc/segments/MEA.rb +219 -0
- data/lib/hippo_eyeDoc/segments/MIA.rb +199 -0
- data/lib/hippo_eyeDoc/segments/MOA.rb +79 -0
- data/lib/hippo_eyeDoc/segments/MPI.rb +63 -0
- data/lib/hippo_eyeDoc/segments/MSG.rb +31 -0
- data/lib/hippo_eyeDoc/segments/N1.rb +55 -0
- data/lib/hippo_eyeDoc/segments/N2.rb +23 -0
- data/lib/hippo_eyeDoc/segments/N3.rb +23 -0
- data/lib/hippo_eyeDoc/segments/N4.rb +63 -0
- data/lib/hippo_eyeDoc/segments/NM1.rb +103 -0
- data/lib/hippo_eyeDoc/segments/NTE.rb +23 -0
- data/lib/hippo_eyeDoc/segments/OI.rb +55 -0
- data/lib/hippo_eyeDoc/segments/PAT.rb +79 -0
- data/lib/hippo_eyeDoc/segments/PCT.rb +23 -0
- data/lib/hippo_eyeDoc/segments/PDP.rb +31 -0
- data/lib/hippo_eyeDoc/segments/PDR.rb +39 -0
- data/lib/hippo_eyeDoc/segments/PER.rb +79 -0
- data/lib/hippo_eyeDoc/segments/PID.rb +79 -0
- data/lib/hippo_eyeDoc/segments/PKD.rb +47 -0
- data/lib/hippo_eyeDoc/segments/PLB.rb +191 -0
- data/lib/hippo_eyeDoc/segments/PRV.rb +75 -0
- data/lib/hippo_eyeDoc/segments/PS1.rb +31 -0
- data/lib/hippo_eyeDoc/segments/PWK.rb +115 -0
- data/lib/hippo_eyeDoc/segments/QTY.rb +155 -0
- data/lib/hippo_eyeDoc/segments/RDM.rb +135 -0
- data/lib/hippo_eyeDoc/segments/REF.rb +83 -0
- data/lib/hippo_eyeDoc/segments/SBR.rb +79 -0
- data/lib/hippo_eyeDoc/segments/SD1.rb +71 -0
- data/lib/hippo_eyeDoc/segments/SE.rb +23 -0
- data/lib/hippo_eyeDoc/segments/ST.rb +31 -0
- data/lib/hippo_eyeDoc/segments/STC.rb +187 -0
- data/lib/hippo_eyeDoc/segments/SV1.rb +263 -0
- data/lib/hippo_eyeDoc/segments/SV2.rb +147 -0
- data/lib/hippo_eyeDoc/segments/SV3.rb +219 -0
- data/lib/hippo_eyeDoc/segments/SV4.rb +211 -0
- data/lib/hippo_eyeDoc/segments/SV5.rb +123 -0
- data/lib/hippo_eyeDoc/segments/SV6.rb +151 -0
- data/lib/hippo_eyeDoc/segments/SV7.rb +55 -0
- data/lib/hippo_eyeDoc/segments/SVC.rb +183 -0
- data/lib/hippo_eyeDoc/segments/SVD.rb +115 -0
- data/lib/hippo_eyeDoc/segments/TA1.rb +46 -0
- data/lib/hippo_eyeDoc/segments/TOO.rb +67 -0
- data/lib/hippo_eyeDoc/segments/TRN.rb +39 -0
- data/lib/hippo_eyeDoc/segments/TS2.rb +159 -0
- data/lib/hippo_eyeDoc/segments/TS3.rb +199 -0
- data/lib/hippo_eyeDoc/segments/UR.rb +23 -0
- data/lib/hippo_eyeDoc/segments/VEH.rb +159 -0
- data/lib/hippo_eyeDoc/segments/base.rb +190 -0
- data/lib/hippo_eyeDoc/separator.rb +79 -0
- data/lib/hippo_eyeDoc/transaction_sets.rb +16 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270.rb +15 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000A.rb +43 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000B.rb +42 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000C.rb +52 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2000D.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100A.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100B.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100C.rb +97 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2100D.rb +0 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2110C.rb +67 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/L2110D.rb +47 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_270/base.rb +47 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271.rb +19 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000A.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000B.rb +43 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000C.rb +52 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2000D.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100A.rb +43 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100B.rb +67 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100C.rb +124 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2100D.rb +124 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2110C.rb +98 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2110D.rb +98 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2115C.rb +16 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2115D.rb +16 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2120C.rb +54 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/L2120D.rb +54 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_271/base.rb +47 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276.rb +19 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000A.rb +32 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000B.rb +32 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000C.rb +32 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000D.rb +52 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2000E.rb +50 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100A.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100B.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100C.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100D.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2100E.rb +20 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2200D.rb +117 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2200E.rb +117 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2210D.rb +37 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/L2210E.rb +37 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_276/base.rb +90 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277.rb +22 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000A.rb +42 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000B.rb +42 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000C.rb +52 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000D.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2000E.rb +40 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100A.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100B.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100C.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100D.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2100E.rb +20 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200A.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200B.rb +69 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200C.rb +79 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200D.rb +77 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2200E.rb +104 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2220D.rb +57 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/L2220E.rb +44 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_277/base.rb +70 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835.rb +10 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L1000A.rb +74 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L1000B.rb +54 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2000.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2100.rb +213 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/L2110.rb +106 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_835/base.rb +122 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837.rb +43 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L1000A.rb +32 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L1000B.rb +21 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000A.rb +88 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000B.rb +87 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2000C.rb +54 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AA.rb +65 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AB.rb +34 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010AC.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010BA.rb +76 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010BB.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2010CA.rb +76 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2300.rb +570 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310A.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310B.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310C.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310D.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310E.rb +34 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2310F.rb +34 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2320.rb +157 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330A.rb +45 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330B.rb +96 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330C.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330D.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330E.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330F.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2330G.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2400.rb +537 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2410.rb +36 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420A.rb +41 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420B.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420C.rb +44 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420D.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420E.rb +55 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420F.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420G.rb +34 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2420H.rb +34 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2430.rb +47 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/L2440.rb +26 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_837/base.rb +71 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997.rb +7 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/L2000.rb +36 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/L2100.rb +29 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_997/base.rb +49 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999.rb +8 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2000 - AK2.rb +30 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2000AK2.rb +36 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2100 - AK2.rb +37 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2100AK2.rb +43 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2110 - AK2.rb +23 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/L2110AK2.rb +26 -0
- data/lib/hippo_eyeDoc/transaction_sets/HIPAA_999/base.rb +49 -0
- data/lib/hippo_eyeDoc/transaction_sets/base.rb +236 -0
- data/lib/hippo_eyeDoc/transaction_sets/component.rb +96 -0
- data/lib/hippo_eyeDoc/transaction_sets/repeating_component.rb +48 -0
- data/lib/hippo_eyeDoc/utilities.rb +37 -0
- data/lib/hippo_eyeDoc/version.rb +3 -0
- data/samples/005010X221A1_business_scenario_1.edi +1 -0
- data/samples/005010X221A1_tmhp_example.edi +1 -0
- data/samples/005010X222A1_anesthesia.edi +1 -0
- data/samples/005010X222A1_commercial_health_insurance.edi +1 -0
- data/samples/005010X231A1_01.edi +11 -0
- data/samples/005010X231A1_02.edi +11 -0
- data/samples/200823.EDI +22 -0
- data/samples/837_L2000A_01.edi +1 -0
- data/samples/837_L2000A_02.edi +1 -0
- data/samples/parse_277.rb +127 -0
- data/samples/parse_999.rb +122 -0
- data/samples/sample835.html +1 -0
- data/samples/sample835.pretty_string +28 -0
- data/samples/sample837.html +1 -0
- data/test/test_helper.rb +155 -0
- data/test/test_hipaa_835.rb +229 -0
- data/test/test_hipaa_837.rb +596 -0
- data/test/test_html_outputter.rb +22 -0
- data/test/test_parser.rb +138 -0
- data/test/test_pretty_string_outputter.rb +33 -0
- data/test/test_segments_base.rb +201 -0
- data/test/test_transaction_sets_base.rb +122 -0
- metadata +356 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Hippo_eyeDoc::Segments
|
|
2
|
+
class UR < Hippo_eyeDoc::Segments::Base
|
|
3
|
+
|
|
4
|
+
segment_identifier 'UR'
|
|
5
|
+
|
|
6
|
+
field :name => 'ApprovalCode',
|
|
7
|
+
:sequence => 1,
|
|
8
|
+
:datatype => :list,
|
|
9
|
+
:minimum => 1,
|
|
10
|
+
:maximum => 1,
|
|
11
|
+
:required => true,
|
|
12
|
+
:data_element_number => 1318
|
|
13
|
+
|
|
14
|
+
field :name => 'Quantity',
|
|
15
|
+
:sequence => 2,
|
|
16
|
+
:datatype => :decimal,
|
|
17
|
+
:minimum => 1,
|
|
18
|
+
:maximum => 15,
|
|
19
|
+
:required => false,
|
|
20
|
+
:data_element_number => 380
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
module Hippo_eyeDoc::Segments
|
|
2
|
+
class VEH < Hippo_eyeDoc::Segments::Base
|
|
3
|
+
|
|
4
|
+
segment_identifier 'VEH'
|
|
5
|
+
|
|
6
|
+
field :name => 'AssignedNumber',
|
|
7
|
+
:sequence => 1,
|
|
8
|
+
:datatype => :integer,
|
|
9
|
+
:minimum => 1,
|
|
10
|
+
:maximum => 6,
|
|
11
|
+
:required => false,
|
|
12
|
+
:data_element_number => 554
|
|
13
|
+
|
|
14
|
+
field :name => 'VehicleIdentificationNumber',
|
|
15
|
+
:sequence => 2,
|
|
16
|
+
:datatype => :string,
|
|
17
|
+
:minimum => 1,
|
|
18
|
+
:maximum => 30,
|
|
19
|
+
:required => false,
|
|
20
|
+
:data_element_number => 539
|
|
21
|
+
|
|
22
|
+
field :name => 'Year',
|
|
23
|
+
:sequence => 3,
|
|
24
|
+
:datatype => :integer,
|
|
25
|
+
:minimum => 4,
|
|
26
|
+
:maximum => 4,
|
|
27
|
+
:required => false,
|
|
28
|
+
:data_element_number => 1095
|
|
29
|
+
|
|
30
|
+
field :name => 'AgencyQualifierCode',
|
|
31
|
+
:sequence => 4,
|
|
32
|
+
:datatype => :list,
|
|
33
|
+
:minimum => 2,
|
|
34
|
+
:maximum => 2,
|
|
35
|
+
:required => false,
|
|
36
|
+
:data_element_number => 559
|
|
37
|
+
|
|
38
|
+
field :name => 'ReferenceIdentification',
|
|
39
|
+
:sequence => 5,
|
|
40
|
+
:datatype => :string,
|
|
41
|
+
:minimum => 1,
|
|
42
|
+
:maximum => 50,
|
|
43
|
+
:required => false,
|
|
44
|
+
:data_element_number => 127
|
|
45
|
+
|
|
46
|
+
field :name => 'ReferenceIdentification',
|
|
47
|
+
:sequence => 6,
|
|
48
|
+
:datatype => :string,
|
|
49
|
+
:minimum => 1,
|
|
50
|
+
:maximum => 50,
|
|
51
|
+
:required => false,
|
|
52
|
+
:data_element_number => 127
|
|
53
|
+
|
|
54
|
+
field :name => 'ReferenceIdentification',
|
|
55
|
+
:sequence => 7,
|
|
56
|
+
:datatype => :string,
|
|
57
|
+
:minimum => 1,
|
|
58
|
+
:maximum => 50,
|
|
59
|
+
:required => false,
|
|
60
|
+
:data_element_number => 127
|
|
61
|
+
|
|
62
|
+
field :name => 'Length',
|
|
63
|
+
:sequence => 8,
|
|
64
|
+
:datatype => :decimal,
|
|
65
|
+
:minimum => 1,
|
|
66
|
+
:maximum => 8,
|
|
67
|
+
:required => false,
|
|
68
|
+
:data_element_number => 82
|
|
69
|
+
|
|
70
|
+
field :name => 'ReferenceIdentification',
|
|
71
|
+
:sequence => 9,
|
|
72
|
+
:datatype => :string,
|
|
73
|
+
:minimum => 1,
|
|
74
|
+
:maximum => 50,
|
|
75
|
+
:required => false,
|
|
76
|
+
:data_element_number => 127
|
|
77
|
+
|
|
78
|
+
field :name => 'StateOrProvinceCode',
|
|
79
|
+
:sequence => 10,
|
|
80
|
+
:datatype => :list,
|
|
81
|
+
:minimum => 2,
|
|
82
|
+
:maximum => 2,
|
|
83
|
+
:required => false,
|
|
84
|
+
:data_element_number => 156
|
|
85
|
+
|
|
86
|
+
field :name => 'LocationIdentifier',
|
|
87
|
+
:sequence => 11,
|
|
88
|
+
:datatype => :string,
|
|
89
|
+
:minimum => 1,
|
|
90
|
+
:maximum => 30,
|
|
91
|
+
:required => false,
|
|
92
|
+
:data_element_number => 310
|
|
93
|
+
|
|
94
|
+
field :name => 'YesNoConditionOrResponseCode',
|
|
95
|
+
:sequence => 12,
|
|
96
|
+
:datatype => :list,
|
|
97
|
+
:minimum => 1,
|
|
98
|
+
:maximum => 1,
|
|
99
|
+
:required => false,
|
|
100
|
+
:data_element_number => 1073
|
|
101
|
+
|
|
102
|
+
field :name => 'Amount',
|
|
103
|
+
:sequence => 13,
|
|
104
|
+
:datatype => :decimal,
|
|
105
|
+
:minimum => 1,
|
|
106
|
+
:maximum => 15,
|
|
107
|
+
:required => false,
|
|
108
|
+
:data_element_number => 610
|
|
109
|
+
|
|
110
|
+
field :name => 'YesNoConditionOrResponseCode',
|
|
111
|
+
:sequence => 14,
|
|
112
|
+
:datatype => :list,
|
|
113
|
+
:minimum => 1,
|
|
114
|
+
:maximum => 1,
|
|
115
|
+
:required => false,
|
|
116
|
+
:data_element_number => 1073
|
|
117
|
+
|
|
118
|
+
field :name => 'Amount',
|
|
119
|
+
:sequence => 15,
|
|
120
|
+
:datatype => :decimal,
|
|
121
|
+
:minimum => 1,
|
|
122
|
+
:maximum => 15,
|
|
123
|
+
:required => false,
|
|
124
|
+
:data_element_number => 610
|
|
125
|
+
|
|
126
|
+
field :name => 'ActionCode',
|
|
127
|
+
:sequence => 16,
|
|
128
|
+
:datatype => :list,
|
|
129
|
+
:minimum => 1,
|
|
130
|
+
:maximum => 2,
|
|
131
|
+
:required => false,
|
|
132
|
+
:data_element_number => 306
|
|
133
|
+
|
|
134
|
+
field :name => 'CountryCode',
|
|
135
|
+
:sequence => 17,
|
|
136
|
+
:datatype => :list,
|
|
137
|
+
:minimum => 2,
|
|
138
|
+
:maximum => 3,
|
|
139
|
+
:required => false,
|
|
140
|
+
:data_element_number => 26
|
|
141
|
+
|
|
142
|
+
field :name => 'Name',
|
|
143
|
+
:sequence => 18,
|
|
144
|
+
:datatype => :string,
|
|
145
|
+
:minimum => 1,
|
|
146
|
+
:maximum => 60,
|
|
147
|
+
:required => false,
|
|
148
|
+
:data_element_number => 93
|
|
149
|
+
|
|
150
|
+
field :name => 'CountryCode',
|
|
151
|
+
:sequence => 19,
|
|
152
|
+
:datatype => :list,
|
|
153
|
+
:minimum => 2,
|
|
154
|
+
:maximum => 3,
|
|
155
|
+
:required => false,
|
|
156
|
+
:data_element_number => 26
|
|
157
|
+
|
|
158
|
+
end
|
|
159
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
module Hippo_eyeDoc::Segments
|
|
2
|
+
class Base
|
|
3
|
+
include Hippo_eyeDoc::Separator
|
|
4
|
+
include Hippo_eyeDoc::Parser::Segment
|
|
5
|
+
include Hippo_eyeDoc::Outputters::HTML::Segment
|
|
6
|
+
include Hippo_eyeDoc::Outputters::PDF::Segment
|
|
7
|
+
include Hippo_eyeDoc::Outputters::PrettyString::Segment
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
attr_accessor :fields, :identifier, :fixed_width
|
|
11
|
+
|
|
12
|
+
def fields
|
|
13
|
+
@fields ||= []
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def identifier
|
|
17
|
+
@identifier ||= ''
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def field(field)
|
|
21
|
+
f = Hippo_eyeDoc::Field.new
|
|
22
|
+
f.sequence = fields.length + 1
|
|
23
|
+
f.name = field[:name]
|
|
24
|
+
f.datatype = field[:datatype]
|
|
25
|
+
f.minimum = field[:minimum]
|
|
26
|
+
f.maximum = field[:maximum]
|
|
27
|
+
f.options = field[:options]
|
|
28
|
+
f.restrictions = field[:restrictions]
|
|
29
|
+
f.required = field[:required] || false
|
|
30
|
+
f.separator = field[:separator] || @default_separator || :field_separator
|
|
31
|
+
|
|
32
|
+
if @composite_block
|
|
33
|
+
f.composite = true
|
|
34
|
+
f.composite_sequence = fields.length
|
|
35
|
+
f.sequence = fields.last.length + 1
|
|
36
|
+
fields.last << f
|
|
37
|
+
else
|
|
38
|
+
fields << f
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def segment?
|
|
43
|
+
true
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def transaction_set?
|
|
47
|
+
false
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def composite_field(field_name)
|
|
51
|
+
@composite_block = true
|
|
52
|
+
@default_separator = :composite_separator
|
|
53
|
+
fields << []
|
|
54
|
+
yield
|
|
55
|
+
@default_separator = :field_separator
|
|
56
|
+
@composite_block = false
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def segment_identifier(id)
|
|
60
|
+
@identifier = id
|
|
61
|
+
@fields = []
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def segment_fixed_width
|
|
65
|
+
@fixed_width = true
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
attr_accessor :values, :parent
|
|
70
|
+
|
|
71
|
+
def segments
|
|
72
|
+
[self]
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def segment_count
|
|
76
|
+
segments.count
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def ancestors
|
|
80
|
+
if parent
|
|
81
|
+
parent.ancestors.flatten
|
|
82
|
+
else
|
|
83
|
+
[]
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def to_ary
|
|
88
|
+
nil
|
|
89
|
+
end
|
|
90
|
+
alias :to_a :to_ary
|
|
91
|
+
|
|
92
|
+
def initialize(options = {})
|
|
93
|
+
@parent = options.delete(:parent)
|
|
94
|
+
|
|
95
|
+
super
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def values
|
|
99
|
+
@values ||= {}
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def get_field_name(text)
|
|
103
|
+
text.to_s.gsub(' ','').gsub('=','')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def get_field(field)
|
|
107
|
+
if field =~ /\A#{self.class.identifier}(?:(\d+)(?:_(\d+)){0,1})\z/
|
|
108
|
+
if $2 && self.class.fields[$1.to_i - 1].class == Array
|
|
109
|
+
self.class.fields[$1.to_i - 1][$2.to_i - 1]
|
|
110
|
+
else
|
|
111
|
+
self.class.fields[$1.to_i - 1]
|
|
112
|
+
end
|
|
113
|
+
else
|
|
114
|
+
fields = self.class.fields.flatten.select{|f| f.name == field.gsub(/_\d{1,2}\z/,'')}
|
|
115
|
+
|
|
116
|
+
if field =~ /_(\d{1,2})\z/
|
|
117
|
+
fields[$1.to_i - 1]
|
|
118
|
+
else
|
|
119
|
+
fields.first
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def to_s
|
|
125
|
+
output = self.class.identifier + @field_separator
|
|
126
|
+
|
|
127
|
+
self.class.fields.each_with_index do |field, index|
|
|
128
|
+
if field.class == Array # this is a composite field
|
|
129
|
+
field.each do |comp_field|
|
|
130
|
+
field_value = if values[comp_field.composite_sequence]
|
|
131
|
+
# some values exist for this composite field
|
|
132
|
+
comp_field.string_value(values[comp_field.composite_sequence][comp_field.sequence])
|
|
133
|
+
else
|
|
134
|
+
# no values exist for the entire composite field
|
|
135
|
+
''
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
output += field_value + @composite_separator
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
output += @field_separator
|
|
142
|
+
else # standard field
|
|
143
|
+
field_value = field.string_value(values[field.sequence])
|
|
144
|
+
|
|
145
|
+
output += field_value + @field_separator
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
unless self.class.fixed_width
|
|
150
|
+
output = remove_empty_fields(output)
|
|
151
|
+
output = output.gsub(repeating_composite_separator_regexp, @field_separator)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
output += @segment_separator
|
|
155
|
+
output = output.gsub(repeating_field_separator_at_end_of_segment_regexp, @segment_separator)
|
|
156
|
+
|
|
157
|
+
output =~ /\A#{self.class.identifier}#{segment_separator}/ ? '' : output
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def identifier
|
|
161
|
+
self.class.identifier
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def method_missing(method_name, *args)
|
|
165
|
+
values
|
|
166
|
+
|
|
167
|
+
field = get_field(get_field_name(method_name.to_s))
|
|
168
|
+
|
|
169
|
+
if field.nil? || field.class == Array
|
|
170
|
+
raise Hippo_eyeDoc::Exceptions::InvalidField.new("Invalid field '#{method_name.to_s}' specified.")
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if method_name.to_s =~ /=\z/
|
|
174
|
+
if field.composite
|
|
175
|
+
self.values[field.composite_sequence] ||= {}
|
|
176
|
+
self.values[field.composite_sequence][field.sequence] = field.formatted_value(args[0])
|
|
177
|
+
else
|
|
178
|
+
self.values[field.sequence] = field.formatted_value(args[0])
|
|
179
|
+
end
|
|
180
|
+
else
|
|
181
|
+
if field.composite
|
|
182
|
+
self.values[field.composite_sequence] ||= {}
|
|
183
|
+
self.values[field.composite_sequence][field.sequence]
|
|
184
|
+
else
|
|
185
|
+
self.values[field.sequence]
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module Hippo_eyeDoc
|
|
2
|
+
DEFAULT_FIELD_SEPARATOR = '*'
|
|
3
|
+
DEFAULT_COMPOSITE_SEPARATOR = ':'
|
|
4
|
+
DEFAULT_SEGMENT_SEPARATOR = '~'
|
|
5
|
+
DEFAULT_REPETITION_SEPARATOR = '^'
|
|
6
|
+
|
|
7
|
+
module Separator
|
|
8
|
+
attr_accessor :field_separator, :composite_separator, :repetition_separator, :segment_separator
|
|
9
|
+
|
|
10
|
+
def initialize(options = {})
|
|
11
|
+
[:field_separator, :repetition_separator, :composite_separator, :segment_separator].each do |sym|
|
|
12
|
+
value = options[sym] || parent_or_default_separator(sym)
|
|
13
|
+
|
|
14
|
+
self.send(:"#{sym}=", value)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def parent_or_default_separator(separator_type)
|
|
19
|
+
if defined?(parent) && parent
|
|
20
|
+
parent.send(separator_type.to_sym)
|
|
21
|
+
else
|
|
22
|
+
Hippo_eyeDoc.const_get(:"DEFAULT_#{separator_type.to_s.upcase}")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def parse_separators(input)
|
|
27
|
+
if input =~ /\AISA/
|
|
28
|
+
@field_separator = input[3,1]
|
|
29
|
+
@repetition_separator = input[82,1]
|
|
30
|
+
@composite_separator = input[104,1]
|
|
31
|
+
@segment_separator = input[105,1]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def separators
|
|
36
|
+
{
|
|
37
|
+
:field_separator => @field_separator,
|
|
38
|
+
:composite_separator => @composite_separator,
|
|
39
|
+
:segment_separator => @segment_separator,
|
|
40
|
+
:repetition_separator => @repetition_separator
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def repeating_field_separator_at_end_of_segment_regexp
|
|
45
|
+
%r{
|
|
46
|
+
#{Regexp.escape(@field_separator)}+
|
|
47
|
+
#{Regexp.escape(@segment_separator)}
|
|
48
|
+
}x
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def repeating_composite_separator_regexp
|
|
52
|
+
%r{
|
|
53
|
+
#{Regexp.escape(@composite_separator)}+
|
|
54
|
+
#{Regexp.escape(@field_separator)}
|
|
55
|
+
}x
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def regexp_escaped_separators
|
|
59
|
+
Regexp.escape(@composite_separator) +
|
|
60
|
+
Regexp.escape(@field_separator) +
|
|
61
|
+
Regexp.escape(@segment_separator)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def empty_field_regexp
|
|
65
|
+
%r{([#{regexp_escaped_separators}])
|
|
66
|
+
\s+
|
|
67
|
+
([#{regexp_escaped_separators}])
|
|
68
|
+
}x
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def remove_empty_fields(input)
|
|
72
|
+
while input =~ empty_field_regexp
|
|
73
|
+
input = input.gsub(empty_field_regexp, '\1\2')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
input
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|