0% found this document useful (0 votes)
8 views22 pages

Project

The Lab Results Interpreter is an AI-powered web application designed to help users understand their blood test results by extracting data from PDF lab reports and providing simple explanations for abnormal values. Built using React.js, Python FastAPI, and Claude AI, the system allows users to upload reports, view health trends, and receive personalized insights. The project aims to assist patients, especially those who struggle with medical terminology, in tracking their health over time.

Uploaded by

palwinder2026.cr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views22 pages

Project

The Lab Results Interpreter is an AI-powered web application designed to help users understand their blood test results by extracting data from PDF lab reports and providing simple explanations for abnormal values. Built using React.js, Python FastAPI, and Claude AI, the system allows users to upload reports, view health trends, and receive personalized insights. The project aims to assist patients, especially those who struggle with medical terminology, in tracking their health over time.

Uploaded by

palwinder2026.cr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lab Results Interpreter — Project Report Confidential | 2026

PROJECT DOCUMENTATION REPORT

Lab Results Interpreter


AI-Powered Blood Test Analysis & Health Tracking System

[Link] | Python FastAPI | Claude AI |


PostgreSQL
PDF Parsing | NLP | Trend Analysis | Free
Deployment

Project Type Timeline Prepared


College / Freelance 4 Weeks May 2026

Page 1 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

Table of Contents

1. Project Overview & Objectives 3


2. Tech Stack (What Languages & Tools We Use) 4
3. System Architecture (How Everything Connects) 5
4. Database Design 6
5. Backend — Python FastAPI (All Modules) 7
6. Frontend — [Link] (All Pages & Components) 9
7. AI Integration — Claude API 10
8. API Endpoints (Complete List) 11
9. Folder Structure 12
10. Step-by-Step Development Plan 13
11. Deployment Guide (Free — No Domain Needed) 14
12. Project Budget & Pricing 15
13. What the Client/Evaluator Will See 16

Page 2 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

1. Project Overview & Objectives

This project is an AI-powered web application that helps users understand their blood test /
lab reports. Most people receive medical lab results as PDF files but have no idea what the
values mean. This app solves that problem — users upload their lab report, the system
reads it, highlights abnormal values, explains them in simple English, and tracks their health
trends over time.

What Problem Does It Solve?


• Patients receive blood test PDFs but cannot understand the medical terms
• Doctors are too busy to explain every value in detail
• People forget to compare their current results with previous ones
• There is no simple tool that explains lab values in plain language

What Does Our App Do?


1. User uploads their blood test PDF
2. App reads and extracts all values (Hemoglobin, Sugar, Cholesterol etc.)
3. Highlights values that are too HIGH or too LOW in red/green
4. AI explains each abnormal value in simple English (no medical jargon)
5. Tracks history — user can compare current vs last visit results
6. User can download a clean summary report

Target Users
• College students submitting health check results
• Patients who want to understand their reports before visiting doctor
• Elderly people who cannot understand medical terms
• Health-conscious individuals tracking their wellness over time

Page 3 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

2. Tech Stack — What Languages & Tools We Use

Below is the complete list of technologies we will use. Do not worry if you don't know all of them —
we will explain each one simply.

Frontend (What the User Sees — Website UI)


Technology What It Does / Why We Use It
[Link] Builds the website — buttons, pages, forms, charts
Tailwind CSS Makes the website look beautiful without writing much CSS
Axios Sends data from website to our backend (like sending a
message)
React Router Handles navigation between pages (like Home, Upload,
History)
Recharts Draws graphs and charts to show health trends over time
React PDF Viewer Shows the uploaded PDF on screen so user can see it

Backend (The Brain — Runs on Server)


Technology What It Does / Why We Use It
Python Main programming language for backend — best for AI/ML
tasks
FastAPI Creates the REST API — receives requests and sends
responses
PyMuPDF (fitz) Reads and extracts text from PDF files
pdfplumber Extracts tables from PDF (good for structured lab reports)
SQLAlchemy Connects Python code to the database
Alembic Manages database changes (like Git but for database)
PyJWT Creates secure tokens for user login (JWT Authentication)
bcrypt Encrypts user passwords so they are never stored as plain
text
Anthropic SDK Connects to Claude AI for generating explanations
python-dotenv Reads secret keys from .env file safely
Uvicorn Runs the FastAPI server

Page 4 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

Database (Where Data is Stored)


Technology What It Does / Why We Use It
PostgreSQL Main database — stores users, reports, lab values, history
Redis (optional) Fast cache memory — speeds up repeated requests

Deployment (Making It Live on Internet — FREE)


Service What It Does
[Link] Hosts the Python backend for FREE — gives a public URL
[Link] Hosts the React frontend for FREE — gives a public URL
Render PostgreSQL Free database hosting (included with Render)
GitHub Stores the code — Render and Vercel connect to GitHub
automatically
Claude API Anthropic's AI — we call this to get explanations (small cost
~Rs. 500-1000)

Page 5 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

3. System Architecture — How Everything Connects

Think of the architecture like a restaurant: React (Frontend) is the dining area where
customers sit. FastAPI (Backend) is the kitchen where orders are processed. PostgreSQL
(Database) is the storage room. Claude AI is the expert chef for special dishes (AI
explanations).

Simple Flow Diagram (Text Format)


USER (Browser)
| Opens React website, uploads PDF, views results
v
REACT FRONTEND (Vercel — free URL)
| Sends HTTP requests with PDF / user data
v
FASTAPI BACKEND (Render — free URL)
| Parses PDF -> Extracts Values -> Calls AI -> Saves to DB
|
+-----> POSTGRESQL DATABASE (Render)
| Stores: users, reports, lab values, history
|
+-----> CLAUDE AI API (Anthropic)
Generates plain English explanations for lab values

Page 6 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

4. Database Design — What Data We Store

We use PostgreSQL as our database. Think of it like Excel sheets — each table is one sheet with
rows and columns.

Table 1: users
Column Name What It Stores
id Unique number for each user (auto-generated)
name Full name of the user
email Email address (used for login)
password_hash Encrypted password (never stored as plain text)
created_at When the user registered
date_of_birth Optional — for age-based normal range comparison
gender Optional — some lab values have different ranges for
male/female

Table 2: lab_reports
Column Name What It Stores
id Unique ID for each report
user_id Links to the user who uploaded this report
filename Name of the uploaded PDF file
upload_date When the report was uploaded
lab_name Name of the lab (extracted from PDF if available)
report_date Date on the lab report
raw_text All text extracted from the PDF (stored for reference)

Table 3: lab_values
Column Name What It Stores
id Unique ID for each value
report_id Links to which report this value belongs to

Page 7 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

test_name E.g. Hemoglobin, Blood Sugar, Cholesterol


value The actual number from the report (e.g. 11.2)
unit The unit (e.g. g/dL, mg/dL, %)
normal_min Minimum normal value
normal_max Maximum normal value
status HIGH / LOW / NORMAL (calculated by our system)
ai_explanation Plain English explanation generated by Claude AI

Page 8 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

5. Backend — Python FastAPI (All Modules Explained)

The backend is the heart of our application. It receives requests from the website, processes data,
and sends back results. Here is every file we will create and what it does:

Project Folder Structure — Backend


backend/
├── [Link] # App starts here
├── [Link] # Connect to PostgreSQL
├── .env # Secret keys (API keys, DB URL)
├── [Link] # All Python packages list
├── models/
│ ├── [Link] # User table structure
│ ├── [Link] # Lab report table structure
│ └── lab_value.py # Lab values table structure
├── routes/
│ ├── [Link] # Register, Login, Logout
│ ├── [Link] # Upload PDF, Get reports
│ └── [Link] # Get analysis, trends
├── services/
│ ├── pdf_parser.py # Reads and extracts PDF text
│ ├── value_extractor.py # Finds lab values from text
│ ├── normal_ranges.py # Stores normal value ranges
│ └── ai_service.py # Calls Claude AI for explanations
├── middleware/
│ └── auth_middleware.py # Checks JWT token on every request
└── utils/
└── [Link] # Small helper functions

Key Backend Modules Explained Simply


File / Module Simple Explanation
[Link] Entry point — starts the server, registers all routes
[Link] Opens connection to PostgreSQL database
models/[Link] Defines what columns the users table has
routes/[Link] Handles /register and /login — creates accounts and
checks passwords
routes/[Link] Handles PDF upload — saves file and triggers analysis
services/pdf_parser.py Uses PyMuPDF to open PDF and extract all text
services/value_extractor.py Uses pattern matching (regex) to find values like
'Hemoglobin: 11.2 g/dL'

Page 9 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

services/normal_ranges.py Dictionary of 50+ common tests with their normal


min/max values
services/ai_service.py Sends extracted values to Claude AI and gets plain
English explanation back
middleware/auth_middleware.py Before every request, checks if user is logged in using
JWT token

How PDF Parsing Works (Step by Step)


7. User uploads PDF from React website
8. FastAPI receives the file and saves it temporarily
9. pdf_parser.py opens the file using PyMuPDF library
10. All text is extracted page by page
11. value_extractor.py scans the text looking for patterns like 'TestName : Value Unit'
12. Each found value is compared to normal_ranges.py to determine if HIGH/LOW/NORMAL
13. All values are saved to lab_values table in database
14. ai_service.py sends abnormal values to Claude AI
15. Claude AI returns explanation in simple English
16. Explanations are saved and sent back to frontend

Page 10 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

6. Frontend — [Link] (All Pages & Components)

All Pages We Will Build


Page Name What the User Sees & Does
/ (Home Page) Welcome screen — explains what the app does,
Login/Register buttons
/register Sign up form — name, email, password
/login Login form — email and password
/dashboard User's main screen after login — shows recent reports
summary
/upload Drag-and-drop area to upload PDF lab report
/report/:id Full analysis of one report — all values, colors, AI
explanations
/history All past reports — user can click any to view details
/trends Graphs showing how values changed across multiple
reports

Key React Components


Component What It Does
[Link] Top navigation bar with logo, links, logout button
[Link] Drag-and-drop PDF upload area with progress bar
[Link] Shows one lab value — name, value, HIGH/LOW/NORMAL
badge
[Link] Shows AI-generated explanation in a clean card
[Link] Line graph showing value changes over multiple reports
(Recharts)
[Link] Quick overview of report — how many
HIGH/LOW/NORMAL values
[Link] Redirects to login if user is not authenticated
[Link] Shows animation while waiting for backend response

What User Sees on Report Page

Page 11 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

• Red badge: HIGH — value is above normal range


• Green badge: NORMAL — value is within safe range
• Orange badge: LOW — value is below normal range
• AI explanation box below each abnormal value
• Download button to save summary as PDF

Page 12 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

7. AI Integration — How We Use Claude AI

We use Anthropic's Claude AI to generate plain English explanations for abnormal lab
values. This is the most impressive part of the project — instead of just showing numbers,
the app tells the user what those numbers mean in their own language.

How It Works (Simple Explanation)


17. Our backend collects all lab values that are HIGH or LOW
18. We create a message to Claude AI like: 'This patient has Hemoglobin 8.2 g/dL (normal: 12-
16). Please explain this in simple English.'
19. Claude AI reads this and replies in plain English
20. We save this explanation in database and show it to user

Example AI Interaction
We send to Claude AI:
"The patient has these abnormal lab values:
- Hemoglobin: 8.2 g/dL (Normal: 12.0-16.0) — LOW
- Blood Sugar: 145 mg/dL (Normal: 70-110) — HIGH
Explain each one in simple English for a non-medical person."

Claude AI replies:
Hemoglobin (8.2 - LOW): Your hemoglobin is lower than normal.
This means your blood is carrying less oxygen than it should.
This is called anemia. You might feel tired or dizzy.
Consider eating iron-rich foods like spinach, dal, and eggs.

Cost of Using Claude AI


• Claude API is a paid service but very affordable for a college project
• For testing and demo: estimated cost Rs. 500 - Rs. 1,000 total
• For a live production app: depends on number of users
• Free tier is available for initial development and testing

Page 13 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

8. API Endpoints — Complete List

These are all the routes (URLs) that our backend will have. The frontend calls these to get and
send data.

Authentication Routes
Method + URL What It Does
POST /auth/register Create new user account — takes name, email,
password
POST /auth/login Login — takes email+password, returns JWT token
POST /auth/logout Logout — invalidates the token
GET /auth/me Get current logged-in user's details

Report Routes
Method + URL What It Does
POST /reports/upload Upload a PDF file — triggers parsing and AI analysis
GET /reports/ Get list of all reports for logged-in user
GET /reports/{id} Get full details of one specific report
DELETE /reports/{id} Delete a report
GET /reports/{id}/values Get all lab values extracted from one report

Analysis Routes
Method + URL What It Does
GET /analysis/trends/{test_name} Get trend data for one test (e.g. Hemoglobin) across
all reports
GET /analysis/summary Get overall health summary for the user
POST /analysis/explain/{value_id} Re-generate AI explanation for a specific value

All routes except /auth/register and /auth/login require a valid JWT token in the request
header. This means user must be logged in to use the app.

Page 14 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

9. Complete Folder Structure

lab-results-interpreter/
├── backend/ # Python FastAPI
│ ├── [Link]
│ ├── [Link]
│ ├── .env # API keys, DB URL
│ ├── [Link]
│ ├── models/
│ │ ├── [Link]
│ │ ├── [Link]
│ │ └── lab_value.py
│ ├── routes/
│ │ ├── [Link]
│ │ ├── [Link]
│ │ └── [Link]
│ ├── services/
│ │ ├── pdf_parser.py
│ │ ├── value_extractor.py
│ │ ├── normal_ranges.py
│ │ └── ai_service.py
│ └── middleware/
│ └── auth_middleware.py

├── frontend/ # [Link]
│ ├── public/
│ ├── src/
│ │ ├── [Link] # Main app with routes
│ │ ├── [Link] # React entry point
│ │ ├── pages/
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ └── [Link]
│ │ ├── components/
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ ├── [Link]
│ │ │ └── [Link]
│ │ ├── api/
│ │ │ └── [Link] # API configuration
│ │ └── context/
│ │ └── [Link] # Login state management
│ ├── [Link]
│ └── [Link]

└── [Link] # Setup instructions

Page 15 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

10. Step-by-Step Development Plan

Week Tasks to Complete


Week 1 Day 1-3 Setup GitHub repo, install Python + [Link], create folder structure,
connect to PostgreSQL database, create all database models (tables)
Week 1 Day 4-7 Build authentication routes (register, login, logout), test with Postman,
setup JWT token system
Week 2 Day 1-4 Build PDF upload route, integrate PyMuPDF for text extraction, build
value_extractor.py to find lab values from text
Week 2 Day 5-7 Connect Claude AI API, build ai_service.py, test that explanations are
generated correctly for abnormal values
Week 3 Day 1-4 Build React frontend — Home, Login, Register, Dashboard pages,
connect to backend API
Week 3 Day 5-7 Build Upload page, Report Detail page, LabValueCard components with
color-coded HIGH/LOW/NORMAL badges
Week 4 Day 1-3 Build History and Trends pages, add Recharts graphs for value trends
over time
Week 4 Day 4-7 Testing all features, fix bugs, deploy backend on [Link], deploy
frontend on Vercel, share live URLs

Page 16 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

11. Deployment Guide — Free, No Domain Needed

We will deploy this project for FREE using [Link] (backend) and Vercel (frontend). No
domain purchase is needed. Both platforms give you a free URL like [Link]
that you can share with anyone.

Step 1 — Push Code to GitHub


21. Create a GitHub account at [Link]
22. Create a new repository called 'lab-results-interpreter'
23. Push both backend/ and frontend/ folders to GitHub

Step 2 — Deploy Backend on [Link]


24. Go to [Link] and create a free account
25. Click 'New Web Service' and connect your GitHub repository
26. Select the backend/ folder as root directory
27. Set Build Command: pip install -r [Link]
28. Set Start Command: uvicorn main:app --host [Link] --port 8000
29. Add environment variables: DATABASE_URL, ANTHROPIC_API_KEY, SECRET_KEY
30. Click Deploy — Render gives you a URL like: [Link]

Step 3 — Deploy PostgreSQL on Render


31. On Render dashboard, click 'New PostgreSQL'
32. Give it a name, select free tier
33. Copy the 'External Database URL' and paste it as DATABASE_URL in backend settings

Step 4 — Deploy Frontend on Vercel


34. Go to [Link] and create a free account
35. Click 'Import Project' and connect GitHub repository
36. Select the frontend/ folder as root directory
37. Add environment variable: VITE_API_URL = your Render backend URL
38. Click Deploy — Vercel gives you a URL like: [Link]

Final Live URLs You Will Share With Client/Evaluator

Page 17 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

What URL Format


Frontend (Website) [Link]
Backend API Docs [Link]
Backend Health Check [Link]

NOTE: Free tier on [Link] may 'sleep' after 15 minutes of no activity. The first request
after sleep may take 30-60 seconds to load. This is normal for free tier — it is perfectly fine
for a college project demo.

Page 18 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

12. Project Budget & Pricing

Infrastructure Cost (What YOU Pay to Build It)


Service Cost
[Link] (Backend Hosting) Rs. 0 — Free Tier
[Link] (Frontend Hosting) Rs. 0 — Free Tier
Render PostgreSQL (Database) Rs. 0 — Free Tier
GitHub (Code Repository) Rs. 0 — Free
Claude AI API (Testing & Demo) Rs. 500 — Rs. 1,000 approx.
Domain Name Rs. 0 — NOT NEEDED
SSL Certificate (HTTPS) Rs. 0 — Included with Render & Vercel
TOTAL COST TO BUILD Rs. 500 — Rs. 1,000 only

What to Charge the Client (College Project)


Package Price (INR) Includes
Basic Rs. 8,000 – 12,000 Backend only, API docs,
free deployment
Standard Rs. 15,000 – 20,000 Full stack (React + Python),
all features, deployment
Premium Rs. 25,000 – 35,000 Full stack + trend charts +
download PDF + support

RECOMMENDED: Quote Rs. 15,000 – Rs. 20,000 for this complete project. Your profit after
API costs will be Rs. 14,000 – Rs. 19,000. This is fair for a college-level AI-powered full-
stack project in India.

Your Profit Calculation


Item Amount
Client Payment (Standard Package) Rs. 18,000
Claude API Cost - Rs. 1,000
Your NET Profit Rs. 17,000

Page 19 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

Time Required 3-4 Weeks


Hourly Rate (approx.) Rs. 500-600/hour

Page 20 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

13. What Client / Evaluator Will See

Live Demo Flow (Walk Through This During Presentation)


39. Open the website URL on browser
40. Show the home page — explain what the app does
41. Register a new account with a sample email
42. Upload a sample blood test PDF (prepare one in advance)
43. Show the loading animation while backend processes the PDF
44. Show the results page — all values in a clean table with color badges
45. Click on an abnormal value to see the AI explanation
46. Go to Trends page — show the graph of values over time (upload 2 reports)
47. Open /docs URL — show Swagger documentation of all API endpoints

What Makes This Project Impressive


• Real AI Integration — Claude API generates intelligent explanations
• PDF Parsing — automatically reads medical documents
• Color-coded results — instantly shows what is normal and what is not
• Trend tracking — health history across multiple visits
• Live deployment — evaluator can access it from their phone/laptop
• Swagger documentation — professional API documentation at /docs
• JWT Security — proper login system like real-world apps
• Responsive Design — works on mobile and desktop

Quick Reference — Tech Stack Summary


Layer Technology Used
Frontend Language JavaScript ([Link])
Frontend Styling Tailwind CSS
Backend Language Python 3.11+
Backend Framework FastAPI
Database PostgreSQL
Authentication JWT (JSON Web Tokens)
PDF Reading PyMuPDF + pdfplumber
AI Engine Claude API (Anthropic)

Page 21 of 22 Lab Results Interpreter | Full Project Documentation


Lab Results Interpreter — Project Report Confidential | 2026

Frontend Hosting Vercel (Free)


Backend Hosting [Link] (Free)
Version Control GitHub
API Documentation Swagger UI (built into FastAPI)

Good Luck with Your Project!


Build it step by step, test each feature before moving to next.
This is a complete, real-world, AI-powered project — it will stand out!

Page 22 of 22 Lab Results Interpreter | Full Project Documentation

You might also like