feat(health): B5 个保法 §45 患者数据可携权导出

GET /health/patients/{id}/export?format=json|fhir 双格式同步导出:
- json: 明文 PII(解密不脱敏,可携权本意),聚合 7 段数据
- fhir: FHIR R4 Bundle(复用现有 converter,PII 天然脱敏)
- 安全边界:consent 门控 + patient 角色 self-scope + 审计 patient.exported(不含明文 PII)+ 日志不记 payload
- 权限 health.patient.export(医护=all, patient=self),迁移 m20260626_000171
- 事件 patient.exported;6 集成测试全绿

含顺手修复 auth_tests UserService::list 签名 drift(exclude_only_roles),解锁 integration crate 编译。
§47 删除权留后续。
This commit is contained in:
iven
2026-06-26 17:58:20 +08:00
parent 5d256fbf52
commit 15b6bec215
14 changed files with 792 additions and 4 deletions

View File

@@ -32,6 +32,8 @@ mod health_follow_up_template_tests;
mod health_follow_up_tests;
#[path = "integration/health_medication_tests.rs"]
mod health_medication_tests;
#[path = "integration/health_patient_export_tests.rs"]
mod health_patient_export_tests;
#[path = "integration/health_patient_tests.rs"]
mod health_patient_tests;
#[path = "integration/health_pii_encryption_tests.rs"]