Build a privacy-preserving, patient-sovereign FHIR provenance POC for humanitarian settings. This repository is research software and must never claim clinical, regulatory, biometric, or production readiness.
- Never store raw biometrics, biometric templates, biometric SDK tokens, derived record keys, or decrypted FHIR resources.
- Never add demographic or patient-name lookup.
- Require both a patient factor and an authorized clinician private key before decrypting record state.
- Store FHIR fragments and provenance entries as authenticated ciphertext under random object identifiers.
- Verify every parent link, clinician signature, patient-authorization MAC, and content hash during assembly.
- Keep Google Cloud Healthcare API and analytics integrations outside the PHI path; synthetic or irreversibly aggregated data only.
- Treat logs, errors, crash dumps, temporary files, and test snapshots as potential disclosure channels.
- Use Node.js 22+ and TypeScript strict mode.
- Import public APIs through
src/index.ts. - Add or update tests for every behavior change.
- Run
npm test,npm run typecheck, andnpm run buildbefore submitting. - Use synthetic FHIR fixtures only. Do not commit realistic names, identifiers, dates of birth, contact details, or biometric material.
- Keep storage provider-neutral. Cloud adapters implement
BlobStore; service code must not depend directly on a cloud SDK.
src/crypto: cryptographic primitives only; no storage or FHIR policy.src/domain: serializable domain types and validation.src/storage: opaque object persistence and compare-and-swap behavior.src/service: orchestration, authorization, provenance, and verification.src/web: localhost-only HTTP transport; return generic server errors and never log request bodies, credentials, tokens, or decrypted resources.web: dependency-free browser UI; patient labels remain browser-local and must never be included in API requests.
Do not weaken a boundary to make a test pass. Explicitly document any new metadata visible to the storage provider.
Use Global Patient Record Project in documentation, examples, placeholders, and UI copy. Do not introduce third-party project names, branding, repository paths, logos, or unrelated domain terminology.