pfs: keep the CPT manual as a second anchor when it confirms an FR-extracted element ("cpt confirms fr") #703

Closed
opened 2026-09-10 00:48:03 +00:00 by kert · 1 comment
Owner

From the P49 slice-2 reviews (Task 5 and whole-branch, 2026-09-09).

Today. extract_code reads elements from the FR descriptor runs first, then from the newest CPT edition's pfs.cpt_code row (stem/tail + required-elements list). Duplicates on (type, value, detail) keep the FR row and drop the CPT row, so on the live replica pfs.code_element has zero source='cpt' rows for the fixture families — the manual's independent transcription of the same element is discarded, and its value only shows for codes with thin FR coverage.

Ask. Preserve the cross-check without doubling row counts: either a confirmed_by column/list on pfs.code_element (e.g. cpt:GQGTPGYV) set when a second source yields the same element, or a small pfs.code_element_confirm(code, type, value, detail, source, item_key, p_id) table. The chat and notebook can then say "this element is stated by both the CPT manual (2024) and the CY2015 final rule". Also give ReviewRow a source column so CPT-sourced review lines are distinguishable from FR ones (today only item_key tells them apart).

Done when 99490's comprehensive-care-plan element shows both anchors, and the review queue rows carry their source.

From the P49 slice-2 reviews (Task 5 and whole-branch, 2026-09-09). **Today.** `extract_code` reads elements from the FR descriptor runs first, then from the newest CPT edition's `pfs.cpt_code` row (stem/tail + required-elements list). Duplicates on `(type, value, detail)` keep the FR row and drop the CPT row, so on the live replica `pfs.code_element` has zero `source='cpt'` rows for the fixture families — the manual's independent transcription of the same element is discarded, and its value only shows for codes with thin FR coverage. **Ask.** Preserve the cross-check without doubling row counts: either a `confirmed_by` column/list on `pfs.code_element` (e.g. `cpt:GQGTPGYV`) set when a second source yields the same element, or a small `pfs.code_element_confirm(code, type, value, detail, source, item_key, p_id)` table. The chat and notebook can then say "this element is stated by both the CPT manual (2024) and the CY2015 final rule". Also give `ReviewRow` a `source` column so CPT-sourced review lines are distinguishable from FR ones (today only `item_key` tells them apart). **Done when** 99490's `comprehensive-care-plan` element shows both anchors, and the review queue rows carry their source.
kert added this to the P49: Code families as first-class objects — element model, lineage anchors, longitudinal chat milestone 2026-09-10 00:48:03 +00:00
kert added the pfs label 2026-09-10 00:48:03 +00:00
Author
Owner

Done in 9073b3a (merge of 9803a9a): pfs.code_element gains confirmed_by (comma-separated source:item_key tokens set when a second source yields the same (type, value, detail) — row counts unchanged, FR > CPT > HCPCS > RVU precedence unchanged), pfs.code_element_review gains source; ensure_tables migrates existing tables; readers tolerate the old schema; stack pfs elements prints the confirmed count and stack pfs review shows the source. Live after re-extracting the five hand families: 118 elements across 18 codes carry a second-source confirmation; 99490's comprehensive-care-plan row is source=fr (DE2VH9PD ¶1247) confirmed_by cpt:GQGTPGYV — the done criterion. Notebook section 2 shows both anchors.

Done in 9073b3a (merge of 9803a9a): pfs.code_element gains confirmed_by (comma-separated source:item_key tokens set when a second source yields the same (type, value, detail) — row counts unchanged, FR > CPT > HCPCS > RVU precedence unchanged), pfs.code_element_review gains source; ensure_tables migrates existing tables; readers tolerate the old schema; stack pfs elements prints the confirmed count and stack pfs review shows the source. Live after re-extracting the five hand families: 118 elements across 18 codes carry a second-source confirmation; 99490's comprehensive-care-plan row is source=fr (DE2VH9PD ¶1247) confirmed_by cpt:GQGTPGYV — the done criterion. Notebook section 2 shows both anchors.
kert closed this issue 2026-09-11 20:59:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#703