Inspiration

Lab reports are full of numbers, abbreviations and reference ranges. Many people get their results before they can talk to a doctor, and they often leave confused or anxious. Searching the web can make it worse. I wanted to build a safe, simple tool that explains results in plain language and helps people ask better questions.

What it does

LabLens lets you enter lab values (blood count, fasting glucose, lipids) and instantly shows whether each one is low, in range, high or urgent. Then it explains in simple English what the test measures, common reasons for the result, and what to ask your doctor. It supports sex-specific ranges, mg/dL and mmol/L conversion, and the reference range printed on your own lab report. Dangerous values trigger a red warning to contact a doctor today.

How we built it

The app is plain HTML, CSS and JavaScript hosted on GitHub Pages. A rules engine decides each status, so the AI never makes medical decisions. For explanations, the page sends only the test name, value, unit and status to a Cloudflare Worker, which hides the API key, accepts requests only from our site and calls Google Gemini. The AI prompt forbids diagnosis, medication advice and changing statuses. The app also has 14 built-in self-tests for the status logic.

Challenges we ran into

The hardest part was keeping the AI safe: we separated "what the result is" (fixed rules) from "what it means" (AI explanation). We also had to protect the API key with a server-side proxy, fix cross-origin (CORS) errors, and replace an outdated Gemini model name.

Accomplishments that we're proud of

A working end-to-end prototype with a safety-first design, privacy by design (no personal data sent to the AI), unit conversion, urgent-value alerts, and automated tests. Reference ranges were checked against MedlinePlus, ADA and AHA sources.

What we learned

How to combine deterministic rules with generative AI responsibly, how to deploy a serverless proxy, and why reference ranges and units matter so much in healthcare software.

What's next for LabLens

More languages (for example Kazakh and Russian), photo scanning of lab sheets, more test panels, and review by healthcare professionals before any wider release. LabLens is educational only and does not diagnose.

Built With

Share this project:

Updates

Submission history