Commit Graph
4 Commits
Author SHA1 Message Date
Abhinav Gupta c161b09095 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
2026-10-09 10:42:54 +05:30
Abhinav Gupta 6a02ca2438 fix(pipeline): correct output arrangement, isolate noise, and properly assign primary vs secondary diagnoses 2026-10-08 13:34:03 +05:30
Abhinav Gupta ecaae40bbe fix(pipeline): word-boundary site matching, historical exclusion, trauma code gate, and retrieval fallback hardening
- ranker.py: Use \b word boundaries in has_matching_site to prevent 'fibula'
  matching inside 'calcaneofibular' (fixes S93.412A beating S93.422A).
  Add traumatic S/T code gate (-0.40) for non-trauma documentation.
- classifier.py: Expanded acuity detection (sepsis, infarction, STEMI/NSTEMI).
  Added pure-symptom suppression when definitive diagnoses are available.
  Improved primary/secondary classification reasons with evidence quotes.
  Fixed organism detection to exclude sepsis from supplementary code penalty.
- clinical_extractor.py: Detect historical/resolved diagnoses and mark with
  HISTORICAL role, zero relevance, and -50 admitting score. Added section
  types (PERTINENT_NEGATIVES, ASSESSMENT, PLAN). Fix sentence splitting to
  preserve decimal numbers (e.g. 101.4F). Skip metadata section headers.
- nodes.py: Refactored retrieval to use lexical_retriever for expansion
  queries and BM25 fallback (eliminates 80k-row full scan).
- tokenizer.py: Extended CLINICAL_MORPHOLOGY with renal/kidney/nephropathy,
  injury/failure, infarction/infarct/STEMI/NSTEMI mappings.
- clinical_gate.py: Added pertinent negatives, documentation audit, and
  final coding summary to metadata patterns. Extended prescription syntax.
- reverse_attributes.py: Added coronary/artery/vessel/wall/vein to
  non-specificity words for better attribute extraction.
- pipeline.py: Extract failed node name from traceback for error reporting.
- schemas/icd.py: Added 'fallback_token_scan' and 'vector_numpy' retrieval methods.
2026-10-07 12:32:27 +05:30
Abhinav Gupta 72d0da1c22 feat(pipeline): complete healing and hardening of clinical reasoning and matching pipeline
- Implement soft dimensional compatibility and 3-way attribute logic (SUPPORTED, CONTRADICTED, UNKNOWN)
- Replace binary hardwall rejection with nuanced compatibility scoring
- Isolate context per diagnosis to prevent cross-condition contamination (MD Sec 41)
- Generalize disease families (liver sarcoma, net, asthma, acl) and category priors
- Add regex word boundary acuity checking and laterality alignment scoring in ranker
- Fix candidate sort by sorting on unconstrained multi-factor raw score before output clamping
- Preserve zero-modification immutability of local Database_2.xlsx
- Pass 100% of full regression test suite (158/158 tests) and ruff linting
2026-10-06 14:43:16 +05:30