SaaS ยท Clinic and hospital SIMRS
XMedic
Based in Indonesia
xmedic.id

Overview
Hospital and clinic information system: registration, outpatient, pharmacy, billing and electronic medical records in one patient flow, connected to SATUSEHAT. Facilities sign up themselves and can import and back up their own data.
The problem
XMedic is a hospital and clinic information system (SIMRS) offered as a multi-tenant service. Staff use it for registration, outpatient care, emergency, inpatient, pharmacy, billing and medical records.
Registration, doctor visits, pharmacy and the cashier often run as separate tools, so patient data is retyped between desks and bills do not match what was dispensed. Facilities must also send encounter and medication data to the national SATUSEHAT platform, with credentials that belong to each facility.
My part
I worked on XMedic as a Senior Software Engineer at Rexolusi, where I also took the lead on backend architecture.
What I built
- One patient flow
- Backend services behind one gateway cover registration, queue tickets, outpatient, emergency triage, inpatient admission to discharge, surgery, pharmacy and the cashier.
- Pharmacy chain
- Prescription, screening, dispensing, counseling, stock, opname and formulary, with dispensing handed to billing and drug prices resolved in layers.
- Billing and insurance
- Invoices, cashier shifts, deposits, packages, payer rules, guarantee letters, insurance claims and payment reconciliation.
- Electronic medical records
- Outpatient and inpatient records, configurable document types and specialty records such as dental and maternal and child health.
- SATUSEHAT integration
- Builds FHIR resources from the clinical data, queues and sends them, and tracks the mapping between local and national IDs.
- Facility setup and data migration
- Onboarding and setup wizards for new facilities, and assessment, import and validation tools for bringing in legacy data.
Decisions that shaped it
- One owner per table
- Each service owns its tables, with no cross-service joins and reads through the owner's API. Every new table must be registered, which keeps services independently deployable.
- Tenant scoping tiers
- Tables are classed as global, client-shared or tenant-specific, so one deployment serves many facilities while sharing national reference data such as diagnosis codes.
- Facility-owned SATUSEHAT credentials
- Credentials belong to each facility, so they are stored encrypted per facility, and sending runs through a queue with logs, retries and a manual path for operators.
- A subdomain per client, automatically
- A new client gets its subdomain when onboarding completes, with no manual DNS or CORS work. Tenant context comes from the sign-in token, not the host name.
- Events through an outbox
- Services publish domain events through an outbox table so a failed delivery is retried instead of lost.
Where it stands
- A large set of modules across clinical, pharmacy, billing and finance, built as separate services.
- Facilities have their own tenant, setup wizard and migration path for legacy data.
- Backups are encrypted and copied off-site, and a restore to a fresh server has been rehearsed.
- Services talk to each other over gRPC, and events stream through Kafka.
Core features
- Registration
- Outpatient
- Pharmacy
- Billing
- Electronic medical records
- SATUSEHAT integration
- Data import and backup
Tech stack
- Go (Fiber)
- gRPC
- PostgreSQL
- Redis
- RabbitMQ
- Kafka
- Vue 3
- OpenTelemetry
- Docker
- Playwright