juggernautsei / oe-module-telehealth-jse
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
Requires
- php: >=7.4
- firebase/php-jwt: ^5.2
- nyholm/psr7: ^1.4
- openemr/oe-module-installer-plugin: ^0.1.0
- symfony/event-dispatcher: ^4.4.0
- web-token/jwt-core: ^2.2
- web-token/jwt-key-mgmt: ^2.2
- web-token/jwt-signature: ^2.2
- web-token/jwt-signature-algorithm-hmac: *
- web-token/jwt-signature-algorithm-rsa: ^2.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
- openemr/openemr: <7.0.0
Replaces
None
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:
- Copy link — always available to staff
- 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) holdsSTRIPE_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_KEYor gitignoredconfig/mhdc.local.php). - Return URLs: success/cancel/portal return URLs must be absolute
(
https://host/...orhttp://host/...). Relative webroot paths are rejected by Stripe (Not a valid URL).public/settings.phpbuilds 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 usetarget="_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)
- Open Modules → Manage Modules → gear on this module, or Modules → 8x8 Telehealth Settings.
- Confirm SMTP readiness indicator (for later patient email invites).
- Enter billing email and clinic / organization name.
- Click Start 14-day free trial.
- Allow the browser popup if prompted. Stripe Checkout opens in a new window.
- Complete payment method setup in Stripe (not charged until trial ends unless canceled per Stripe rules).
- 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). - Return to Telehealth Settings in the original OpenEMR window/iframe and click Refresh status.
- When status is
trialingoractive, 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/activewith 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_dueshows 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:
- Install module under
interface/modules/custom_modules/oe-module-telehealth-jse/. - Modules → Manage Modules → Register → Install SQL → Enable.
- Confirm module SQL version is 1.5.0 (or run Upgrade SQL).
- Configure OpenEMR SMTP (required for email patient invites).
- Open 8x8 Telehealth Settings (gear or Modules menu).
- Start the 14-day free trial (Stripe Checkout in a new window).
- After Checkout, return to the original settings window → Refresh status
until status is
trialingoractive. - 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/tokenand refuse mint when license is nottrialing/activeor 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_URLif not defaulthttps://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=localonly 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)
- Copy/update module files into
custom_modules/oe-module-telehealth-jse/. - Run Install SQL or Upgrade SQL to current version.
- Set
OE_TELEHEALTH_MHDC_API_KEY(and base URL if non-default). - Configure OpenEMR SMTP; confirm settings page shows SMTP configured.
- Confirm email background service is active.
- Open Telehealth Settings → complete Checkout trial → Refresh status.
- Smoke: Flow Board camera queues invite; Direct Telehealth opens
8x8.vc; patient link joins same room.
Deploy checklist (MHDC)
- Deploy license +
meetings/tokencode and DI routes. - Set Stripe +
TELEHEALTH_*+JAAS_*in env (PEM may use\nescapes). - Confirm Stripe webhook signing secret and handlers for checkout/subscription events.
- Smoke:
POST .../license/checkout/start,GET .../license/status,POST .../meetings/tokenwith 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 / presencemodule_oe_telehealth_recordings— recording metadata
Fresh install
- Deploy under
interface/modules/custom_modules/oe-module-telehealth-jse/. - Modules → Manage Modules → Register → Install SQL → Enable.
- Confirm
version.phpreports 1.5.0. - Configure OpenEMR SMTP (required for email invites).
- Open 8x8 Telehealth Settings, start the free trial / subscription.
- Refresh status after Checkout; confirm
trialing/activeand meetings unlocked. - Smoke-test: Direct Telehealth / provider launch (hosted JWT), patient join, copy link, email invite; SMS only if texting module is present.
- Optionally install and configure the texting module if SMS invites are desired.
Existing install upgrade
- Deploy module code (
version.php,table.sql,sql/, settings UI). - In Modules → Manage Modules, run Upgrade SQL for
oe-module-telehealth-jsewhen offered. - Schema path includes versioned files such as:
sql/1_0_0-to-1_1_0_upgrade.sqlsql/1_1_0-to-1_2_0_upgrade.sqlsql/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)
- Re-open settings, confirm subscription status, and verify SMTP warning/status.
- Confirm calendar categories Telehealth New Patient and Telehealth Established exist (or were already present).
- Smoke-test meetings (hosted JWT) and invites.
Optional environment overrides
Runtime overrides (mainly local/dev or host secrets):
OE_TELEHEALTH_JAAS_APP_IDOE_TELEHEALTH_JAAS_API_KEYOE_TELEHEALTH_JAAS_PRIVATE_KEYOE_TELEHEALTH_MHDC_BASE_URLOE_TELEHEALTH_MHDC_API_KEYOE_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_presencemodule_oe_telehealth_recordingsmodule_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/superACL and CSRF validation. - Meeting entry points soft-block when the subscription/trial is not allowed.
- Background service
Telehealth_License_Refreshruns 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
- Enable Enable session recording in 8x8 Telehealth Settings.
- 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.
- URL:
- During a meeting, a moderator starts recording in the JaaS UI.
- 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
- stored under
- 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 ofpublic/settings.phpthat prefixes scheme + host (not webroot-only paths). Access OpenEMR via a real host header (for examplehttp://localhost:8300), not a mis-set reverse proxy host. - Success page HTTP 400 after Checkout: fixed by making
license_success.php/license_cancel.phpstandalone (noglobals.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.phpmust match MHDCTELEHEALTH_API_KEY. - Meetings locked after payment: wait for webhook, refresh status, confirm
status is
trialingoractiveand 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):
- Confirm deploy includes current
version.phpandsql/upgrades. - Modules → Manage Modules → Install SQL / Upgrade SQL.
- 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, andJAAS_PRIVATE_KEYconfigured. 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 failedand MHDC connectivity from the OpenEMR host. - Local/dev without MHDC JaaS: set
credential_mode=localand 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_KEYmatches 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 fortrialing/active.- Stale cache: if
license_checked_atis older than ~36h while status still looks active, the soft gate fails closed. Open settings (auto refresh) or wait forTelehealth_License_Refresh, or force:php library/ajax/execute_background_services.php default Telehealth_License_Refresh 1from 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_queueviaMyMailer::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 standardemail. - 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)
- Module SQL version 1.5.0 and background row present:
modules.sql_version = '1.5.0'foroe-module-telehealth-jsebackground_services.name = 'Telehealth_License_Refresh',active=1, interval1440
- MHDC auth:
GET /api/telehealth/v1/license/status?install_uuid=…withX-Telehealth-Api-Keyreturns 200 (wrong key → 401). - Run background refresh once; confirm local
module_oe_telehealth_8x8_jitsi.license_statusmatches MHDC andlicense_checked_atis fresh. - Soft gate:
LicenseService::isMeetingAllowed()is true only fortrialing/activewith fresh check; false forpast_due/ stale / unconfigured. - Standalone return pages:
license_success.phpandlicense_cancel.phpreturn HTTP 200 without OpenEMR session. - Unit suite:
./tests/run.shpasses.
UI (admin browser)
- Gear opens settings (no “No Configuration Defined”).
- Paywall card shows status badge, meetings locked/unlocked, install UUID, SMTP indicator.
- Start 14-day free trial opens Stripe in a new window (not inside iframe).
- After Checkout, success page instructs return + Refresh status.
- When MHDC reports
trialing/active, meetings unlock; provider launch works. - 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 bypassOE_TELEHEALTH_MHDC_API_KEY— required in production (do not put keys inconfig/mhdc.local.php)OE_TELEHEALTH_MHDC_BASE_URL— MHDC base URLOE_TELEHEALTH_PUBLIC_BASE_URL— absolute public site URL for invites and Stripe return URLsOE_TELEHEALTH_DOWNLOAD_HOST_SUFFIXES— optional extra allowlisted CDN host suffixesOE_TELEHEALTH_WEBHOOK_DEV_BYPASS— only honored whenOE_TELEHEALTH_ENVis 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.