a665881d24
Adds API-only 270/271 eligibility flow per spec section 3.4 (no UI, no
DB persistence). Operator pastes a 270 query, gets back raw 270 text,
submits manually, pastes the 271 back.
New models (270 + 271):
- InformationSource, InformationReceiver, Subscriber, Patient
- EligibilityBenefitInquiry (EQ) and CoverageBenefit (EB)
- Inline SERVICE_TYPE_CODES dict (566 codes, snapshot 2026-06-20)
- service_type_description() lookup helper
Parsers (single segment walker, defensive, mirrors 835 pattern):
- parse_270: HL*20/21/22/23 loops + EQ, NM1, DMG, TRN
- parse_271: HL*20/21/22/23 loops + EB, DTP, MSG, AAA
Serializer:
- serialize_270: ISA/GS/ST/BHT/HL*20/21/22/patient/EQ/SE/GE/IEA
- round-trips: serialize -> parse -> serialize == identical
API:
- POST /api/eligibility/request (JSON body -> {raw_270_text, parsed})
- POST /api/eligibility/parse-271 (file upload -> structured summary)
- 400 on missing fields / garbage; never 500.
Tests: 365 -> 408 backend (+43 new), 10 frontend unchanged.
TypeScript clean.
20 lines
541 B
Plaintext
20 lines
541 B
Plaintext
ISA*00* *00* *ZZ*PAYERID *ZZ*PROVIDERID *240101*1200*^*00501*000000002*0*P*:~
|
|
GS*HC*PAYERID*PROVIDERID*20240101*1200*2*X*005010X279A1~
|
|
ST*271*0001*005010X279A1~
|
|
BHT*0022*11*REF456*20240101*1200~
|
|
HL*1**20*1~
|
|
NM1*PR*2*PAYER NAME*****PI*SKCO0~
|
|
HL*2*1*21*1~
|
|
NM1*1P*2*PROVIDER NAME*****XX*1234567890~
|
|
HL*3*2*22*0~
|
|
TRN*2*TRACE001~
|
|
NM1*IL*1*DOE*JOHN*A***MI*MEMBER123~
|
|
DMG*D8*19800101*M~
|
|
EB*1*IND*30**Y*1~
|
|
MSG*Patient has active coverage~
|
|
EB*88*IND**100*N**~
|
|
MSG*Pharmacy copay $20~
|
|
SE*13*0001~
|
|
GE*1*2~
|
|
IEA*1*000000002~
|