Project · Digital health

ClinIA: electronic health record

The same patient can be seen by several doctors in different institutions, and their record follows them without anyone having to ask for it over the phone. The record belongs to the patient, not to the clinic.

FastAPIPythonPostgreSQLReact 19TailwindCSSJWTDocker
ClinIA electronic health record screen

The problem

In Peru, a patient's medical record is split across as many systems as clinics they have visited. At a new clinic the doctor starts from scratch, asking again about allergies and ordering tests that already exist.

ClinIA starts from a single patient record. A doctor sees what the patient has authorised, and that authorisation is explicit and revocable.

ClinIA architecture Four roles use a React frontend. Every request carries a JWT and reaches FastAPI, where a require_role decorator checks permissions on the server before touching PostgreSQL. Usersdoctor · nursepatient · adminHTTPSFrontendReact 19Radix · TailwindJWTAPIFastAPIrequire_role()SQLPostgreSQLsingle patientrecord
ClinIA architecture

Design decisions

  • Permissions are checked on the server with a require_role() decorator on every route. Hiding a button is not access control.
  • From Supabase to plain PostgreSQL. Supabase made authentication quick but tied the schema and policies to a vendor. For clinical data that dependency was a bigger risk than the convenience.
  • All enums in one module, so "pending", "PENDING" and "waiting" never end up meaning the same thing.

Roles

  • Super admin: platform, institutions, doctors and metrics
  • Doctor: their patients' history, visits, tests, appointments and prescriptions
  • Nurse: triage and vital signs
  • Patient: their own record, appointments and results

Known limitations

  • Voice transcription and the clinical assistant are in the UI but have no engine behind them yet.
  • No regulatory certification for real clinical use.
  • Record sharing works at permission level, not interoperability: it does not speak HL7 or FHIR yet.
The CV will be available soon.