MyChart Health Insights
Case Study

MyChart Health Insights

A Chrome extension that enables HIPAA-compliant AI conversations about your medical records directly within MyChart patient portals — powered by the PrivaiShield SDK.

Install from Chrome Web Store

Overview

MyChart Health Insights demonstrates how to build privacy-preserving AI experiences in healthcare. The extension automatically extracts health data from Epic MyChart pages, redacts PHI (Protected Health Information), and enables patients to chat with AI about their lab results, medications, and clinical reports.

Automatic PHI Redaction

Names, dates, MRNs, and 50+ entity types are automatically detected and redacted before any data reaches AI models.

AI-Powered Insights

Patients can ask questions about their health data and get explanations in plain language from Claude, GPT-4, or Gemini.

Auto-Extraction on Navigation

As patients browse between test results, the extension automatically extracts and redacts new content.

Smart Caching

Redaction results are cached to avoid redundant API calls, improving performance and reducing costs.

Entity Review & Selection

Users can review detected PHI entities and toggle individual items before approving the redaction.

Session Persistence

Chat history persists across page navigation and refreshes, with automatic cleanup after 24 hours.

How It Works

The extension uses a content script architecture with the PrivaiShield API for server-side redaction.

1
Content Script Injection
Extension injects into MyChart pages and creates a sidebar UI using Shadow DOM for style isolation.
2
Health Data Extraction
DOM adapter traverses the page (including Shadow DOM) to extract lab results, medications, reports, and clinical notes.
3
PHI Redaction via PrivaiShield API
Extracted text is sent to the PrivaiShield redaction API, which uses AWS Comprehend Medical + custom patterns for healthcare-specific entity detection.
4
User Review & Approval
Users see what will be redacted and can toggle individual entities before proceeding to chat.
5
AI Chat with Redacted Context
The redacted health data is sent as context to the AI model. Patients can ask questions and get explanations without exposing PHI.

Code Example

Here's how to implement similar functionality in your own application using the PrivaiShield SDK.

Integration Exampletypescript
import { PrivaiShield } from '@privaishield/sdk';

const client = new PrivaiShield({
  apiKey: process.env.PRIVAISHIELD_API_KEY
});

// 1. Extract health data from your source
const healthData = extractHealthDataFromPage();

// 2. Redact PHI
const redaction = await client.redact({
  text: healthData,
  mode: 'hybrid',
  entityTypes: [
    'PERSON_NAME', 'DATE', 'MRN', 'SSN',
    'PHONE', 'EMAIL', 'ADDRESS', 'PROVIDER'
  ]
});

console.log('Redacted:', redaction.redactedText);
console.log('Entities found:', redaction.entities.length);

// 3. Chat with AI using redacted context
const response = await client.chat({
  messages: [{ role: 'user', content: 'Explain my lab results' }],
  context: redaction.redactedText,
  model: 'claude-sonnet'
});

console.log('AI Response:', response.content);

Build Your Own

Ready to add privacy-preserving AI to your healthcare application? Get started with the PrivaiShield SDK.