Kivicare Telemed Addon
Core Concepts

Telemedicine Architecture

The KiviCare Telemedicine Addon is built on a modular provider-based architecture. This ensures that while Zoom is the primary focus, the system is flexible enough to handle various video backends.


🗺️ System Overview

The integration consists of three main layers:

1. The Provider Layer (app/telemed/)

The KCTZoom class extends the KCAbstractTelemedProvider from KiviCare Core. It encapsulates all vendor-specific logic:

  • API endpoint management.
  • Formatting data for Zoom’s specific REST requirements.
  • Token lifecycle management (Refresh/Revoke).

2. The Persistence Layer (app/models/)

This layer handles the mapping between WordPress and Zoom.

  • Mapping Table: Stores the Zoom Meeting ID, UUID, and unique URLs against a KiviCare Appointment ID.
  • User Meta: Stores individual doctor tokens and configuration preferences.

3. The Controller Layer (app/controllers/api/)

The KCTZoomController exposes REST endpoints used by the React-based frontend:

  • GET /authorize: Generates the OAuth URL.
  • GET /callback: Handles the redirect from Zoom and saves tokens.
  • PUT /test-connection: Validates credentials in real-time.

🔄 Interaction Diagram

sequenceDiagram
    participant P as Patient/Doctor
    participant WP as WordPress (KiviCare)
    participant Z as Zoom API

    P->>WP: Creates Appointment
    WP->>Z: POST /users/me/meetings
    Z-->>WP: Returns Meeting JSON (Join/Start URLs)
    WP->>WP: Save to kc_appointment_zoom_mappings
    WP-->>P: Displays "Start/Join" Button

📦 File Structure Highlights

  • app/telemed/KCTZoom.php: The “Brain” of the integration.
  • app/database/migrations/: Defines the SQL schema for meeting storage.
  • app/controllers/api/KCTZoomController.php: The entry point for all frontend requests.

Next: How Zoom Integration Works

Suggestions & Improvements

Your email address will not be published. Required fields are marked *