feat(parsers+api): 270/271 eligibility request + response (SP3 P4)
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.
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
ISA*00* *00* *ZZ*SUBMITTERID *ZZ*RECEIVERID *240101*1200*^*00501*000000001*0*P*:~
|
||||
GS*HC*SUBMITTERID*RECEIVERID*20240101*1200*1*X*005010X279A1~
|
||||
ST*270*0001*005010X279A1~
|
||||
BHT*0022*13*REF123*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~
|
||||
EQ*1^30~
|
||||
SE*10*0001~
|
||||
GE*1*1~
|
||||
IEA*1*000000001~
|
||||
Reference in New Issue
Block a user