Install any skill in seconds. Free to start, no credit card required.
Get Started Free →保護医療情報(PHI)コンプライアンス、HIPAA準拠、およびデータセキュリティ。
.claude/skills/affaan-m-healthcare-phi-compliance/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 70% | 0% |
用于保护医疗应用中患者数据、临床医生数据和财务数据的模式。适用于 HIPAA(美国)、DISHA(印度)、GDPR(欧盟)以及通用医疗数据保护。
医疗数据保护在三个层面运作:分类(什么是敏感数据)、访问控制(谁能查看)和审计(谁查看了数据)。
PHI(受保护健康信息) — 任何能够识别患者身份且与其健康相关的数据:患者姓名、出生日期、地址、电话、电子邮件、国家身份证号码(SSN、Aadhaar、NHS 号码)、病历号、诊断、药物、化验结果、影像资料、保险单和理赔详情、预约和入院记录,或上述任意组合。
医疗系统中的 PII(非患者敏感数据):临床医生/员工个人详细信息、医生收费结构和支付金额、员工薪资和银行信息、供应商付款信息。
sqlALTER TABLE patients ENABLE ROW LEVEL SECURITY; -- Scope access by facility CREATE POLICY "staff_read_own_facility" ON patients FOR SELECT TO authenticated USING (facility_id IN ( SELECT facility_id FROM staff_assignments WHERE user_id = auth.uid() AND role IN ('doctor','nurse','lab_tech','admin') )); -- Audit log: insert-only (tamper-proof) CREATE POLICY "audit_insert_only" ON audit_log FOR INSERT TO authenticated WITH CHECK (user_id = auth.uid()); CREATE POLICY "audit_no_modify" ON audit_log FOR UPDATE USING (false); CREATE POLICY "audit_no_delete" ON audit_log FOR DELETE USING (false);
每次 PHI 访问或修改都必须记录:
typescriptinterface AuditEntry { timestamp: string; user_id: string; patient_id: string; action: 'create' | 'read' | 'update' | 'delete' | 'print' | 'export'; resource_type: string; resource_id: string; changes?: { before: object; after: object }; ip_address: string; session_id: string; }
错误消息: 切勿在发送给客户端的错误消息中包含患者身份识别数据。仅在服务器端记录详细信息。
控制台输出: 切勿记录完整的患者对象。使用不透明的内部记录 ID(UUID)——而不是病历号、国家身份证号或姓名。
URL 参数: 切勿在可能出现在日志或浏览器历史记录中的查询字符串或路径段中包含患者身份识别数据。仅使用不透明的 UUID。
浏览器存储: 切勿在 localStorage 或 sessionStorage 中存储 PHI。仅在内存中保留 PHI,按需获取。
服务角色密钥: 切勿在客户端代码中使用 service\_role 密钥。始终使用匿名/可发布密钥,并让 RLS 强制执行访问控制。
日志和监控: 切勿记录完整的患者记录。仅使用不透明的记录 ID(而不是病历号)。在发送到错误跟踪服务之前,清理堆栈跟踪。
在模式级别标记 PHI/PII 列:
sqlCOMMENT ON COLUMN patients.name IS 'PHI: patient_name'; COMMENT ON COLUMN patients.dob IS 'PHI: date_of_birth'; COMMENT ON COLUMN patients.aadhaar IS 'PHI: national_id'; COMMENT ON COLUMN doctor_payouts.amount IS 'PII: financial';
每次部署前:
typescript// BAD — leaks PHI in error throw new Error(`Patient ${patient.name} not found in ${patient.facility}`); // GOOD — generic error, details logged server-side with opaque IDs only logger.error('Patient lookup failed', { recordId: patient.id, facilityId }); throw new Error('Record not found');
sql-- Doctor at Facility A cannot see Facility B patients CREATE POLICY "facility_isolation" ON patients FOR SELECT TO authenticated USING (facility_id IN ( SELECT facility_id FROM staff_assignments WHERE user_id = auth.uid() )); -- Test: login as doctor-facility-a, query facility-b patients -- Expected: 0 rows returned
typescript// BAD — logs identifiable patient data console.log('Processing patient:', patient); // GOOD — logs only opaque internal record ID console.log('Processing record:', patient.id); // Note: even patient.id should be an opaque UUID, not a medical record number
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | fail→pass | 12,631 | 8,611 | -32% | 1 | 1 | 0% | 2,201 | 2,965 | +35% | 0 | 0 | — |
case-05 | pass→pass | 20,739 | 15,021 | -28% | 1 | 1 | 0% | 3,661 | 3,964 | +8% | 0 | 0 | — |
case-06 | pass→pass | 13,425 | 8,590 | -36% | 1 | 1 | 0% | 2,468 | 2,984 | +21% | 0 | 0 | — |
case-07 | fail→pass | 22,930 | 7,448 | -68% | 1 | 1 | 0% | 1,873 | 2,414 | +29% | 0 | 0 | — |
case-01 | fail→fail | 22,089 | 14,954 | -32% | 1 | 1 | 0% | 4,163 | 4,061 | -2% | 0 | 0 | — |
case-02 | pass→pass | 10,834 | 5,147 | -52% | 1 | 1 | 0% | 1,834 | 2,164 | +18% | 0 | 0 | — |
case-03 | fail→pass | 15,817 | 10,671 | -33% | 1 | 1 | 0% | 2,739 | 3,316 | +21% | 0 | 0 | — |
case-08 | pass→pass | 13,461 | 11,043 | -18% | 1 | 1 | 0% | 2,245 | 3,190 | +42% | 0 | 0 | — |
case-09 | fail→pass | 15,221 | 15,685 | +3% | 1 | 1 | 0% | 2,877 | 3,854 | +34% | 0 | 0 | — |
case-10 | fail→pass | 6,571 | 3,790 | -42% | 1 | 1 | 0% | 1,174 | 1,991 | +70% | 0 | 0 | — |
case-11 | pass→pass | 8,786 | 5,973 | -32% | 1 | 1 | 0% | 1,377 | 2,331 | +69% | 0 | 0 | — |
case-12 | pass→pass | 19,807 | 17,404 | -12% | 1 | 1 | 0% | 3,249 | 4,267 | +31% | 0 | 0 | — |
case-13 | pass→pass | 19,522 | 12,607 | -35% | 1 | 1 | 0% | 2,984 | 3,310 | +11% | 0 | 0 | — |
case-14 | fail→pass | 13,879 | 11,873 | -14% | 1 | 1 | 0% | 2,694 | 3,488 | +29% | 0 | 0 | — |
case-15 | pass→pass | 16,249 | 15,642 | -4% | 1 | 1 | 0% | 2,546 | 3,627 | +42% | 0 | 0 | — |
case-16 | pass→pass | 3,737 | 3,803 | +2% | 1 | 1 | 0% | 554 | 1,820 | +229% | 0 | 0 | — |
case-17 | pass→pass | 13,532 | 13,425 | -1% | 1 | 1 | 0% | 2,111 | 3,490 | +65% | 0 | 0 | — |
case-18 | pass→pass | 16,721 | 14,082 | -16% | 1 | 1 | 0% | 2,636 | 3,631 | +38% | 0 | 0 | — |
case-19 | pass→pass | 12,999 | 5,012 | -61% | 1 | 1 | 0% | 2,033 | 2,146 | +6% | 0 | 0 | — |
case-20 | pass→pass | 12,890 | 15,345 | +19% | 1 | 1 | 0% | 2,227 | 4,276 | +92% | 0 | 0 | — |
case-21 | fail→pass | 19,176 | 18,583 | -3% | 1 | 1 | 0% | 2,983 | 2,750 | -8% | 0 | 0 | — |
case-22 | fail→pass | 16,364 | 13,181 | -19% | 1 | 1 | 0% | 2,437 | 3,242 | +33% | 0 | 0 | — |
case-23 | pass→pass | 7,222 | 7,998 | +11% | 1 | 1 | 0% | 1,304 | 2,716 | +108% | 0 | 0 | — |
case-24 | pass→pass | 8,410 | 8,639 | +3% | 1 | 1 | 0% | 1,756 | 3,064 | +74% | 0 | 0 | — |
case-25 | pass→pass | 20,700 | 37,201 | +80% | 1 | 1 | 0% | 3,598 | 5,387 | +50% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.