Week 1 Day 01 Healthcare Domain Generated by Gemini Code Assist

MyHealth Portal: Architecture & Analysis

Project documentation for a multi-tenant, serverless healthcare application.

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

The Doctor
Admin / Provider

Manage patient roster, view digitized lab trends, create appointment slots.

The Patient
End User

Upload PDF reports, view appointment history, view personal health profile.

The System
Automation

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).

Google Cloud serverless architecture diagram

Technology Stack

Frontend Hosting Firebase Hosting (React)
Authentication Firebase Auth (Claims)
Database Cloud Firestore (NoSQL)
File Storage Google Cloud Storage
Backend Logic Cloud Functions (2nd Gen)
AI / OCR Document AI (Form Parser)

5. The Automated Data Pipeline

1

Ingestion

Patient logs in and uploads report.pdf. File streams securely to private bucket path: uploads/{doctor_id}/{patient_id}/.

2

Trigger

The "Finalize" event in Cloud Storage triggers a background Cloud Function.

3

Processing

Cloud Function sends stream to Document AI API. AI analyzes form and returns JSON with entities.

4

Persistence

Cloud Function parses JSON, validates confidence scores, and writes structured data to Firestore lab_results collection.

5

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.

7. Cost Analysis (Free Tier)

Document AI First 30 pages/mo Free
Cloud Functions 2M invocations Free
Firestore 50k reads/day Free