Search by

juggernautsei / oe-module-telehealth-jse

juggernautsei

OpenEMR 8x8 Jitsi telehealth module with MHDC Stripe paywall, hosted JaaS JWT minting, and patient invites

Package info

github.com/juggernautseinc/oe-module-telehealth-jse

Type:openemr-module

pkg:composer/juggernautsei/oe-module-telehealth-jse

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.8.1 2026-12-01 02:05 UTC

This package is auto-updated.

Last update: 2026-12-01 12:27:29 UTC


README

Custom module that launches provider/patient telehealth meetings through 8x8 JaaS (Jitsi as a Service), with an in-module subscription paywall and patient invite options.

Features

  • Provider meeting launcher and patient join page
  • Module Manager gear configuration (moduleConfig.php) and Modules → 8x8 Telehealth Settings
  • Stripe Checkout subscription / 14-day free trial via MHDC license service (no Stripe secrets stored in OpenEMR)
  • Stripe Checkout and billing portal open in a new browser window (required; Stripe cannot run inside the Module Manager iframe)
  • Soft paywall: settings always available; meetings locked when trial/subscription is inactive
  • Encrypted module settings storage in the database (not Admin → Config globals)
  • Hosted JaaS mode (default): short-lived meeting JWTs minted by MHDC (clinic never stores the master private key)
  • Optional local JaaS credential mode for development / air-gapped installs
  • Calendar categories seeded on install/upgrade: Telehealth New Patient, Telehealth Established
  • Patient presence tracking for waiting-room status
  • Session recording download via 8x8 webhook (optional)
  • Patient invites (baseline): copy meeting link + email via OpenEMR SMTP
  • Flow Board camera icons: front desk queues telehealth invites; blue/green status
  • Patient invites (upgrade): SMS when a compatible texting module is installed

System architecture

This module is not an 8x8 media proxy. Video/audio and Jitsi signaling go browser ↔ 8x8 JaaS (8x8.vc). MHDC is a control plane for licensing, Stripe, and hosted JWT minting only.

┌──────────────────────┐     HTTPS API      ┌──────────────────────────┐
│  OpenEMR + module    │ ─────────────────► │  MHDC control plane      │
│  (clinic server)     │  license/status/   │  app.myhealthdataconnect │
│                      │  checkout/portal/  │  .com                    │
│  - paywall UI        │  meetings/token    │  - Stripe secret key     │
│  - soft meeting gate │ ◄───────────────── │  - JaaS private key      │
│  - email_queue invite│   jwt, app_id,     │  - telehealth_licenses   │
│  - Flow Board camera │   status JSON      │  - webhooks from Stripe  │
└──────────┬───────────┘                    └────────────┬─────────────┘
           │                                             │
           │ loads external_api.js + JWT                 │ Stripe API
           │ JitsiMeetExternalAPI("8x8.vc", …)           ▼
           ▼                                    ┌──────────────────┐
┌──────────────────────┐                        │     Stripe       │
│  Patient / provider  │   WebRTC / JaaS media  │  Checkout/Portal │
│  browser             │ ─────────────────────► │  Subscriptions   │
│                      │         8x8.vc         └──────────────────┘
└──────────────────────┘

Traffic paths (what talks to what)

From To Purpose Carries media?
OpenEMR module MHDC Checkout start, license status, billing portal, JWT mint No
MHDC Stripe Create Checkout, portal, retrieve subscription No
Stripe MHDC webhook Bind install_uuid ↔ customer/subscription No
OpenEMR module OpenEMR email_queue / SMTP Queue patient invite email No
Browser https://8x8.vc/{appId}/external_api.js Load JaaS client No (script)
Browser 8x8.vc via JitsiMeetExternalAPI Meeting room (A/V, chat, signaling) Yes

Hosted vs local JaaS credentials

Mode JWT signed by Private key location Browser still uses
hosted (default) MHDC meetings/token MHDC env only Direct 8x8.vc
local OpenEMR JavaWebToken Module DB/env on clinic Direct 8x8.vc

In both modes the meeting is not proxied through MHDC or OpenEMR.

Runtime components inside the module

Component Role
moduleConfig.php / public/settings.php Paywall + module settings UI
LicenseService + MhdcClient License cache, MHDC HTTP
scripts/license_refresh_background.php Daily MHDC status refresh (background_services)
JavaWebToken Hosted mint client or local RS256 sign
public/index.php Provider meeting + optional invite queue
public/patient.php Patient join page (known-room + rate limit)
PatientInviteService Trusted email gate + random room tokens + email_queue invites
Flow Board JS (patient_tracker_button.js) Camera icon queue/status
module_oe_telehealth_* tables Settings, presence, recordings

Patient contact: SMTP (required baseline) and texting (feature upgrade)

Getting the meeting link to the patient is a major part of the telehealth workflow. This module supports two channels. They are intentionally separated so clinics can go live with the lowest bar to entry.

Baseline: OpenEMR native SMTP (clinic responsibility)

Email invites use OpenEMR core mail (MyMailer) and the site’s existing SMTP globals (Admin email / SMTP configuration).

Important: SMTP setup, deliverability, sender address, and spam reputation are the clinic’s responsibility. This module does not ship or host an email provider. If SMTP is not configured, the settings page shows a warning and email invites will not send.

What the clinic must configure in OpenEMR (typical fields):

  • Email method = SMTP
  • SMTP host, port, auth user/password (if required)
  • Secure transport (TLS/SSL) as required by the provider
  • From / practice return email path used by OpenEMR mail

The telehealth settings UI reports whether MyMailer::isConfigured() is true so admins can see SMTP readiness before inviting patients.

Baseline invite options when SMTP works:

  1. Copy link — always available to staff
  2. Email — sent through OpenEMR SMTP to the patient email on file

Feature upgrade: texting module (SMS)

SMS invites are an optional upgrade, not part of the minimum install.

When a compatible OpenEMR texting / SMS custom module is installed and configured (for example a Juggernaut text-messaging app that exposes telemedicine send helpers such as SendTelemedicineMessage), this module can text the patient meeting link.

Capability Baseline (this module only) With texting module upgrade
Copy meeting link Yes Yes
Email invite (OpenEMR SMTP) Yes (clinic configures SMTP) Yes
SMS / text invite No Yes, if texting module is active and credentials work
Texting vendor account / fees N/A Clinic’s responsibility via the texting module

Documentation for sales / onboarding:

  • Market email + copy link as included once SMTP is configured.
  • Market SMS patient invites as a feature upgrade that requires installing and licensing/configuring the separate texting module.
  • Do not imply that SMS works out of the box with telehealth alone.

If the texting module is missing, telehealth must fail gracefully (no fatal error): staff can still copy the link or email the patient.

Subscription and paywall integration

Configuration stays inside the module (gear icon and settings menu). Nothing is added to core Administration → Config.

Why MHDC + Stripe Checkout (not Payment Links)

Clinics must not paste Stripe subscription IDs by hand. The module starts a guided Checkout Session through MHDC so:

  • Stripe owns the 14-day free trial countdown and card-on-file charge.
  • MHDC binds OpenEMR’s Unique Installation ID (install_uuid) to the Stripe customer/subscription via Checkout metadata / client_reference_id.
  • Webhooks on MHDC keep license status current (trialing, active, canceled, …).
  • OpenEMR only caches status for enforcement and UI (soft paywall).

Stripe secret keys and card data never enter OpenEMR.

Paywall sequence (detail)

Admin (Module Manager gear iframe OR Modules menu)
  → Telehealth Settings UI (templates/settings.html.twig)
  → POST start_checkout (billing email, clinic name)  [form target=_blank]
  → public/settings.php builds absolute success/cancel URLs
  → MHDC POST /api/telehealth/v1/license/checkout/start
       (X-Telehealth-Api-Key)
  → Stripe Checkout Session (mode=subscription, trial_period_days=14)
  → NEW BROWSER WINDOW opens Checkout (Stripe blocks iframes)
  → Admin completes Checkout in that window
  → Stripe webhooks → MHDC binds install_uuid ↔ customer/subscription
  → Admin returns to settings → Refresh status
  → Module GET /api/telehealth/v1/license/status
  → Local cache updated; meetings unlock when trialing/active

Provider/patient meeting launch (hosted mode)
  → License gate (trialing/active, not stale)
  → Module POST MHDC /api/telehealth/v1/meetings/token
       (install_uuid, room, user, moderator, features)
  → MHDC re-checks license, signs JaaS JWT with vaulted master key
  → Module page loads https://8x8.vc/{appId}/external_api.js
  → Browser JitsiMeetExternalAPI("8x8.vc") uses jwt (media NOT via MHDC)

Components:

Layer Responsibility
OpenEMR module UI Paywall form, trial countdown, soft locks, refresh
LicenseService / MhdcClient Call MHDC; cache license row
MHDC Stripe API, webhooks, license DB, pre-charge notices, JaaS JWT mint
Stripe Checkout, trial, billing portal, charges
8x8 JaaS Meeting media; master App ID lives on MHDC in hosted mode
  • OpenEMR module stores only a local license cache (status, trial end, customer id, install UUID snapshot). It never stores Stripe secret keys or card data.
  • MHDC (app.myhealthdataconnect.com) holds STRIPE_SECRET_KEY, creates Checkout Sessions, and is the source of truth after webhooks.
  • Auth: module calls MHDC with X-Telehealth-Api-Key (OE_TELEHEALTH_MHDC_API_KEY or gitignored config/mhdc.local.php).
  • Return URLs: success/cancel/portal return URLs must be absolute (https://host/... or http://host/...). Relative webroot paths are rejected by Stripe (Not a valid URL). public/settings.php builds absolute URLs from the current request host/scheme.
  • New window (required): Module Manager loads settings inside an iframe via moduleConfig.php. Stripe Checkout cannot be displayed in an iframe. The Start 14-day free trial and Manage billing forms use target="_blank" / formtarget="_blank" so Stripe opens in a new browser window or tab. The settings iframe stays open; after Checkout, the admin clicks Refresh status in the original window.

Admin flow (configuration page)

  1. Open Modules → Manage Modules → gear on this module, or Modules → 8x8 Telehealth Settings.
  2. Confirm SMTP readiness indicator (for later patient email invites).
  3. Enter billing email and clinic / organization name.
  4. Click Start 14-day free trial.
  5. Allow the browser popup if prompted. Stripe Checkout opens in a new window.
  6. Complete payment method setup in Stripe (not charged until trial ends unless canceled per Stripe rules).
  7. Stripe redirects the new window to a standalone success page (public/license_success.php). That page does not log you back into OpenEMR and does not deep-link into Module Manager (session cookies often are missing after Checkout).
  8. Return to Telehealth Settings in the original OpenEMR window/iframe and click Refresh status.
  9. When status is trialing or active, meetings unlock. Settings remain editable even when meetings are locked (soft paywall).

Manage billing opens the Stripe Customer Portal in a new window the same way. Use it to update the card or cancel. Then Refresh status again.

UI surfaces

Surface Path / entry Role
Gear config moduleConfig.php → iframe public/settings.php Primary Module Manager entry
Settings menu Modules → 8x8 Telehealth Settings Same UI without outer iframe
Paywall card Top of settings Twig Status, trial countdown, start trial, refresh, billing
Success return public/license_success.php Standalone success page (no OpenEMR session required)
Cancel return public/license_cancel.php Standalone cancel page (no OpenEMR session required)

License status meanings

Status Meetings Typical meaning
unconfigured Locked No checkout started
checkout_pending Locked Checkout started; subscription not confirmed yet
trialing Unlocked 14-day trial active; countdown shown in UI
active Unlocked Paid subscription current
past_due Locked Payment failed / past due
canceled / inactive Locked Subscription ended
check_failed Locked if stale MHDC unreachable or status refresh failed

UI shows human labels (for example “Checkout in progress”, “Free trial active”), trial days remaining, days until card charge, and a warning inside the last two days of trial. MHDC also records a 2-day pre-charge notice audit email for billing evidence.

Soft paywall behavior

  • Settings / config: always available to admin/super.
  • Provider meeting launch (public/index.php) and patient join (public/patient.php): blocked when license is not allowed.
  • Allowed only for cached trialing / active with a recent successful status check (stale cache fails closed after ~36 hours).
  • Opening settings best-effort refreshes MHDC when the local check is older than ~5 minutes (maybeRefreshOnPageLoad).
  • Background service Telehealth_License_Refresh (interval 1440 minutes) keeps the cache current even when no admin opens settings.
  • past_due shows a dedicated warning on the settings card and keeps meetings locked until billing is current (Manage billing → Refresh status).

MHDC endpoints used by this module

Method Path Purpose
POST /api/telehealth/v1/license/checkout/start Create Stripe Checkout + bind install
GET /api/telehealth/v1/license/status?install_uuid= Status + trial countdown fields
POST /api/telehealth/v1/license/portal Stripe Customer Billing Portal
POST /api/telehealth/v1/meetings/token Mint short-lived hosted JaaS JWT

Product/price defaults and master JaaS credentials are configured on MHDC only (not in OpenEMR Admin Config).

Configuration requirements

OpenEMR clinic (this module)

Minimum to go live:

  1. Install module under interface/modules/custom_modules/oe-module-telehealth-jse/.
  2. Modules → Manage Modules → Register → Install SQL → Enable.
  3. Confirm module SQL version is 1.5.0 (or run Upgrade SQL).
  4. Configure OpenEMR SMTP (required for email patient invites).
  5. Open 8x8 Telehealth Settings (gear or Modules menu).
  6. Start the 14-day free trial (Stripe Checkout in a new window).
  7. After Checkout, return to the original settings window → Refresh status until status is trialing or active.
  8. Launch a meeting (Direct Telehealth / provider launcher). Hosted mode requests a JWT from MHDC automatically.

Optional:

  • Install/configure a compatible texting module for SMS invites.
  • Enable session recording and configure the 8x8 recording webhook.
  • Use local credential mode only for air-gapped/dev installs that must hold JaaS keys in the module DB/env (not the default production path).

Clinic-facing secrets:

Item Where Notes
Stripe secret / cards Never in OpenEMR MHDC + Stripe only
Master JaaS private key Never in OpenEMR (hosted) MHDC vault only
MHDC API key Server env or gitignored config/mhdc.local.php X-Telehealth-Api-Key
Local JaaS keys Only if credential_mode=local Encrypted in module table / env

MHDC control plane (vendor)

Required environment on app.myhealthdataconnect.com (example keys):

Variable Purpose
STRIPE_SECRET_KEY Create Checkout, portal, retrieve subscriptions
TELEHEALTH_STRIPE_PRODUCT_ID Telehealth product
TELEHEALTH_STRIPE_PRICE_ID Subscription price (trial attached in Checkout)
TELEHEALTH_API_KEY Auth for module → MHDC API calls
JAAS_APP_ID Shared 8x8 JaaS App ID
JAAS_API_KEY JaaS API key id (kid for JWT header)
JAAS_PRIVATE_KEY Master PEM (support \n escaped single-line in .env)

MHDC must:

  • Receive Stripe webhooks and bind install_uuid → customer/subscription.
  • Serve license checkout/status/portal APIs.
  • Serve POST /api/telehealth/v1/meetings/token and refuse mint when license is not trialing/active or when JaaS env is incomplete (503).

Credential modes

Mode Default Who signs JWT Clinic pastes JaaS keys?
hosted Yes MHDC No
local No OpenEMR module Yes (dev/air-gap)

In hosted mode, meeting launch fails closed with a clear error if MHDC is unreachable or JaaS master credentials are missing on MHDC — not with a silent blank page.

Calendar categories

On Install SQL / Upgrade SQL to 1.4.0+, the module seeds (idempotent #IfNotRow on pc_constant_id):

Constant ID Name Duration
telehealthnewpatient Telehealth New Patient 30 minutes
telehealthestablished Telehealth Established 30 minutes

These appear in the OpenEMR calendar category list for scheduling telehealth appointments. Existing rows are not duplicated.

Network / URL requirements

  • OpenEMR server must reach MHDC over HTTPS (OE_TELEHEALTH_MHDC_BASE_URL if not default https://app.myhealthdataconnect.com).
  • Provider and patient browsers must reach https://8x8.vc (and related 8x8 media endpoints). Blocked outbound 8x8 traffic breaks meetings even if MHDC works.
  • MHDC must reach Stripe API and receive Stripe webhooks.
  • Stripe Checkout success/cancel URLs must be absolute (http(s)://host/...).
  • Checkout/portal open in a new browser window (iframe blocked by Stripe).
  • Success/cancel pages are standalone and do not restore the OpenEMR session; admins refresh status in the original window.
  • Flow Board camera scripts load from the module public/js/ path under the same host as OpenEMR (correct webroot; avoid double-prefix like /openemr/openemr/...).

Deployment requirements

Clinic OpenEMR host

Requirement Notes
OpenEMR Compatible with module target (PHP 7.4+ / project standard for this branch)
Module path interface/modules/custom_modules/oe-module-telehealth-jse/
Module enable Register → Install/Upgrade SQL → Enable in Module Manager
SQL version 1.5.0+ (version.php / Upgrade SQL)
ACL Settings: admin/super; Flow Board invite APIs: patients/appt or admin
SMTP Required for email invites; clinic owns deliverability
Email background service Must process email_queue or invites stay sent=0
License background service Telehealth_License_Refresh daily (1440 min) — installed by SQL 1.5.0
Outbound HTTPS to MHDC From PHP (status, checkout, JWT mint, background refresh)
Browser access to 8x8 Users need 8x8.vc (not proxied)
Secrets on clinic MHDC API key only (env or config/mhdc.local.php); never Stripe/JaaS master PEM in hosted mode

Optional clinic pieces:

  • Texting module for SMS invites
  • 8x8 recording webhook URL + secret if recording enabled
  • credential_mode=local only for air-gapped/dev with local JaaS keys

MHDC vendor host

Requirement Notes
App deploy e.g. app.myhealthdataconnect.com with telehealth routes
Env STRIPE_SECRET_KEY, TELEHEALTH_STRIPE_PRODUCT_ID, TELEHEALTH_STRIPE_PRICE_ID, TELEHEALTH_API_KEY, JAAS_APP_ID, JAAS_API_KEY, JAAS_PRIVATE_KEY
Stripe webhook Endpoint must update telehealth_licenses from subscription lifecycle events
HTTPS Public TLS for clinic module callbacks and Checkout return flows
No media proxy Do not route WebRTC through MHDC

Deploy checklist (clinic)

  1. Copy/update module files into custom_modules/oe-module-telehealth-jse/.
  2. Run Install SQL or Upgrade SQL to current version.
  3. Set OE_TELEHEALTH_MHDC_API_KEY (and base URL if non-default).
  4. Configure OpenEMR SMTP; confirm settings page shows SMTP configured.
  5. Confirm email background service is active.
  6. Open Telehealth Settings → complete Checkout trial → Refresh status.
  7. Smoke: Flow Board camera queues invite; Direct Telehealth opens 8x8.vc; patient link joins same room.

Deploy checklist (MHDC)

  1. Deploy license + meetings/token code and DI routes.
  2. Set Stripe + TELEHEALTH_* + JAAS_* in env (PEM may use \n escapes).
  3. Confirm Stripe webhook signing secret and handlers for checkout/subscription events.
  4. Smoke: POST .../license/checkout/start, GET .../license/status, POST .../meetings/token with API key (expect 200 when licensed and JAAS configured).

Security boundaries

  • In OpenEMR: license cache, billing profile fields, optional local JaaS keys (encrypted), invite queue content (meeting URL + marker).
  • Never in OpenEMR (hosted): Stripe secret, card data, master JaaS private key.
  • In browser: short-lived JWT and direct 8x8 session (treat as sensitive; HTTPS site recommended).
  • PHI: do not send patient identifiers to MHDC beyond install binding metadata required for licensing; invite email stays on clinic mail path.

Database migration (settings storage)

Module table module_oe_telehealth_8x8_jitsi stores:

  • Optional local JaaS fields: jaas_app_id, jaas_api_key, jaas_private_key
  • webhook_secret, recording_enabled
  • License/paywall cache: billing_email, clinic_name, license_status, license_checked_at, trial_ends_at, license_expires_at, install_uuid_snapshot, stripe_customer_id, checkout_session_id, credential_mode

Sensitive values use OpenEMR crypto helpers where applicable.

Related tables:

  • module_oe_telehealth_patient_presence — waiting / presence
  • module_oe_telehealth_recordings — recording metadata

Fresh install

  1. Deploy under interface/modules/custom_modules/oe-module-telehealth-jse/.
  2. Modules → Manage Modules → Register → Install SQL → Enable.
  3. Confirm version.php reports 1.5.0.
  4. Configure OpenEMR SMTP (required for email invites).
  5. Open 8x8 Telehealth Settings, start the free trial / subscription.
  6. Refresh status after Checkout; confirm trialing/active and meetings unlocked.
  7. Smoke-test: Direct Telehealth / provider launch (hosted JWT), patient join, copy link, email invite; SMS only if texting module is present.
  8. Optionally install and configure the texting module if SMS invites are desired.

Existing install upgrade

  1. Deploy module code (version.php, table.sql, sql/, settings UI).
  2. In Modules → Manage Modules, run Upgrade SQL for oe-module-telehealth-jse when offered.
  3. Schema path includes versioned files such as:
    • sql/1_0_0-to-1_1_0_upgrade.sql
    • sql/1_1_0-to-1_2_0_upgrade.sql
    • sql/1_2_0-to-1_3_0_upgrade.sql (license/paywall columns)
    • sql/1_3_0-to-1_4_0_upgrade.sql (telehealth calendar categories)
    • sql/1_4_0-to-1_5_0_upgrade.sql (daily MHDC license refresh background service)
  4. Re-open settings, confirm subscription status, and verify SMTP warning/status.
  5. Confirm calendar categories Telehealth New Patient and Telehealth Established exist (or were already present).
  6. Smoke-test meetings (hosted JWT) and invites.

Optional environment overrides

Runtime overrides (mainly local/dev or host secrets):

  • OE_TELEHEALTH_JAAS_APP_ID
  • OE_TELEHEALTH_JAAS_API_KEY
  • OE_TELEHEALTH_JAAS_PRIVATE_KEY
  • OE_TELEHEALTH_MHDC_BASE_URL
  • OE_TELEHEALTH_MHDC_API_KEY
  • OE_TELEHEALTH_SHOW_LOCAL_CREDENTIALS=1 — show local JaaS key fields in UI

Docker/dev may also use gitignored config/mhdc.local.php for MHDC base URL only. Copy config/mhdc.local.php.example if needed. Never store a live API key in that file — use OE_TELEHEALTH_MHDC_API_KEY (and MHDC TELEHEALTH_API_KEY) as environment variables only. Rotate the shared key if it was ever written to disk or shared in chat/logs.

Uninstall cleanup

Unregistering the module drops:

  • module_oe_telehealth_patient_presence
  • module_oe_telehealth_recordings
  • module_oe_telehealth_8x8_jitsi
  • background service row Telehealth_License_Refresh

Disable deactivates the background service (active=0) without dropping tables.

Runtime notes

  • Settings require admin/super ACL and CSRF validation.
  • Meeting entry points soft-block when the subscription/trial is not allowed.
  • Background service Telehealth_License_Refresh runs daily (execute_interval=1440) and refreshes license status from MHDC so stale caches fail closed after ~36h.
  • Hosted credential mode mints JWTs via MHDC; clinics do not paste JaaS private keys.
  • Local credential mode remains available for air-gapped or development use.
  • Calendar categories for telehealth are created on install/upgrade (idempotent).
  • Patient SMS depends on an external texting module; absence must not break the UI.

Session recording

  1. Enable Enable session recording in 8x8 Telehealth Settings.
  2. In the 8x8/JaaS console, add a webhook endpoint:
    • URL: /interface/modules/custom_modules/oe-module-telehealth-jse/public/webhooks/recording.php
    • Event: RECORDING_UPLOADED
    • Use the webhook secret from module settings.
  3. During a meeting, a moderator starts recording in the JaaS UI.
  4. When 8x8 finishes processing, the webhook downloads the file:
    • stored under sites/<site>/documents/telehealth_recordings/
    • metadata in module_oe_telehealth_recordings
    • attached as a patient document when room→patient mapping is known
  5. Download from Modules → 8x8 Telehealth Recordings.

Notes:

  • JaaS cloud recording links are short-lived; this module downloads on webhook.
  • Recording must also be enabled on your 8x8 plan/app.

Troubleshooting

SMTP / email invites

  • Settings shows SMTP not configured → fix OpenEMR Admin email/SMTP settings first. Required baseline before promising email invites to staff.
  • Typical OpenEMR globals: email method SMTP, host, port, auth user/password, TLS, and practice/from addresses used by MyMailer.
  • SMTP configured but mail not received → clinic must check host/port/auth, From address, TLS, DNS/SPF/DKIM, and provider logs. This is outside the telehealth module scope.
  • Do not open tickets against the telehealth module for third-party SMTP outages or spam filtering at the clinic’s mail provider.

SMS invites (texting module upgrade)

  • SMS is not included in the telehealth baseline install.
  • SMS button missing or no-op → texting module not installed, not enabled, or not configured. Install/configure the separate texting module upgrade.
  • SMS fails with vendor errors → resolve in the texting module (API keys, numbers, compliance). Telehealth only hands off the meeting link payload.

Paywall / Stripe Checkout

  • Stripe blank or blocked inside the gear panel: expected if the form is not using a new window. Checkout must open with target="_blank". Do not try to embed Stripe inside the Module Manager iframe.
  • Popup blocked: the browser may block the new window. Allow popups for the OpenEMR site, then click Start 14-day free trial again.
  • Start trial returns error Not a valid URL / MHDC 502: success and cancel URLs must be absolute. Ensure you are on a build of public/settings.php that prefixes scheme + host (not webroot-only paths). Access OpenEMR via a real host header (for example http://localhost:8300), not a mis-set reverse proxy host.
  • Success page HTTP 400 after Checkout: fixed by making license_success.php / license_cancel.php standalone (no globals.php). Reload the return URL if an old build is still mounted.
  • Status stuck on checkout_pending: complete Stripe Checkout in the new window, confirm MHDC webhook received subscription events, then click Refresh status in the original settings window. Do not expect the success tab to reopen OpenEMR automatically.
  • 401 from MHDC: OE_TELEHEALTH_MHDC_API_KEY / config/mhdc.local.php must match MHDC TELEHEALTH_API_KEY.
  • Meetings locked after payment: wait for webhook, refresh status, confirm status is trialing or active and the status check is not stale.
  • Manage billing: requires a bound Stripe customer; available after checkout has created/linked a customer id. Opens in a new window like Checkout.
  • Trial charge / cancel: Stripe owns trial end and charging. MHDC may email a 2-day pre-charge notice and keep an audit row; clinics still manage cancel via Manage billing (Customer Portal).

Schema not applied

If logs show missing columns/tables (for example recording_enabled or module_oe_telehealth_recordings):

  1. Confirm deploy includes current version.php and sql/ upgrades.
  2. Modules → Manage Modules → Install SQL / Upgrade SQL.
  3. If no button appears, apply the appropriate manual SQL under sql/ and sync:
UPDATE modules
SET sql_version = '1.5.0'
WHERE mod_directory = 'oe-module-telehealth-jse';

Also ensure the daily license job exists (from sql/1_4_0-to-1_5_0_upgrade.sql):

SELECT name, active, execute_interval, `function`, require_once
FROM background_services
WHERE name = 'Telehealth_License_Refresh';

Hosted meeting JWT / Direct Telehealth

  • Message about unable to start session / hosted credentials: MHDC must have JAAS_APP_ID, JAAS_API_KEY, and JAAS_PRIVATE_KEY configured. Mint endpoint returns 503 when those are missing.
  • 401 from meetings/token: module MHDC API key does not match TELEHEALTH_API_KEY.
  • 403 from meetings/token: install UUID not licensed (trialing/active).
  • License shows unlocked but launch fails: check OpenEMR error log for Telehealth JWT mint failed and MHDC connectivity from the OpenEMR host.
  • Local/dev without MHDC JaaS: set credential_mode=local and supply JaaS keys via settings/env (not recommended for production clinics).

Subscription / meetings locked

  • Complete Stripe Checkout and click Refresh status.
  • Confirm MHDC can be reached and OE_TELEHEALTH_MHDC_API_KEY matches the server.
  • Meetings stay locked for unconfigured, checkout_pending, inactive, canceled, past_due, or stale/failed status checks.
  • past_due: open Manage billing, update payment method, wait for Stripe webhook → MHDC, then Refresh status. Meetings unlock only for trialing/active.
  • Stale cache: if license_checked_at is older than ~36h while status still looks active, the soft gate fails closed. Open settings (auto refresh) or wait for Telehealth_License_Refresh, or force: php library/ajax/execute_background_services.php default Telehealth_License_Refresh 1 from the OpenEMR host (CLI, web user).

Flow Board invite cameras (front desk)

Front desk staff send the patient meeting link before the provider opens the chart.

Behavior

  • On Flow Board (patient_tracker.php), telehealth visit rows get a camera icon.
  • Blue camera = no invite yet. Click queues an invite email immediately (if the patient has trusted/direct email).
  • Green camera = invite already queued or sent. Tooltip shows queue time and whether it has been sent.
  • Invites go into OpenEMR email_queue via MyMailer::emailServiceQueue() (background email service delivers).
  • Room IDs are random 32-hex tokens stored on module_oe_telehealth_patient_presence (not derived from pid). Legacy md5 rooms still resolve if already present.
  • Duplicate prevention is per patient + meeting room using an opaque marker in the queue body: [telehealth-invite t={sha256}] (legacy pid markers still match).

Dashboard Direct Telehealth

  • Opens the provider meeting.
  • Queues email only if this patient/meeting has no invite yet.
  • Button turns green when the patient is waiting in the room (presence poll).

APIs

Method Path Purpose
GET /public/api/invite.php?pid= Invite status + patient waiting
POST /public/api/invite.php Queue invite if needed (pid, CSRF)
GET /public/api/invite_status_batch.php?pids=1,2 Batch status for Flow Board icons

Staff prerequisites

  • Patient chart must have Direct/trusted email (email_direct) or standard email.
  • OpenEMR SMTP must be configured and the email background service must process email_queue.
  • Telehealth subscription/trial must be active.

Isolated tests

Module-local tests (no full OpenEMR bootstrap required for unit/contract checks):

# from module root
./tests/run.sh
# or individually
php tests/unit/PatientInviteLogicTest.php
php tests/unit/InviteApiContractTest.php
node tests/js/flowboard_invite_helpers.test.js

These cover invite double-send guards, API response contracts, and Flow Board camera color/tooltip/queue-click helpers.

From an OpenEMR project root (when a suite is present):

php /path/to/phpunit -c phpunit-isolated.xml
# or
composer test

See tests/README.md for suite details when available.

End-to-end paywall verification checklist

Use this after install/upgrade or when diagnosing licensing.

Automated / CLI (clinic host)

  1. Module SQL version 1.5.0 and background row present:
    • modules.sql_version = '1.5.0' for oe-module-telehealth-jse
    • background_services.name = 'Telehealth_License_Refresh', active=1, interval 1440
  2. MHDC auth: GET /api/telehealth/v1/license/status?install_uuid=… with X-Telehealth-Api-Key returns 200 (wrong key → 401).
  3. Run background refresh once; confirm local module_oe_telehealth_8x8_jitsi.license_status matches MHDC and license_checked_at is fresh.
  4. Soft gate: LicenseService::isMeetingAllowed() is true only for trialing/active with fresh check; false for past_due / stale / unconfigured.
  5. Standalone return pages: license_success.php and license_cancel.php return HTTP 200 without OpenEMR session.
  6. Unit suite: ./tests/run.sh passes.

UI (admin browser)

  1. Gear opens settings (no “No Configuration Defined”).
  2. Paywall card shows status badge, meetings locked/unlocked, install UUID, SMTP indicator.
  3. Start 14-day free trial opens Stripe in a new window (not inside iframe).
  4. After Checkout, success page instructs return + Refresh status.
  5. When MHDC reports trialing/active, meetings unlock; provider launch works.
  6. When MHDC reports past_due/canceled/inactive, meetings stay locked and settings still open for Manage billing / restart checkout.

Security hardening (v1.8.0+)

Production environment variables:

  • OE_TELEHEALTH_ENV=production — disables file-based MHDC API keys and webhook dev bypass
  • OE_TELEHEALTH_MHDC_API_KEY — required in production (do not put keys in config/mhdc.local.php)
  • OE_TELEHEALTH_MHDC_BASE_URL — MHDC base URL
  • OE_TELEHEALTH_PUBLIC_BASE_URL — absolute public site URL for invites and Stripe return URLs
  • OE_TELEHEALTH_DOWNLOAD_HOST_SUFFIXES — optional extra allowlisted CDN host suffixes
  • OE_TELEHEALTH_WEBHOOK_DEV_BYPASS — only honored when OE_TELEHEALTH_ENV is dev/local/test

Release notes:

  • Provider launch requires patient_id (no auto-join of waiting rooms)
  • Recording/transcript downloads SSRF-hardened (HTTPS allowlist, private IP block, size limits)
  • Media list/download restricted to admin/super
  • Patient join tokens support room_expires_at (24h default)
  • Webhook HMAC verification centralized; presence updates only for known rooms
  • JWT feature flags follow module settings; shorter token lifetime

Per-install MHDC API keys (C3)

After license bind, the module claims a per-install key from MHDC (/api/telehealth/v1/license/credentials/claim) and stores it encrypted as mhdc_install_api_key. Requests send X-Telehealth-Install-Uuid + X-Telehealth-Install-Key. The shared OE_TELEHEALTH_MHDC_API_KEY remains for bootstrap until MHDC sets TELEHEALTH_REQUIRE_INSTALL_KEY=1.