diff --git a/docs/superpowers/specs/2026-07-02-cyclone-rendering-npi-extraction-design.md b/docs/superpowers/specs/2026-07-02-cyclone-rendering-npi-extraction-design.md index d5e6779..e4f224c 100644 --- a/docs/superpowers/specs/2026-07-02-cyclone-rendering-npi-extraction-design.md +++ b/docs/superpowers/specs/2026-07-02-cyclone-rendering-npi-extraction-design.md @@ -99,7 +99,7 @@ No `UPDATE` statements in the migration — backfill is a separate, deliberate s - `backend/src/cyclone/cli.py` — new `backfill-rendering-npi` subcommand. - `backend/src/cyclone/migrations/0019_add_rendering_and_service_provider_npis.sql` — D9. - `backend/tests/fixtures/` — new 837p fixture(s) with `NM1*82` and new 835 fixture(s) with `NM1*1P`. -- `backend/tests/test_reconcile.py` — new tests for D6 (set-membership, comma-split, fallback chain). +- `backend/tests/test_reconcile.py` — new tests for D6 (typed-column primary path, typed-column beats raw_json fallback, NPI arm fires when both sides populated). - `backend/tests/test_parse_835.py` — new test for `_consume_claim_payment` `NM1*1P` extraction. - `backend/tests/test_parse_837.py` — new test for rendering-provider loop extraction. @@ -128,7 +128,7 @@ No `UPDATE` statements in the migration — backfill is a separate, deliberate s ### Unit tests (matcher level) -- `test_reconcile.py`: comma-list set membership — single-CLP-remit with `Remittance.rendering_provider_npi = "1234567890,0987654321"` and `Claim.rendering_provider_npi = "0987654321"` counts NPI as a matched key. +- `test_reconcile.py`: typed-column primary path — `Remittance.rendering_provider_npi = "1234567890"` and `Claim.rendering_provider_npi = "1234567890"` counts NPI as a matched key. - `test_reconcile.py`: multi-key fallback — `NM1*1P` NPI absent (`None`) on one side, present on the other → NPI arm does not fire, PCN+charge still matches (1-of-2 effective, but per SP31 the rule is 2-of-3 of {PCN, charge, NPI}, so PCN+charge alone does NOT auto-link — must stay 2 of 3 with NPI also matching or charge differing). - `test_reconcile.py`: typed-column primary path beats `raw_json` fallback — fixture sets both, matcher uses typed column. - `test_reconcile.py`: existing 22+ SP31 tests still pass without modification.