Skip to content

Lab reports: add any lab PDF, check what the coach read, chart every marker by exam - #51

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Oct 30, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

New: My Health → Lab reports. Any lab report (blood, urine, hormones, anything) is added as a PDF, read by the coach, checked by the user, and every marker is charted exam by exam.

Reading

  • The PDF is rendered page by page on the phone (PdfRenderer, 1600 px, up to 10 pages) and sent as images to the user's own coach provider. Every provider reads it, the custom/local one included.
  • The model returns structured markers under a strict JSON schema: panel, name, a stable key, value, unit, the lab's printed range, collection date and lab.
  • Nothing is saved until the user checks it. On the review screen they can fix any value, unit, range or the date, or remove a row.
  • The flag is computed against the printed range. The model's marking only stands when there is no number or no range.

Screens

  • List: markers grouped by panel, with the latest value, a sparkline and where it sits against the range.
  • Notices: an amber notice when the latest report has markers outside the range, with "talk to your doctor".
  • Coach: an entry to ask the coach for a plan, and a switch for whether the coach uses the results.
  • Reports: each one opens its PDF and can be deleted.
  • Marker: a chart with one point per exam over the lab's range, drawn as an accent dither band, with points outside it in amber. Also the values table and the doctor notice.

Coach

  • A labs block in the context: each marker's latest value with its range and the two before it.
  • Rules in the block's note and the prompt: no diagnosis, outside-range values go to the doctor, no medication or supplement advice, and goals change only via set_goal after the user agrees to the exact numbers.
  • "Ask the coach for a plan" opens the chat with the request.

Data

  • Room v37: lab_reports, and lab_results with an FK cascade.
  • Reports, results and each PDF (base64) ride in the backup archive. The switch rides in ArchivedSettings.
  • Deleting a report removes its results and its PDF.
  • FileProvider path added for opening the PDF.

Also: pt-BR strings, unit tests for the pure rules (LabReportsTest), and an AGENTS.md section. The design canvas has the four boards (list, review, marker, coach plan), updated to match what was built. The plan is confirmed in the conversation rather than with Accept buttons, since set_goal covers steps, sleep and active minutes; food changes are suggestions.

CI green on 1a3083b. Not tried on a device.


Generated by Claude Code

…marker by exam

My Health -> Lab reports. A PDF of any lab report (blood, urine,
hormones, anything) is rendered page by page on the phone and read by
the user's own coach provider into structured markers: panel, name, a
stable key, value, unit and the lab's printed range. Pages go as images,
so every provider reads them, the custom one included.

- Nothing is saved until the user checks it: a review screen lets them
  fix any value, unit, range or date, or remove a row.
- The flag is computed against the printed range; the model's marking
  only stands without a number or a range.
- The list groups markers by panel with the latest value, a sparkline and
  where it sits; a marker opens a chart with one point per exam over the
  lab's range drawn as an accent dither band, amber when outside it.
- The coach gets the results (latest, range, earlier values) behind a
  switch, with rules: no diagnosis, outside-range values go to the
  doctor, no medication or supplement advice, goals only via set_goal
  after the user agrees. 'Ask the coach for a plan' opens the chat.
- Room v37 (lab_reports, lab_results with FK cascade); reports, results
  and each PDF as base64 ride in the backup, the switch in
  ArchivedSettings. Deleting a report removes its results and PDF.
- pt-BR strings, unit tests for the pure rules, AGENTS.md section.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit c4345da into main Oct 30, 2026
1 check passed
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