Abstract:
CareLock-Sync is a data synchronisation system that reads patient records from hospital databases, converts them into FHIR R4 resources, and stores them in a central database with row-level tenant isolation. The system supports five source database platforms (PostgreSQL, MySQL, MongoDB, Oracle and SQL Server) each through a dedicated adapter that implements a common contract covering connection management, schema discovery, data extraction, data loading, and trigger-based change capture.
The central database stores FHIR resources in PostgreSQL with row-level security policies that enforce tenant boundaries at the database layer, independent of application code. Sensitive patient fields are encrypted at rest using AES-256-GCM with per-tenant keys derived through HKDF. Every access event is written to a tamper-resistant SQLite audit log.
Mapping an unfamiliar hospital schema to FHIR fields is handled by a retrieval-augmented engine backed by ChromaDB and a local Ollama language model. The engine runs similarity search first; when the top match is confident enough it returns the mapping directly without invoking the language model. Every suggested mapping sits in a pending state until an administrator confirms it.
The REST API exposes three multi-database sync endpoints that execute sources in parallel through a bounded thread pool, isolate per-source failures, and surface structured per-source results. A React 19 frontend provides role-based dashboards for four user types.