
HIS Integration
Run the Latrexa Sync Agent on your clinic server to sync appointments between your local Hospital Information System and Latrexa — with real-time SignalR updates and automatic retry.
How it works
The Latrexa Sync Agent is a Windows background service installed at your clinic. It loads a small HIS plugin DLL (one per vendor) that talks to your local database or API. The agent handles all communication with Latrexa Cloud — you only implement five methods in your plugin.
Latrexa → HIS
Online bookings download and are created in your HIS when slots are free.
HIS → Latrexa
Walk-in and desk appointments in HIS upload to Latrexa on a schedule.
Real-time
SignalR pushes new bookings instantly; polling is used as fallback.
Step 1 — Get your API key
Each clinic needs an integration API key and organization code. Create these in your Latrexa clinic admin panel.
- Sign in to Clinic Admin for your organization.
- Open Settings → Integration tab.
- Click Create API Key and give it a name (e.g. Reception Server).
- Copy the API key immediately — it is shown only once.
- Copy your Organization code (your Latrexa subdomain / clinic identifier).
appsettings.json on the clinic server. Never commit it to source control or share it publicly.
Step 2 — Install the Sync Agent
Download the self-contained Windows x64 package (includes .NET runtime — no separate install needed).
- Download Latrexa.SyncAgent-win-x64.zip.
- Extract to e.g.
C:\LatrexaSyncAgent. - Edit
appsettings.json(see configuration below). - Register and start the Windows Service (see below).
Configuration — appsettings.json
| Setting | Description |
|---|---|
Latrexa:ApiKey | Bearer token from Clinic Admin → Integration |
Latrexa:OrganizationCode | Your clinic subdomain / organization identifier |
Sync:HisPluginAssembly | Relative path to your vendor HIS plugin DLL |
Sync:HisPluginType | Fully qualified connector class name |
HisPlugin:* | Custom settings passed to your plugin's InitializeAsync |
Step 3 — Register as Windows Service
Open Command Prompt as Administrator on the clinic server:
Logs are written to logs\service-log-YYYYMMDD.txt under the install folder.
SQLite state (mappings, retry queue) is stored in Data\sync-agent.db.
Build a custom HIS plugin
Each HIS vendor ships one DLL. The main Sync Agent executable never changes.
- Download Latrexa.SyncAgent.Abstractions.dll (SDK contract).
- Download the sample plugin project as a starting point.
- Create a .NET 8 class library and reference the Abstractions DLL.
- Implement
IHisAppointmentConnector:
Build your DLL, copy it (and Latrexa.SyncAgent.Abstractions.dll if not merged) into the agent's
Plugins\ folder, update HisPluginAssembly and HisPluginType in
appsettings.json, then restart the service.
Latrexa integration API
All requests from the agent include:
X-Organization-Code: {OrganizationCode}
| Method | Path | Purpose |
|---|---|---|
| GET | /api/integration/appointments/pending | Download bookings awaiting HIS sync |
| POST | /api/integration/appointments/upload | Upload HIS appointments to Latrexa |
| POST | /api/integration/appointments/confirm | Confirm successful HIS write |
| POST | /api/integration/appointments/reject | Reject when slot unavailable |
| POST | /api/integration/heartbeat | Agent health check (visible in Clinic Admin) |
SignalR hub: http://orthoaghil.com/hubs/integration — events: AppointmentCreated, AppointmentUpdated, AppointmentCancelled.
Troubleshooting
- 401 Unauthorized — check API key and organization code in
appsettings.json. - Plugin load error — verify DLL path and fully qualified type name; ensure Abstractions DLL is in
Plugins\. - No heartbeat in admin — confirm service is running and outbound HTTPS to Latrexa is allowed on the firewall.
- Duplicate appointments — agent uses SQLite mapping table; do not delete
Data\sync-agent.dbwithout support guidance.
Package contents
- Sync Agent ZIP — self-contained exe, appsettings.json, sample plugin, INSTALL.txt
- Abstractions DLL — reference in your plugin project
- Sample ZIP — SampleHisConnector.cs + project file + built DLLs