A clinic needed a platform for online consultations. Booking was the visible part; behind it were patient and doctor portals, a secure medical chat with file exchange, scheduling, consultation pricing tied to each doctor’s qualification, payments, and back-office workflows for doctors who were also on the clinic’s staff. We built the telemedicine platform on PHP 8 and Yii2, as the client required, and split it into services by workflow.
This project is presented in a generalized form. Some details and identifying elements are intentionally omitted due to confidentiality requirements.
Telemedicine software from patient journey to internal clinic operations
Patients choose a doctor, book a slot, upload test results and medical records, pay, and talk to the doctor in a protected chat. Doctors manage their calendar and workload and see only the materials of their own patients. Pricing rules, staff workflows, ERP integration, and internal administration live in the same system.
Project Context
As the service grew, the clinic’s internal side started to matter as much as the patient journey: roles and access, staff workflows, billing rules, document storage, integrations, and protected handling of medical data.
What Was Delivered
Patient Portal
A dedicated patient portal was built to support doctor selection, consultation scheduling, access to communication history, and medical materials. Within the platform, patients could upload analyses, diagnoses, medical records, and other files required for consultation.
- doctor selection and consultation booking;
- history of consultations and related workflows;
- upload of medical documents and files;
- consultation cost calculation and payment flow;
- access to related medical materials and interaction history.
Doctor Portal
A separate doctor portal was created with professional profile data, qualification, education, work experience, hourly rate, and schedule management. Clinicians could work with their calendars, consultation load, related cases, and patient-provided medical materials.
- doctor profiles and professional data;
- calendar, schedule, and workload management;
- access to patient requests and attached materials;
- qualification-based billing parameters;
- ratings, reviews, and role-specific clinician status flows.
Medical Chat and Consultation Workflow
A secure medical chat connects patient and doctor. It supported consultation communication, exchange of medical files, and preservation of interaction history as part of the patient’s digital profile.
The chat was designed so that audio and video sessions could be added later without rebuilding the core of the system.
Scheduling, Calendars, and Workload Management
The platform included consultation planning workflows, doctor calendars, schedule management, and clinician workload handling. This made it possible to align patient booking flows with the internal scheduling logic of the clinic.
Billing and Payment Logic
An important part of the system was automated consultation pricing. The platform considered doctor qualification, hourly rate, consultation duration, and related billing parameters. Based on this logic, the system calculated payable amounts and prepared the data required for billing and payment workflows.
- pricing based on consultation duration and clinician rate;
- qualification-aware billing logic;
- calculation of patient payment amounts;
- integration with payment services.
Internal Automation and Integrations
In addition to user-facing workflows, the team delivered internal administrative tools: dashboards, file and document workflows, background jobs, CMS-like interfaces, access control scenarios, and internal operational logic.
The platform also included integrations with internal systems, including ERP-related processes and staff management workflows, since clinicians were part of the clinic’s internal organizational structure.
Technology Architecture
The solution was built on a microservice architecture with services separated by business workflow. The backend was based on PHP 8 and Yii2, while real-time and chat-related components were implemented as dedicated services in Go.
- PHP 8, Yii2, Go;
- PostgreSQL, Redis, RabbitMQ, WebSockets;
- S3-compatible object storage;
- Kubernetes, GitLab CI/CD;
- JWT, OAuth2, roles, and access policies;
- Prometheus, Grafana, and centralized logging.
Why This Stack Was Used
PHP 8 and Yii2 were the client’s requirement. The platform was still split into services with queues and background processing: the number of connected workflows called for it. Real-time parts, including the chat, run as separate Go services.
Security and Medical Data Access
Access to medical data is governed by a role-based model and explicit access policies.
The main rule: a patient’s data is available only to the people directly involved in that workflow, first of all the patient and the doctor. Files are stored and transferred under the same rule.
Business Value
The project moved consultation and administrative workflows into one system.
- reduced manual workload for medical and administrative staff;
- more transparent doctor scheduling and workload control;
- centralized communication, documents, and user workflows;
- automated pricing logic for consultations;
- a smoother patient journey from doctor selection to payment and consultation.