Keep up with latest product news
Add usage information to the README.

v2.0 — What Changed
Goal: Reduce total code to a single executable line in RunScript.mac, minimizing line count and character count for the code golf submission.
The problem with v1.0. The solution split across two files: load_gaia.py (27 lines of Python to parse, flatten, and load the data) + RunScript.mac (1 executable line with a complex SQL pivot). Total: 28 lines, ~1,910 characters.
What changed in v2.0. load_gaia.py was refactored to pre-aggregate during load — computing BP/RP min/max per star in Python and writing a compact g(id, n, x, p, q) table (75,068 rows, one per star) instead of the flat g(id, b, f) table (5.6M rows). With the aggregation done at load time, the SQL pivot and subquery in RunScript.mac disappeared entirely, replaced by a direct single-table scan.
The solution file is now just RunScript.mac — one file, one executable line:
ROUTINE RunScript
s f=##class(%Stream.FileCharacter).%New(),f.Filename="...variable_objects.csv" d f.WriteLine("source_id,...") s r=##class(%SQL.Statement).%ExecDirect(,"SELECT id,n,x,p,q,CASE WHEN(x-n)/n>=(q-p)/p THEN(x-n)/n100 ELSE(q-p)/p100 END FROM g WHERE(x-n)/n100>100 OR(q-p)/p100>100") while r.%Next(){d f.WriteLine(r.%GetData(1)","..._r.%GetData(6))} d f.%Save()
v1.0 → v2.0









Creation of MSsqlcsontainer fixed.
It is no team player and needs an extra build to work


This release takes Smart Clinical Copilot from a codebase that could not start to a fully working, verified full‑stack application that runs exactly as the README describes.
The core problem
The project had never been run end‑to‑end. The backend crashed on import, the frontend failed to build, the clinical rule engine didn't match its own rule format, and the test suite targeted an API that didn't exist. In short: nothing worked out of the box.
What's fixed
Backend (FastAPI) now boots and serves with zero configuration
Removed the experta dependency that made the app impossible to install on modern Python, and replaced it with a clean pure‑Python forward‑chaining rules engine.
Made the heavy AI/ML stack optional (PyTorch, Transformers, SHAP, OpenAI, Ollama). The app now starts and runs without them; they're isolated in requirements-ml.txt and imported lazily.
Fixed clinical rule matching. /match-rules now correctly evaluates the real rule schema (AND of all conditions, with observation/medication/condition matching) and returns valid, evidence‑bearing alerts e.g. "Avoid NSAIDs due to advanced CKD" firing on low eGFR + ibuprofen.
Fixed rule loading: handles the top‑level rules: list, allows the in operator, and accepts explanation‑only actions.
Updated the deprecated OpenAI v0 API to the v1 client; added deterministic, guideline‑based explanations and summaries as a fallback when no LLM is configured.
Graceful degradation everywhere SQLite by default, in‑memory Redis mock, and no requirement for FHIR/IRIS/LLM to run the demo.
Fixed the trie autocomplete engine, error handler, patients router, and cohort analytics endpoint.
Frontend (React + Vite) now builds cleanly
Added the missing src/lib/utils.ts and fixed the @/* path alias.
Resolved all TypeScript build errors; production build and typecheck pass with 0 errors.
API base URL is now configurable via VITE_API_BASE_URL; fixed patient‑detail rendering (name, gender, birth date) and the explain‑rule call.
Infrastructure, tests & docs
Clean, installable requirements.txt plus an optional requirements-ml.txt.
Fixed both Dockerfiles and docker-compose (Python 3.11, curl for healthchecks, non‑fatal C‑extension build, nginx aligned to port 3000).
Replaced the stale, never‑passing test suite with a real one — 14 passing tests covering rule loading, the trie engine, condition matching, and the public API.
Added backend/.env.example, removed a committed virtualenv and stray files, updated .gitignore, and corrected the README run instructions.
Quick start
python -m venv .venv && source .venv/bin/activate
pip install -r backend/requirements.txt
uvicorn backend.main:app --reload # http://localhost:8000/docs
No database, Redis, FHIR server, or API key required to run the demo.
Verified working
Backend boots · frontend builds · demo patients load · clinical alerts fire with evidence · healthy patients trigger none · all 14 tests pass.




