fix(pipeline): implement comprehensive improvements across five key areas on noise-fix
- Area 1: Complete clinical inventory generation with compound concept decomposition (secondary to/due to), laterality preservation, and deduplication - Area 2: First-class assertion, negation, entity typing, and CMS Guideline I.B.4 integral symptom suppression - Area 3: Semantic code validation beyond database existence via reverse attribute matching and specificity downgrading - Area 4: Strict UHDDS primary vs secondary role separation with complete deduplication and HTML escape rendering in Streamlit components - Area 5: Exact clinical provenance preservation and 6-metric diagnostic scorecard with comprehensive regression tests
This commit is contained in:
@@ -338,10 +338,18 @@ class HardClinicalCandidateGate:
|
||||
if not words.intersection(PATHOLOGY_KEYWORDS):
|
||||
return ClinicalEntityType.INVESTIGATION
|
||||
|
||||
# 10. Symptoms & Signs
|
||||
if any(sym in term_lower for sym in ["pain", "cough", "nausea", "vomiting", "dyspnea", "shortness of breath", "fatigue", "malaise", "colic", "dizziness"]):
|
||||
# 10. Organisms and Microbiological Findings
|
||||
if any(org in term_lower for org in ["e. coli", "escherichia coli", "klebsiella", "pseudomonas", "staphylococcus", "streptococcus", "candida", "h. pylori", "helicobacter"]):
|
||||
return ClinicalEntityType.CLINICAL_FINDING
|
||||
|
||||
# 10b. Laboratory Results & Abnormal Findings
|
||||
if any(lab in term_lower for lab in ["leukocytosis", "thrombocytopenia", "elevated troponin", "elevated creatinine", "hypokalemia", "hyperkalemia", "hyponatremia", "acidosis", "alkalosis"]):
|
||||
return ClinicalEntityType.LAB_RESULT
|
||||
|
||||
# 10c. Symptoms & Signs
|
||||
if any(sym in term_lower for sym in ["pain", "cough", "nausea", "vomiting", "dyspnea", "shortness of breath", "fatigue", "malaise", "colic", "dizziness", "dyspepsia", "indigestion", "heartburn", "headache", "discomfort", "orthopnea", "hematuria"]):
|
||||
return ClinicalEntityType.SYMPTOM
|
||||
if any(sign in term_lower for sign in ["tachycardia", "tachypnea", "fever", "hypotension", "wheezing", "rales", "edema", "swelling"]):
|
||||
if any(sign in term_lower for sign in ["tachycardia", "tachypnea", "fever", "hypotension", "wheezing", "rales", "edema", "swelling", "cyanosis", "jaundice", "pallor"]):
|
||||
return ClinicalEntityType.SIGN
|
||||
|
||||
# 11. Neoplasms
|
||||
|
||||
Reference in New Issue
Block a user