healthcare-phi-compliance

Implements PHI and PII protection patterns for healthcare applications using RLS, audit trails, and encryption.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill healthcare-phi-compliance-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: healthcare-phi-compliance
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/healthcare-phi-compliance
Command: npx skills add https://github.com/ibytechaos/claude --skill healthcare-phi-compliance-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Healthcare applications handle sensitive patient and clinician data that must comply with regulations like HIPAA, DISHA, and GDPR. This Skill provides concrete patterns to prevent PHI/PII leaks through error messages, logs, URLs, browser storage, and misconfigured access control. ## Core Features & Use Cases - Data Classification: Defines what counts as PHI (patient names, IDs, diagnoses, lab results) versus PII (staff salaries, doctor payouts) so teams know what to protect. - Row-Level Security & Audit Trails: Provides SQL policies for facility-scoped access, tamper-proof insert-only audit logs, and schema-level PHI column tagging. - Leak Vector Prevention: Covers common exposure points including error messages, console logging, URL parameters, browser storage, and service role keys, plus a pre-deployment checklist. - Use Case: When building a multi-facility hospital API, apply the RLS policies so a doctor at Facility A cannot query Facility B patients, and log every record access with opaque UUIDs instead of medical record numbers. ## Quick Start Review my patient records API code and database schema for PHI leaks and apply the appropriate RLS policies and audit logging patterns.

Frequently Asked Questions about healthcare-phi-compliance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I protect PHI in a healthcare application database?

Enable Row-Level Security on all PHI tables and create policies scoping access by facility and staff role. Tag sensitive columns with schema comments like 'PHI: patient_name' and maintain an insert-only audit log for every data access or modification.

How to implement row-level security for multi-facility hospital systems?

Create an RLS policy that checks the user's facility assignments via a staff_assignments table, so clinicians only see patients at their own facility. Verify isolation by logging in as a Facility A doctor and confirming queries against Facility B return zero rows.

What data counts as PHI under HIPAA and similar regulations?

PHI is any data that identifies a patient and relates to their health: names, dates of birth, addresses, national IDs like SSN or Aadhaar, medical record numbers, diagnoses, medications, lab results, and insurance details. Staff salaries and doctor payouts are PII, not PHI.

Why should patient data never appear in error messages or logs?

Error messages and logs are common leak vectors because they reach clients, monitoring tools, and error tracking services. Return generic errors to clients and log only opaque internal UUIDs server-side, never medical record numbers or patient names.

Can I store patient data in browser localStorage?

No, PHI must never be stored in localStorage or sessionStorage because it persists and is accessible to scripts. Keep PHI in memory only, fetch it on demand, and never place patient identifiers in URL parameters that appear in browser history.

Does this compliance guidance apply outside the United States?

Yes, the patterns apply to HIPAA in the US, DISHA in India, GDPR in the EU, and general healthcare data protection. The classification, access control, and audit principles are regulation-agnostic.