1. Executive Summary
MyHealth Portal is a multi-tenant, serverless healthcare application designed to bridge the gap between patient data and doctor analysis. The platform allows patients to upload raw PDF lab reports, which are automatically processed using AI to extract key medical indicators. Doctors are provided with a structured dashboard to view these digitized results and manage appointments, eliminating manual data entry.
2. User Personas & Roles
Manage patient roster, view digitized lab trends, create appointment slots.
Upload PDF reports, view appointment history, view personal health profile.
Watch for file uploads, read PDF contents (OCR), sanitize data, update database.
3. Functional Requirements
A. Core Features
- Multi-Tenancy: Doctors see only their assigned patients; Patients see only their own data.
- Appointment Management: Booking system where Doctors publish slots and Patients reserve them.
- Document Ingestion: Secure upload facility for PDF or Image-based lab reports.
B. Intelligent Automation
- Automated OCR Parsing: System triggers automatically upon file upload.
- Data Extraction: Identifies key-value pairs (e.g., "Cholesterol": "200").
- Structured Storage: Converts unstructured PDF data into NoSQL data for querying.
4. Technical Architecture
The application follows a Serverless Event-Driven architecture on the Google Cloud Platform (GCP).
Technology Stack
5. The Automated Data Pipeline
Ingestion
Patient logs in and uploads report.pdf. File streams securely to private bucket path: uploads/{doctor_id}/{patient_id}/.
Trigger
The "Finalize" event in Cloud Storage triggers a background Cloud Function.
Processing
Cloud Function sends stream to Document AI API. AI analyzes form and returns JSON with entities.
Persistence
Cloud Function parses JSON, validates confidence scores, and writes structured data to Firestore lab_results collection.
Visualization
Doctor's dashboard, listening to Firestore, updates in real-time to show new data.
6. Security & Privacy
- HIPAA Compliance (Mock) Adherence to best practices for data handling.
- Row-Level Security Firestore Security Rules strictly enforce read access based on auth.uid matches.
- Least Privilege Cloud Functions use specific Service Accounts restricted to Storage read and Firestore write only.