fix(sp41): CLM07 default 'Y' → 'A' (valid Assignment of Benefits code)

pyX12 caught a real serializer bug: CLM07 must be an Assignment
of Benefits code (A/B/C/P), NOT a Yes/No value. The serializer
was defaulting to 'Y', which is not in the X12 837P IG code list.

After fix:
- 10/10 batch-1 837P files: pyX12 OK
- 10/10 batch-2 837P files: pyX12 OK
- 20/20 parametric test: PASS (drives shipped SP40 validator + structural)
- 1568/1577 full backend suite: PASS
This commit is contained in:
Nora
2026-07-08 02:39:06 -06:00
parent e35e5e03b3
commit 019e09aff6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -330,8 +330,8 @@ def _build_clm(claim) -> str:
"", # CLM03 — non-institutional claim filing indicator
"", # CLM04 — non-institutional claim filing code
clm05, # CLM05 — composite POS:qualifier:frequency_code
claim.provider_signature or "Y", # CLM06
claim.assignment or "Y", # CLM07
claim.provider_signature or "Y", # CLM06 — Yes/No
claim.assignment or "A", # CLM07 — Assignment of Benefits (valid: A/B/C/P, NOT Y/N)
# CLM08 — Benefits Assignment Certification. X12 837P requires
# this when CLM07 = "Y" (the common case for in-network
# professional claims). Default to "Y" when the source did
+1 -1
View File
@@ -174,7 +174,7 @@ def build_claim_output(
facility_code_qualifier="B",
frequency_code="1",
provider_signature="Y",
assignment="Y",
assignment="A", # CLM07 Assignment of Benefits — valid codes are A/B/C/P, NOT Y/N (pyX12 caught this; "Y" was a serializer bug)
benefits_assignment_certification="Y",
release_of_info="Y",
prior_auth=visit.prior_auth,