Building a Telemedicine Platform with MIS and Lab Integration
We develop telehealth solutions that solve the problem of losing up to 30% of patients due to long wait times for appointments and the inability to consult remotely. Our solutions include WebRTC-based video consultations, secure chat, electronic prescriptions with a qualified electronic signature (ES), and integration with laboratories and Medical Information Systems (MIS). We account for regulatory constraints under Federal Law 323-FZ and personal data protection requirements under Federal Law 152-FZ. The platform can be deployed on-premise or in the cloud, depending on the clinic's needs.
Typical client pain points: manual phone-based scheduling, lost documents, no unified patient window. Our platform automates scheduling, stores consultation history, and provides a personal account for both patient and doctor.
We use a modern tech stack: React and Node.js for frontend and backend, PostgreSQL for data storage, Docker for containerization, and Livekit for video calls. This ensures scalability to hundreds of simultaneous consultations.
Key Problems Solved by a Telemedicine Platform
The primary task is to reduce the time between a patient's request and receiving medical care. The platform enables follow-up consultations, treatment adjustments, issuance of electronic prescriptions and referrals. Additionally, it reduces call center load and increases patient satisfaction through a user-friendly interface. Implementing the platform reduces average wait time by 40% and increases appointment conversion by 25%. Typical MVP development cost ranges from $50,000 to $100,000. Clients typically recoup their investment within 6 months, saving up to $30,000 per year on call center costs.
Choosing Video Technology for Telemedicine
Video consultations are built on WebRTC. For medical contexts, the following are critical:
- E2E encryption (DTLS-SRTP) – the connection does not pass through third-party servers
- Recording only with patient consent, stored encrypted
- Low latency (<200 ms) for accurate symptom assessment
Self-hosted Livekit provides 2–3 times lower latency and full data control compared to managed solutions like Whereby Embedded or Daily.co. Medical data never leaves the perimeter. It supports recording through room services.
Whereby Embedded or Daily.co – managed services with HIPAA BAA (for Western markets). For Russia, self-hosted is preferred.
Detailed Video Solution Comparison
| Parameter |
Self-hosted (Livekit) |
Managed (Whereby/Daily) |
| Data control |
Full |
Depends on provider |
| Compliance with 152-FZ |
Yes |
Only with BAA |
| Recording consultations |
Built-in |
Additional option |
| Scalability |
Harder (DevOps needed) |
Easier (PaaS) |
Consultation Scenarios and Documentation
Asynchronous (chat-based): Patient describes symptoms, attaches photos. Doctor responds at convenience. Suitable for dermatology and repeat prescriptions.
Synchronous (video): Live video call with a waiting queue. Doctor clicks "accept" → patient connects.
On-call doctor: First available accepts the request via PubSub based on SETNX Redis.
Before the consultation, the patient fills a complaint form with an interactive body map and pain scale (1–10). The doctor fills a structured protocol that becomes part of the electronic medical record. The protocol is signed with a qualified ES. Electronic prescriptions (Form 107-1/u) are generated with a qualified ES and integrated with REMD in pilot regions. For others, a secure PDF is used.
| Consultation Type |
When Used |
Advantages |
| Asynchronous (chat) |
Dermatology, repeat prescriptions |
No time constraint |
| Synchronous (video) |
Primary examination, urgent cases |
Live contact with doctor |
| On-call doctor |
Night calls, weekends |
Quick connection |
Lab Integration Increases Loyalty
The patient selects a lab from a list of partners (Helix, Invitro) → results automatically appear in the personal account. Implementation via lab API or HL7 FHIR. Conversion to follow-up consultations increases by 25%.
Analytics and Platform Monitoring
Administration receives a dashboard with metrics: average wait time, consultations by specialty, appointment conversion, doctor NPS. This allows optimizing schedules and improving service quality.
What's Included in the Work
When ordering the full cycle, we provide:
- Technical specification and architectural documentation (UML, API specification)
- Code with unit test coverage (PHPUnit, Playwright)
- Deployment and operation instructions
- Repository and CI/CD access
- Training for administrators and doctors
- 2-month warranty support after launch
Our Process and Timeline
We follow a phased approach: 1. Data collection → 2. Audit/analysis → 3. Design → 4. Estimation → 5. Development → 6. Testing → 7. Launch. An MVP with core functionality (video calls, chat, patient and doctor accounts, scheduling) takes 4–5 months. A full platform with asynchronous consultations, electronic signatures, MIS and lab integration takes 7–12 months. Exact timelines are determined after initial analysis.
A Case from Practice
For a network of clinics with 15 branches, we implemented a telemedicine platform that handled an average of 200 consultations per day. The result: average wait time dropped from 3 days to 1.5 days (40% reduction), appointment conversion increased from 50% to 62.5% (25% increase), and patient satisfaction NPS rose by 10 points. The platform integrated with the existing MIS, enabling seamless data exchange and reducing manual entry errors by 80%.
Common Mistakes to Avoid
- Building a platform without considering regulatory requirements (e.g., 323-FZ restrictions on primary diagnosis)
- Using managed video services that do not provide a BAA or comply with local data protection laws
- Overlooking the need for load testing early in development – video consultations require careful capacity planning
- Implementing lab integration only via email or manual upload instead of standardized APIs (HL7 FHIR)
Our team has over 10 years of experience in healthcare IT and has successfully delivered more than 20 telemedicine platforms, serving clinics with up to 200 daily consultations. Contact us to discuss your project. Our engineers can propose a solution tailored to your tasks.
Development of Real-Time Systems: WebRTC, SSE, WebSocket
We know how painful it is when polling kills the server. One of our projects—an online auction platform—used polling every 2 seconds. Under a load of 400 participants, the server received 12,000 HTTP requests per minute for a single bid. 90% of responses were empty. After switching to WebSocket, the load dropped 15 times, saving approximately $3,000 per month on server costs. Order custom real‑time functions development—get a ready solution with a stability guarantee.
Implementing real‑time in production is not just a library. We design the architecture for load, scenarios, and budget. Below is a breakdown of key solutions with examples.
Choosing the Right Real-Time Transport for Your Project
Three Real-Time Transports: When to Choose Which
Server‑Sent Events work over regular HTTP/1.1 or HTTP/2. The browser opens a connection, the server keeps it open and pushes events in text/event-stream format. Automatic reconnection is built-in—no need for reconnect logic. Limitation: server → client only. Ideal for notifications, progress of long tasks, live feeds.
WebSocket is a full‑duplex channel after an HTTP Upgrade handshake. Browser and server exchange frames in both directions. Suitable for chats, collaborative editing, games, trading terminals. Requires separate reconnect logic and heartbeat (ping/pong every 30 seconds, otherwise NAT tables close the connection). The WebSocket protocol enables full‑duplex communication with minimal overhead (RFC 6455).
WebRTC is peer‑to‑peer audio/video and data directly between browsers, bypassing the server. A server is needed only for signaling (STUN/TURN for NAT traversal). A TURN server is required in 20–30% of cases (corporate networks, symmetric NAT). For a telemedicine service, we implemented WebRTC: audio latency dropped from 800 ms (via relay) to 50 ms—a 16‑fold improvement. The TURN server was needed only for 15% of sessions, saving significant traffic costs.
How to Properly Choose a Transport: Step-by-Step Guide
- Determine the data exchange scenario: unidirectional (server → client) — SSE; bidirectional with low latency — WebSocket; audio/video — WebRTC.
- Evaluate latency requirements. If below 500 ms is acceptable — SSE; for below 100 ms and bidirectional — WebSocket; for below 50 ms and P2P — WebRTC.
- Check the infrastructure budget. SSE uses regular HTTP servers, WebSocket requires keeping connections in memory, WebRTC may require a TURN server (from a certain cost per TB of traffic).
- Consider scaling: for 100k+ connections, consider a WebSocket gateway (Centrifugo, Pushpin).
| Transport |
Direction |
Latency |
Implementation Complexity |
Typical Scenarios |
| WebSocket |
Full duplex |
< 100 ms |
Medium |
Chats, games, trading |
| SSE |
Server → client only |
< 500 ms |
Low |
Notifications, progress feeds |
| WebRTC |
P2P audio/video/data |
< 50 ms |
High |
Video calls, file transfer |
What Is CRDT and How Is It Better Than Operational Transformation?
Collaborative editing is not just "whoever writes last wins". Without a conflict merging algorithm, two users insert text at position 45; the first saves—the position shifts; the second saves on top—the operation applies to an outdated state. Text gets duplicated or lost.
OT (Operational Transformation) requires a server to resolve conflicts; CRDT (Conflict‑free Replicated Data Types) works without a central coordinator. Yjs is the most mature CRDT library for the browser. It integrates with ProseMirror, TipTap, CodeMirror, Monaco Editor. CRDT (Yjs) is 5 times faster than OT for concurrent editing under high load.
Library comparison for collaborative editing
| Library |
Algorithm |
Editor Support |
Complexity |
Performance |
| Yjs |
CRDT |
ProseMirror, TipTap, CodeMirror, Monaco |
Medium |
High (<10 ms at 100 ops) |
| ShareDB |
OT |
ProseMirror, Quill |
Medium |
Medium (requires merge server) |
| Automerge |
CRDT |
Any (RichText) |
High |
Good (but memory grows faster than Yjs) |
Issue: the Yjs document size grows due to operation history. Periodic garbage collection is needed—snapshot the document and clean old operations. Without it, a document worked on for a year may weigh 50 MB.
WebSocket Heartbeat Example (Node.js)
const ws = new WebSocket('wss://example.com');
let pingInterval;
ws.on('open', () => {
pingInterval = setInterval(() => {
ws.ping();
setTimeout(() => {
if (ws.readyState === WebSocket.OPEN) ws.terminate();
}, 5000);
}, 25000);
});
ws.on('close', () => clearInterval(pingInterval));
Common Mistakes in Real-Time Implementation and How to Avoid Them
Typical Mistakes in Real‑Time Implementation
Memory leak on the server—forgetting to remove the event handler when the connection closes. On Node.js, heap grows ~1 MB/hour. EventEmitter warns about 10+ listeners, but it's not always noticed.
Thundering herd on reconnect. The server goes down for 30 seconds, comes back—10,000 clients try to reconnect simultaneously. Exponential backoff with jitter is mandatory: delay = Math.min(baseDelay * 2^attempt + random(0, 1000), maxDelay).
Lack of connection lost indication. WebSocket doesn't always notify about disconnection (e.g., phone enters a tunnel). Heartbeat solves the problem.
Work Process
We start by choosing the transport for the scenarios—sometimes all three are needed in one project: SSE for system notifications, WebSocket for chat, WebRTC for video calls. We design the message protocol (JSON with type and payload, less often binary via MessagePack). We develop with race condition testing—this is not covered by unit tests.
Load testing with k6 + k6/experimental/websockets: we simulate 5,000 concurrent connections with a real pattern. Our engineers are certified in WebSocket and WebRTC, guaranteeing 99.9% stability.
What's Included in the Delivery
- Real‑time layer architecture (transport selection, message protocol)
- Implementation with load testing (k6, race condition scenarios)
- Backend integration via Redis Pub/Sub or similar bus
- Protocol and data schema documentation
- Team training
- Technical support for 2 weeks after launch
Why Centrifugo May Be More Cost-Effective Than Socket.io?
Socket.io is easier to set up (1–2 days), but Centrifugo built on Go handles 1M+ connections on a single node. For 100k concurrent clients, Centrifugo saves up to 40% on infrastructure costs, which translates to $2,000 per month compared to Socket.io. Get a consultation—we'll help you choose the stack for your load.
Timeline
- Basic WebSocket chat or notifications on top of existing API: 1–3 weeks.
- Collaborative editor with Yjs and persistence: 4–8 weeks.
- WebRTC video calls with recording: 6–12 weeks (significant part is integration with media server mediasoup or Janus).
Contact us to evaluate your project. Discuss your task with an engineer—we'll assess complexity and timeline individually.