Designing a system for an Electronic Health Record (EHR) involves several key components to ensure it meets the needs of healthcare providers, complies with regulatory requirements, and maintains the privacy and security of patient data. For this tutorial, we’ll focus on the Appointment Scheduling feature within the EHR application.

Objective: Design the system architecture for Appointment Scheduling by producing the following artifacts:

  1. System Context Diagram
  2. Platform Diagram
  3. Component Diagram

Let’s start with designing the System Context Diagram before creating the Platform Diagram. This will help us identify and understand all key events, interactions, policies, and workflows, ensuring the system design accurately represents the requirements and relationships.

System Context Diagram

The EHR System Context Diagram illustrates the interactions and data flows between the EHR System and various other systems and users.

The EHR System is central to managing appointments between providers and patients, and it syncs with calendars to ensure availability and scheduling accuracy.

Practitioners and Patients authenticate through the Authentication System, which grants them access to the underlying systems.

System Context Diagram

The EHR System integrates with the Calendar System (such as Google or Apple Calendar) to sync appointments and availability, ensuring that all schedules are up-to-date. Notifications about appointments are sent to users through the Notification System via email, SMS, or push notifications.

Additionally, the EHR System interacts with the Billing System for financial transactions, the Registration System for new user sign-ups, and both the Practitioner Management System and Patient Management System for maintaining comprehensive profiles.

Platform Diagram

One level lower, the Platform Diagram outlines the interactions and data flows between the EHR Platform and various user interfaces, as well as supporting systems for availability/scheduling and notifications.

Practitioners and patients access the EHR Platform through multiple interfaces tailored to their devices: Desktop, Web, and Mobile. Each of these interfaces is built using Dart and Flutter, ensuring consistent functionality across all devices.

Platform Diagram

The core EHR Platform, developed with Python, handles the core functionality for requesting, scheduling, and canceling appointments. It interfaces with the Calendar System (such as Google or Apple Calendar) to sync appointments and availability, ensuring that users’ schedules are always up-to-date.

Additionally, it connects with the Notification Platform to send out appointment-related notifications via email, SMS, or push notifications, keeping users informed about their appointments. This setup ensures a seamless and integrated experience across different devices and platforms for both practitioners and patients.

If we take a closer look into the EHR Platform, we can see the various components and services that the platform is comprised of, in the form of a Component Diagram.

Component Diagram

The Component Diagram highlights the various components in the EHR Platform. It illustrates the interactions between various platforms, services, and data repositories.

The system’s frontend is composed of Desktop, Web, iOS, and Android platforms, all built using Dart and Flutter, which interface with the backend via an API Gateway.

The API Gateway routes requests to different backend services, such as the Calendar Synchronizer, Appointment Scheduler, Practitioner Manager, and Patient Manager, all developed with Python.

Component Diagram

These services communicate asynchronously through a Message Queue using Pub/Sub. Data is stored and managed across multiple repositories, including Appointment Data, Practitioner Data, Patient Data, and Activity Data, using Cloud SQL and BigQuery.

Additionally, the system integrates with external services for authentication (Stytch or Firebase Auth), calendar synchronization (Google/Apple Calendar), and notifications (Email, SMS, Push). This setup ensures secure, scalable, and efficient handling of appointment scheduling and management tasks.