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,36 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_997
|
|
3
|
+
|
|
4
|
+
class L2000 < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
loop_name 'L2000' #Transaction Set Response Header
|
|
6
|
+
|
|
7
|
+
#Transaction Set Response Header
|
|
8
|
+
segment Hippo_eyeDoc::Segments::AK2,
|
|
9
|
+
:name => 'Transaction Set Response Header',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 300
|
|
13
|
+
|
|
14
|
+
#AK2/AK3 Error Identification
|
|
15
|
+
loop Hippo_eyeDoc::TransactionSets::HIPAA_997::L2100,
|
|
16
|
+
:name => 'AK2/AK3 Error Identification',
|
|
17
|
+
:minimum => 0,
|
|
18
|
+
:maximum => 99999,
|
|
19
|
+
:position => 400,
|
|
20
|
+
:identified_by => {
|
|
21
|
+
'AK3.AK304' => ["1", "2", "3", "4", "5", "6", "7", "8"]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#Transaction Set Response Trailer
|
|
25
|
+
segment Hippo_eyeDoc::Segments::AK5,
|
|
26
|
+
:name => 'Transaction Set Response Trailer',
|
|
27
|
+
:minimum => 1,
|
|
28
|
+
:maximum => 1,
|
|
29
|
+
:position => 600,
|
|
30
|
+
:identified_by => {
|
|
31
|
+
'AK501' => ["A", "E", "M", "R", "W", "X"]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_997
|
|
3
|
+
|
|
4
|
+
class L2100 < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
loop_name 'L2100' #AK2/AK3 Error Identification
|
|
6
|
+
|
|
7
|
+
#AK2/AK3 Error Identification
|
|
8
|
+
segment Hippo_eyeDoc::Segments::AK3,
|
|
9
|
+
:name => 'AK2/AK3 Error Identification',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 400,
|
|
13
|
+
:identified_by => {
|
|
14
|
+
'AK304' => ["1", "2", "3", "4", "5", "6", "7", "8"]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#Data Element Note
|
|
18
|
+
segment Hippo_eyeDoc::Segments::AK4,
|
|
19
|
+
:name => 'Data Element Note',
|
|
20
|
+
:minimum => 0,
|
|
21
|
+
:maximum => 99,
|
|
22
|
+
:position => 500,
|
|
23
|
+
:identified_by => {
|
|
24
|
+
'AK403' => ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12", "13"]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_997
|
|
3
|
+
|
|
4
|
+
class Base < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
|
|
6
|
+
#Transaction Set Header
|
|
7
|
+
segment Hippo_eyeDoc::Segments::ST,
|
|
8
|
+
:name => 'Transaction Set Header',
|
|
9
|
+
:minimum => 1,
|
|
10
|
+
:maximum => 1,
|
|
11
|
+
:position => 100,
|
|
12
|
+
:identified_by => {
|
|
13
|
+
'ST01' => '997'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#Functional Group Response Header
|
|
17
|
+
segment Hippo_eyeDoc::Segments::AK1,
|
|
18
|
+
:name => 'Functional Group Response Header',
|
|
19
|
+
:minimum => 1,
|
|
20
|
+
:maximum => 1,
|
|
21
|
+
:position => 200
|
|
22
|
+
|
|
23
|
+
#Transaction Set Response Header
|
|
24
|
+
loop Hippo_eyeDoc::TransactionSets::HIPAA_997::L2000,
|
|
25
|
+
:name => 'Transaction Set Response Header',
|
|
26
|
+
:minimum => 0,
|
|
27
|
+
:maximum => 99999,
|
|
28
|
+
:position => 300
|
|
29
|
+
|
|
30
|
+
#Functional Group Response Trailer
|
|
31
|
+
segment Hippo_eyeDoc::Segments::AK9,
|
|
32
|
+
:name => 'Functional Group Response Trailer',
|
|
33
|
+
:minimum => 1,
|
|
34
|
+
:maximum => 1,
|
|
35
|
+
:position => 700,
|
|
36
|
+
:identified_by => {
|
|
37
|
+
'AK901' => ["A", "E", "M", "P", "R", "W", "X"]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#Transaction Set Trailer
|
|
41
|
+
segment Hippo_eyeDoc::Segments::SE,
|
|
42
|
+
:name => 'Transaction Set Trailer',
|
|
43
|
+
:minimum => 1,
|
|
44
|
+
:maximum => 1,
|
|
45
|
+
:position => 800
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
autoload_relative :Base, 'HIPAA_999/base'
|
|
4
|
+
autoload_relative :L2000AK2, 'HIPAA_999/L2000AK2'
|
|
5
|
+
autoload_relative :L2100AK2, 'HIPAA_999/L2100AK2'
|
|
6
|
+
autoload_relative :L2110AK2, 'HIPAA_999/L2110AK2'
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Hippo::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2000 - AK2 < Hippo::TransactionSets::Base
|
|
5
|
+
loop_name 'L2000 - AK2' #Transaction Set Response Header
|
|
6
|
+
|
|
7
|
+
#Transaction Set Response Header
|
|
8
|
+
segment Hippo::Segments::AK2,
|
|
9
|
+
:name => 'Transaction Set Response Header',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 300
|
|
13
|
+
|
|
14
|
+
#Error Identification
|
|
15
|
+
loop Hippo::TransactionSets::HIPAA_837::L2100 - AK2,
|
|
16
|
+
:name => 'Error Identification',
|
|
17
|
+
:minimum => 0,
|
|
18
|
+
:maximum => nil,
|
|
19
|
+
:position => 400
|
|
20
|
+
|
|
21
|
+
#Transaction Set Response Trailer
|
|
22
|
+
segment Hippo::Segments::IK5,
|
|
23
|
+
:name => 'Transaction Set Response Trailer',
|
|
24
|
+
:minimum => 1,
|
|
25
|
+
:maximum => 1,
|
|
26
|
+
:position => 800
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2000AK2 < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
loop_name 'L2000AK2' #Transaction Set Response Header
|
|
6
|
+
|
|
7
|
+
#Transaction Set Response Header
|
|
8
|
+
segment Hippo_eyeDoc::Segments::AK2,
|
|
9
|
+
:name => 'Transaction Set Response Header',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 300
|
|
13
|
+
|
|
14
|
+
#Error Identification
|
|
15
|
+
loop Hippo_eyeDoc::TransactionSets::HIPAA_999::L2100AK2,
|
|
16
|
+
:name => 'Error Identification',
|
|
17
|
+
:minimum => 0,
|
|
18
|
+
:maximum => 99999,
|
|
19
|
+
:position => 400,
|
|
20
|
+
:identified_by => {
|
|
21
|
+
'IK3.IK304' => ["1", "2", "3", "4", "5", "6", "7", "8", "I4", "I6", "I7", "I8", "I9"]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#Transaction Set Response Trailer
|
|
25
|
+
segment Hippo_eyeDoc::Segments::IK5,
|
|
26
|
+
:name => 'Transaction Set Response Trailer',
|
|
27
|
+
:minimum => 1,
|
|
28
|
+
:maximum => 1,
|
|
29
|
+
:position => 800,
|
|
30
|
+
:identified_by => {
|
|
31
|
+
'IK501' => ["A", "E", "M", "R", "W", "X"]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Hippo::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2100 - AK2 < Hippo::TransactionSets::Base
|
|
5
|
+
loop_name 'L2100 - AK2' #Error Identification
|
|
6
|
+
|
|
7
|
+
#Error Identification
|
|
8
|
+
segment Hippo::Segments::IK3,
|
|
9
|
+
:name => 'Error Identification',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 400
|
|
13
|
+
|
|
14
|
+
#Segment Context
|
|
15
|
+
segment Hippo::Segments::CTX,
|
|
16
|
+
:name => 'Segment Context',
|
|
17
|
+
:minimum => 0,
|
|
18
|
+
:maximum => 9,
|
|
19
|
+
:position => 500
|
|
20
|
+
|
|
21
|
+
#Business Unit Identifier
|
|
22
|
+
segment Hippo::Segments::CTX,
|
|
23
|
+
:name => 'Business Unit Identifier',
|
|
24
|
+
:minimum => 0,
|
|
25
|
+
:maximum => 1,
|
|
26
|
+
:position => 510
|
|
27
|
+
|
|
28
|
+
#Implementation Data Element Note
|
|
29
|
+
loop Hippo::TransactionSets::HIPAA_837::L2110 - AK2,
|
|
30
|
+
:name => 'Implementation Data Element Note',
|
|
31
|
+
:minimum => 0,
|
|
32
|
+
:maximum => nil,
|
|
33
|
+
:position => 600
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2100AK2 < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
loop_name 'L2100AK2' #Error Identification
|
|
6
|
+
|
|
7
|
+
#Error Identification
|
|
8
|
+
segment Hippo_eyeDoc::Segments::IK3,
|
|
9
|
+
:name => 'Error Identification',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 400,
|
|
13
|
+
:identified_by => {
|
|
14
|
+
'IK304' => ["1", "2", "3", "4", "5", "6", "7", "8", "I4", "I6", "I7", "I8", "I9"]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#Segment Context
|
|
18
|
+
segment Hippo_eyeDoc::Segments::CTX,
|
|
19
|
+
:name => 'Segment Context',
|
|
20
|
+
:minimum => 0,
|
|
21
|
+
:maximum => 9,
|
|
22
|
+
:position => 500
|
|
23
|
+
|
|
24
|
+
#Business Unit Identifier
|
|
25
|
+
segment Hippo_eyeDoc::Segments::CTX,
|
|
26
|
+
:name => 'Business Unit Identifier',
|
|
27
|
+
:minimum => 0,
|
|
28
|
+
:maximum => 1,
|
|
29
|
+
:position => 510
|
|
30
|
+
|
|
31
|
+
#Implementation Data Element Note
|
|
32
|
+
loop Hippo_eyeDoc::TransactionSets::HIPAA_999::L2110AK2,
|
|
33
|
+
:name => 'Implementation Data Element Note',
|
|
34
|
+
:minimum => 0,
|
|
35
|
+
:maximum => 99999,
|
|
36
|
+
:position => 600,
|
|
37
|
+
:identified_by => {
|
|
38
|
+
'IK4.IK403' => ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12", "13", "I10", "I11", "I12", "I13", "I6", "I9"]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Hippo::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2110 - AK2 < Hippo::TransactionSets::Base
|
|
5
|
+
loop_name 'L2110 - AK2' #Implementation Data Element Note
|
|
6
|
+
|
|
7
|
+
#Implementation Data Element Note
|
|
8
|
+
segment Hippo::Segments::IK4,
|
|
9
|
+
:name => 'Implementation Data Element Note',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 600
|
|
13
|
+
|
|
14
|
+
#Element Context
|
|
15
|
+
segment Hippo::Segments::CTX,
|
|
16
|
+
:name => 'Element Context',
|
|
17
|
+
:minimum => 0,
|
|
18
|
+
:maximum => 10,
|
|
19
|
+
:position => 700
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class L2110AK2 < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
loop_name 'L2110AK2' #Implementation Data Element Note
|
|
6
|
+
|
|
7
|
+
#Implementation Data Element Note
|
|
8
|
+
segment Hippo_eyeDoc::Segments::IK4,
|
|
9
|
+
:name => 'Implementation Data Element Note',
|
|
10
|
+
:minimum => 0,
|
|
11
|
+
:maximum => 1,
|
|
12
|
+
:position => 600,
|
|
13
|
+
:identified_by => {
|
|
14
|
+
'IK403' => ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12", "13", "I10", "I11", "I12", "I13", "I6", "I9"]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#Element Context
|
|
18
|
+
segment Hippo_eyeDoc::Segments::CTX,
|
|
19
|
+
:name => 'Element Context',
|
|
20
|
+
:minimum => 0,
|
|
21
|
+
:maximum => 10,
|
|
22
|
+
:position => 700
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
module HIPAA_999
|
|
3
|
+
|
|
4
|
+
class Base < Hippo_eyeDoc::TransactionSets::Base
|
|
5
|
+
|
|
6
|
+
#Transaction Set Header
|
|
7
|
+
segment Hippo_eyeDoc::Segments::ST,
|
|
8
|
+
:name => 'Transaction Set Header',
|
|
9
|
+
:minimum => 1,
|
|
10
|
+
:maximum => 1,
|
|
11
|
+
:position => 100,
|
|
12
|
+
:identified_by => {
|
|
13
|
+
'ST01' => '999'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#Functional Group Response Header
|
|
17
|
+
segment Hippo_eyeDoc::Segments::AK1,
|
|
18
|
+
:name => 'Functional Group Response Header',
|
|
19
|
+
:minimum => 1,
|
|
20
|
+
:maximum => 1,
|
|
21
|
+
:position => 200
|
|
22
|
+
|
|
23
|
+
#Transaction Set Response Header
|
|
24
|
+
loop Hippo_eyeDoc::TransactionSets::HIPAA_999::L2000AK2,
|
|
25
|
+
:name => 'Transaction Set Response Header',
|
|
26
|
+
:minimum => 0,
|
|
27
|
+
:maximum => 99999,
|
|
28
|
+
:position => 300
|
|
29
|
+
|
|
30
|
+
#Functional Group Response Trailer
|
|
31
|
+
segment Hippo_eyeDoc::Segments::AK9,
|
|
32
|
+
:name => 'Functional Group Response Trailer',
|
|
33
|
+
:minimum => 1,
|
|
34
|
+
:maximum => 1,
|
|
35
|
+
:position => 900,
|
|
36
|
+
:identified_by => {
|
|
37
|
+
'AK901' => ["A", "E", "M", "P", "R", "W", "X"]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#Transaction Set Trailer
|
|
41
|
+
segment Hippo_eyeDoc::Segments::SE,
|
|
42
|
+
:name => 'Transaction Set Trailer',
|
|
43
|
+
:minimum => 1,
|
|
44
|
+
:maximum => 1,
|
|
45
|
+
:position => 1000
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
module Hippo_eyeDoc::TransactionSets
|
|
2
|
+
class Base
|
|
3
|
+
include Hippo_eyeDoc::Separator
|
|
4
|
+
include Hippo_eyeDoc::Parser::TransactionSet
|
|
5
|
+
include Hippo_eyeDoc::Outputters::HTML::TransactionSet
|
|
6
|
+
include Hippo_eyeDoc::Outputters::PDF::TransactionSet
|
|
7
|
+
include Hippo_eyeDoc::Outputters::PrettyString::TransactionSet
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
attr_accessor :components, :identifier
|
|
11
|
+
|
|
12
|
+
def components
|
|
13
|
+
@components ||= []
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def loop_name(id)
|
|
17
|
+
@identifier = id
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def add_component(klass, options={})
|
|
21
|
+
components << Component.new(options.merge(:klass => klass, :sequence => components.length))
|
|
22
|
+
end
|
|
23
|
+
alias segment add_component
|
|
24
|
+
alias loop add_component
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def grouped_components
|
|
28
|
+
@grouped_components ||= build_grouped_components
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def build_grouped_components
|
|
32
|
+
output = []
|
|
33
|
+
last_entry = nil
|
|
34
|
+
|
|
35
|
+
components.each do |component|
|
|
36
|
+
if component.segment?
|
|
37
|
+
output << [] if last_entry != :segment
|
|
38
|
+
output.last << component
|
|
39
|
+
last_entry = :segment
|
|
40
|
+
else
|
|
41
|
+
output << component
|
|
42
|
+
last_entry = :transaction_set
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
output
|
|
47
|
+
end
|
|
48
|
+
private :build_grouped_components
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
attr_accessor :values, :parent, :sequences, :ISA, :GS, :GE, :IEA
|
|
52
|
+
|
|
53
|
+
def initialize(options = {})
|
|
54
|
+
@parent = options[:parent]
|
|
55
|
+
@ISA = options[:ISA]
|
|
56
|
+
@GS = options[:GS]
|
|
57
|
+
@GE = options[:GE]
|
|
58
|
+
@IEA = options[:IEA]
|
|
59
|
+
|
|
60
|
+
super
|
|
61
|
+
|
|
62
|
+
populate(options[:segments]) if options[:segments]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def populate(segments)
|
|
66
|
+
grouped_components = self.class.grouped_components
|
|
67
|
+
|
|
68
|
+
grouped_components.each_with_index do |component, component_index|
|
|
69
|
+
if component.class == Array
|
|
70
|
+
# segments
|
|
71
|
+
starting_segment_count = segments.count
|
|
72
|
+
ending_segment_count = 0
|
|
73
|
+
|
|
74
|
+
while starting_segment_count > ending_segment_count
|
|
75
|
+
starting_segment_count = segments.count
|
|
76
|
+
|
|
77
|
+
component.each do |individual_component|
|
|
78
|
+
segment = segments.first
|
|
79
|
+
|
|
80
|
+
break unless segment
|
|
81
|
+
next unless individual_component.valid?(segment)
|
|
82
|
+
next unless individual_component.conditions_match?(self, segment)
|
|
83
|
+
|
|
84
|
+
segment.parent = self
|
|
85
|
+
|
|
86
|
+
if individual_component.repeating?
|
|
87
|
+
values[individual_component.sequence] ||= individual_component.initialize_component(self)
|
|
88
|
+
values[individual_component.sequence] << segment
|
|
89
|
+
else
|
|
90
|
+
values[individual_component.sequence] = segment
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
segments.delete(segment)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
ending_segment_count = segments.count
|
|
97
|
+
end
|
|
98
|
+
else
|
|
99
|
+
# loops
|
|
100
|
+
while true do
|
|
101
|
+
initial_segment = segments.first
|
|
102
|
+
|
|
103
|
+
break unless initial_segment
|
|
104
|
+
break unless component.valid?(initial_segment)
|
|
105
|
+
break unless component.conditions_match?(self, initial_segment)
|
|
106
|
+
|
|
107
|
+
component_matches_found = []
|
|
108
|
+
starting_index = component.repeating? ? component_index : component_index + 1
|
|
109
|
+
|
|
110
|
+
grouped_components.slice(starting_index, grouped_components.length - starting_index).each do |next_component|
|
|
111
|
+
index = segments.find_index do |segment|
|
|
112
|
+
if segment == segments.first
|
|
113
|
+
false
|
|
114
|
+
elsif next_component.class == Array
|
|
115
|
+
next_component.any?{|subcomponent| subcomponent.valid?(segment)}
|
|
116
|
+
else
|
|
117
|
+
next_component.valid?(segment)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
component_matches_found << index if index
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
child_segments = segments.slice!(0, component_matches_found.min || segments.length)
|
|
125
|
+
values[component.sequence] ||= component.initialize_component(self)
|
|
126
|
+
if component.repeating?
|
|
127
|
+
values[component.sequence].build {|comp| comp.populate(child_segments) }
|
|
128
|
+
else
|
|
129
|
+
values[component.sequence].populate(child_segments)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
unless segments.empty?
|
|
136
|
+
raise Hippo_eyeDoc::Exceptions::ParseError.new "Remaining Segments for #{self.class.identifier} after parsing was completed. Segments remaining: \n" + segments.map(&:to_s).join("\n")
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def values
|
|
141
|
+
@values ||= {}
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def increment(segment_identifier)
|
|
145
|
+
@sequences ||= Hash.new(0)
|
|
146
|
+
|
|
147
|
+
@sequences[segment_identifier] += 1
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def segment?
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def transaction_set?
|
|
155
|
+
true
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def segments
|
|
159
|
+
values.values.collect(&:segments).flatten
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def segment_count
|
|
163
|
+
segments.count
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def ancestors
|
|
167
|
+
if parent
|
|
168
|
+
[parent, parent.ancestors].flatten
|
|
169
|
+
else
|
|
170
|
+
[]
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def to_ary
|
|
175
|
+
nil
|
|
176
|
+
end
|
|
177
|
+
alias :to_a :to_ary
|
|
178
|
+
|
|
179
|
+
def to_s
|
|
180
|
+
output = ''
|
|
181
|
+
|
|
182
|
+
values.sort.each do |sequence, component|
|
|
183
|
+
output += component.to_s
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
output
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def get_component(identifier, sequence = nil)
|
|
190
|
+
if sequence.nil?
|
|
191
|
+
sequence = 0
|
|
192
|
+
else
|
|
193
|
+
sequence = sequence.to_i - 1
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
self.class.components.select do |c|
|
|
197
|
+
c.identifier == identifier
|
|
198
|
+
end[sequence]
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def get_component_by_name(name, sequence = nil)
|
|
202
|
+
sequence = if sequence.nil?
|
|
203
|
+
0
|
|
204
|
+
else
|
|
205
|
+
sequence.to_i - 1
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
self.class.components.select do |c|
|
|
209
|
+
if name.class == Regexp
|
|
210
|
+
c.options[:name] =~ name
|
|
211
|
+
else
|
|
212
|
+
c.options[:name] == name
|
|
213
|
+
end
|
|
214
|
+
end[sequence]
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def method_missing(method_name, *args)
|
|
218
|
+
component = if method_name == :find_by_name
|
|
219
|
+
get_component_by_name(args[0], args[1])
|
|
220
|
+
else
|
|
221
|
+
component_name, component_sequence = method_name.to_s.split('_')
|
|
222
|
+
get_component(component_name, component_sequence)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if component.nil?
|
|
226
|
+
raise Hippo_eyeDoc::Exceptions::InvalidSegment.new "Invalid segment specified: '#{method_name.to_s}'."
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
values[component.sequence] ||= component.initialize_component(self)
|
|
230
|
+
|
|
231
|
+
yield values[component.sequence] if block_given?
|
|
232
|
+
|
|
233
|
+
values[component.sequence]
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|