Files
cyclone/backend/tests/fixtures/minimal_835.txt
Tyler 2893676c0b fix(835): correct SVC04/SVC05 mapping per X12 005010X221A1
X12 835 SVC segment:
  SVC01 = composite procedure
  SVC02 = charge
  SVC03 = payment
  SVC04 = Unit or Basis for Measurement Code (UN, MJ, DA, ...)
  SVC05 = Service Unit Count

The parser previously read SVC04 as the units count and SVC05 as the
unit type — backwards. On real 835s (and the canonical minimal
fixture), SVC04 carries the code 'UN' which fails Decimal parsing, so
the units always came out as None and the code string was assigned to
unit_type. SP7's line-level matcher couldn't compare units on the SVC
side against the claim side because of this.

- _consume_service_payment: SVC04 → unit_type, SVC05 → units count
- Default unit_type to 'UN' when only the count is present
- minimal_835.txt + unbalanced_835.txt: swap positions to match spec
- Add 2 regression tests (units-and-unit-type, default-unit-type-to-UN)
2026-06-20 20:44:28 -06:00

22 lines
733 B
Plaintext

ISA*00* *00* *ZZ*COMEDASSISTPROG*ZZ*TPID001 *260617*1937*^*00501*991102984*1*P*:~ST*835*991102984*005010X221A1~
BPR*C*85.00*C*ACH*CCP*01*021000021*DA*123456789*81-1725341******20260617~
TRN*1*TPID001*81-1725341~
DTM*405*20260617~
N1*PR*2*CO_TXIX*****XV*7912900843~
N3*PO BOX 11000~
N4*DENVER*CO*802110000~
PER*BL*Customer Service*TE*8001234567*UR*hcpf.colorado.gov~
N1*PE*2*TOC, Inc.*****XX*1881068062~
N3*1100 East Main St*Suite A~
N4*Montrose*CO*814014063~
LX*1~
CLP*CLM001*1*100.00*85.00*15.00*MC*CLM001*12*1~
CAS*CO*45*15.00~
SVC*HC:S5130:U2*60.00*50.00*UN*7.73*20260602~
DTM*472*20260602~
SVC*HC:S5130:U2*40.00*35.00*UN*7.73*20260603~
DTM*472*20260603~
SE*22*991102984~
GE*1*991102984~
IEA*1*991102984~