feat(pipeline): complete multi-diagnosis classification, UHDDS role assignment, and robust ICD code retrieval

This commit is contained in:
Abhinav Gupta
2026-10-07 11:02:19 +05:30
parent f5ec8a66de
commit a75ec4700a
9 changed files with 314 additions and 85 deletions
+6 -1
View File
@@ -543,7 +543,12 @@ class CandidateRankingAgent(BaseAgent):
is_acute_doc = bool(re.search(r"\b(?:acute|exacerbation|decompensated|decompensation)\b", full_context))
is_chronic_doc = bool(re.search(r"\b(?:chronic|longstanding)\b", full_context) or (re.search(r"\bcompensated\b", full_context) and not re.search(r"\bdecompensated\b", full_context)))
is_acute_cand = "acute" in desc_lower and "chronic" not in desc_lower
is_acute_cand = (
("acute" in desc_lower and "chronic" not in desc_lower)
or cand.code.startswith(("I21", "J20", "K35", "K85", "N10", "N17"))
or (cand.code.startswith("K80") and "acute" in desc_lower)
or (cand.code.startswith("K81") and "acute" in desc_lower)
)
is_chronic_cand = "chronic" in desc_lower and "acute" not in desc_lower
is_acute_on_chronic_cand = "acute on chronic" in desc_lower or (
"acute" in desc_lower and "chronic" in desc_lower