- 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
27 lines
938 B
Python
27 lines
938 B
Python
import runpy
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Ensure src/ is on Python search path
|
|
root_dir = Path(__file__).resolve().parent
|
|
src_dir = root_dir / "src"
|
|
if str(src_dir) not in sys.path:
|
|
sys.path.insert(0, str(src_dir))
|
|
|
|
# Automatically detect and include local virtual environment site-packages
|
|
for venv_name in ("env", ".venv", "venv"):
|
|
# Windows
|
|
win_sp = root_dir / venv_name / "Lib" / "site-packages"
|
|
if win_sp.exists() and str(win_sp) not in sys.path:
|
|
sys.path.insert(0, str(win_sp))
|
|
# Linux / macOS
|
|
linux_lib = root_dir / venv_name / "lib"
|
|
if linux_lib.exists():
|
|
for py_dir in linux_lib.glob("python*"):
|
|
sp = py_dir / "site-packages"
|
|
if sp.exists() and str(sp) not in sys.path:
|
|
sys.path.insert(0, str(sp))
|
|
|
|
# Import and execute main Streamlit UI reliably across browser refreshes
|
|
runpy.run_module("medical_coding.ui.app", run_name="__main__")
|