Skip to content

Real-report accuracy, FHIR export, one-command demo, privacy page - #4

Merged
MaXiMo000 merged 7 commits into
mainfrom
real-reports-fhir-demo
Oct 10, 2026
Merged

MaXiMo000 merged 7 commits into
mainfrom
real-reports-fhir-demo

Conversation

@MaXiMo000

Copy link
Copy Markdown
Owner

What changed

Reading real reports. Every row of five real Quest and LabCorp sample reports (88 rows) was checked by hand against the PDF and pinned in expected.json.

  • Four extracted values were wrong, including a positive SARS-CoV-2 result read as "NOT DETECTED" from the reference column. Now none are.
  • Creatinine, five differential percentages, HbA1c and body weight mapped to the wrong LOINC codes. A curated stage for the names real reports print most now sits between alias and exact; the printed unit decides between a fraction and a count, and it applies to blood and serum only.
  • Offline (no LLM): 81 rows map correctly, none wrong, 7 go to review.
  • Rows named K and A1C were dropped without a trace. They are rows now.

FHIR export. GET /api/observations/{patient}/fhir returns the whole record as a FHIR R4 bundle, and the Record screen downloads it. A value travels in the unit of the range it was judged against; a row awaiting review goes out preliminary with the printed name and no code. The download is audited.

One-command demo. docker compose up --build starts everything, generates its own keys into a volume, and reads six generated reports through the real pipeline. A new CI job runs it and pulls the export through the nginx proxy.

Privacy page. /privacy states what is stored, what is encrypted, what can leave the server and who can see a record. Each line describes existing backend behaviour.

Housekeeping. The sample-report generator names a fictional patient, and backend/results.xml is no longer tracked.

Testing

  • Backend: 420 passed against a local MongoDB (the CI floor moves from 360 to 400).
  • Frontend: lint, 24 tests and build pass.
  • The demo seeder, sign-in, Record screen, privacy page and FHIR download were exercised locally against a seeded scratch database (121 bundle entries: 98 final, 22 preliminary).
  • docker compose up itself was not run locally; the demo CI job is its first run.

🤖 Generated with Claude Code

MaXiMo000 and others added 5 commits October 10, 2026 12:12
Checked every row of five real sample reports (88 rows) by hand against
the PDFs. Four values were wrong, including a positive SARS-CoV-2 result
read as "NOT DETECTED" from the reference column, and creatinine, five
differential percentages, HbA1c and body weight mapped to the wrong
LOINC codes.

- extract: split value+flag and value+unit glued by one space, strip
  "See Note" lines and site codes, read paired Component/Result columns,
  normalise "> OR =" ranges
- mapping: a curated stage for the names real reports print most, with
  the printed unit deciding between a fraction and a count; blood and
  serum only, so urine rows continue down the cascade
- expected.json pins all 88 rows; the extractor must match exactly

Offline: 81 rows map correctly, none wrong, 7 left for review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /api/observations/{patient}/fhir returns every row, and the Record
screen downloads it. A value travels in the unit of the range it was
judged against; a row awaiting review goes out as preliminary with the
printed name and no code. The download is audited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What is stored, what is encrypted, what can leave the server and who can
see a record, each line describing existing backend behaviour. Linked
from the landing page and sign-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A name needed two letters in a row, so a potassium printed as "K" and an
HbA1c printed as "A1C" vanished from the report without a trace. Also
adds the HGB, HCT, PLT, A1C and hyphenated LDL spellings to the curated
table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docker compose up --build starts Mongo, Redis, the API, the worker and
the built frontend behind nginx, generates its own keys into a volume,
and reads six generated reports through the real pipeline. CI runs it
and pulls the FHIR export through the proxy.

The sample reports now name a fictional patient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread frontend/Dockerfile Fixed
MaXiMo000 and others added 2 commits October 10, 2026 12:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It looked for the value "18" anywhere in the log, and a hex database id
contains it about once in several runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaXiMo000
MaXiMo000 merged commit 30be6fb into main Oct 10, 2026
5 checks passed
@MaXiMo000
MaXiMo000 deleted the real-reports-fhir-demo branch October 10, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants