fix(pfs): lineage — a Panel replacement is formation evidence for the codes it names

This commit is contained in:
kert
2026-11-12 03:28:10 -05:00
parent 4a820e8c73
commit b6107b95ba
2 changed files with 20 additions and 2 deletions

View File

@@ -164,8 +164,8 @@ _CREATING = re.compile(r"\b(?:creat\w*|new)\b", re.I)
#: a cpt_panel event about revising, creating, splitting or replacing codes
#: (formation evidence), not about deleting them
_PANEL_KEEP = re.compile(
r"\b(?:revis|creat|establish|split)\w*|\breplac\w*\s+(?:it\s+)?with\b"
r"|\breplacing\b|\bnew\s+(?:CPT\s+)?codes?\b|\baddition\b",
r"\b(?:revis|creat|establish|split|replac)\w*|\bnew\s+(?:CPT\s+)?codes?\b"
r"|\baddition\b",
re.I,
)

View File

@@ -393,6 +393,24 @@ class TestNewKinds:
"test), and CPT code 94618 (Pulmonary stress testing) from the now "
"deleted CPT code 94620 (Pulmonary stress testing; simple).",
)
_add_para(
store,
"NV3Q43B7",
1611,
"For CY 2013, the CPT Editorial Panel deleted CPT codes 32420, 32421, "
"and 32422 and replaced them with CPT codes 32554 and 32555.",
)
_add_para(
store,
"DE2VH9PD",
1143,
"For CY 2015, the CPT Editorial Panel replaced CPT code 76645 "
"(Ultrasound, breast) with two codes, CPT codes 76641 and 76642.",
)
for code in ("32554", "32555", "76641", "76642"):
kinds = {e.kind for e in fr_events(store, code)}
assert "cpt_panel" in kinds and "deleted" not in kinds, code
assert "deleted" in {e.kind for e in fr_events(store, "32420")}
for code in ("92654", "92663", "95940", "95941", "94617", "94618"):
kinds = {e.kind for e in fr_events(store, code)}
assert "cpt_panel" in kinds, code