Case studiesHealthcare · Telehealth50-State Clinical Architecture Live

When the GLP-1 surge outgrew off-the-shelf software, we replaced four disconnected vendors with one clinical platform — asynchronous chart review, 50-state licensing, e-prescribing into 503A compounding, and split-billing that settles at capture.

38
Clinic Tenants10 operating at scale
12,400+
Active PatientsManaged on platform
311
Monthly EncountersPhysician-approved
~$76K
Monthly Platform Rev~$233 per encounter
01 — Use Case & Problem

A fast-growing US digital health venture needed to scale past off-the-shelf software to run tens of distributed clinics on high-volume GLP-1 protocols.

Friction 01

Disjointed Vendor Latency

Intake, charting, e-prescribing and billing sat in four systems that never shared a patient record.

Impact: Slow provider triage & backlog
Friction 02

Manual Pharmacy Routing

A coordinator picked a compounding pharmacy by hand, then re-keyed the prescription into its portal.

Impact: Fulfilment friction & drop-off
Friction 03

Multi-Tenant Scalability Block

Onboarding a clinic meant a code change and a migration, with no guarantee of record isolation.

Impact: Blocked clinic onboarding
Friction 04

Cold Chain Blind Spot

Temperature excursions surfaced when a patient reported a warm package — long past recovery.

Impact: Wasted doses, no audit trail
02 — The workflow visually

Scroll to walk the pipeline. The rail tracks where you are and shows the contract each stage emits.

Stage 01 of 06Intake
01 · Edge ingestionFully automated

Asynchronous patient intake with automated clinical rule checks.

Structured intake on a white-labeled PWA. The worker parses biometrics, checks BMI against protocol, and clears MEN2/MTC contraindications before anything reaches a physician.

Payload format
FHIR R4 JSON schema
Encrypted
Identity verification
Stripe Identity API
Verified
Biometric validation
BMI ≥ 30, or ≥ 27 with comorbidity
Passed
Contraindication screen
MEN2 / MTC / pancreatitis ruleset
Cleared
02 · Compliance engine50-state coverage

Deterministic jurisdiction matching against active MD/DO credentials.

The prescriber must hold an active licence in the patient’s state. Routing matches residence against live provider registries and per-state async rules before assigning a queue.

Jurisdiction matching
Residence state + geo signal
State verified
Physician registry
NPI registry + active licence
Validated
Telehealth ruleset
Async vs. synchronous board rules
Enforced
Malpractice boundary
State carrier coverage check
Active
03 · Provider EMR45s review SLA

Synthesized clinical decision support with one-click signature.

A pre-compiled dossier — vitals, biomarkers, suggested titration step. Sign with a 21 CFR Part 11 signature, or escalate to synchronous video.

Chart synthesis
Pre-compiled vitals & lab trendlines
Rendered
Decision support
Protocol titration step suggestion
Automated
Digital signature
SHA-256 PKI timestamped signature
21 CFR Part 11
Audit logging
Append-only immutable audit stream
Encrypted
04 · 503A / 503Be-Rx + 503A bus

Automated compounding prescription routing and EDI dispatch.

Signed orders dispatch over NCPDP SCRIPT EDI, or straight to a 503A partner over REST — selected on inventory, licensing and proximity.

Message protocol
NCPDP SCRIPT / EDI 10.6
Validated
Compounding hub
Certified 503A facility selection
Proximity matched
Batch validation
Certificate of analysis check
Verified
Transmission
mTLS encrypted webhook gateway
Dispatched
05 · IoT logisticsSensor monitored

Continuous 36–46°F monitoring across the whole transit window.

Carrier webhooks and in-box loggers stream transit telemetry continuously, alerting the moment a package trends toward its limit — not after it breaches.

Safe temperature zone
36°F to 46°F (2°C to 8°C)
Continuous
Insulated packaging
Validated 48-hour cold box
Verified
Carrier ingestion
Cold-chain telemetry webhook
Real-time
Patient alerting
Automated delivery notice
Triggered
06 · Financial ledgerZero recon errors

Multi-party disbursement and 28-day titration triggers.

One charge, three destinations: professional fee, pharmacy wholesale, clinic margin — with the next refill scheduled in the same transaction.

Subscription capture
$233.00 recurring monthly
Captured
Physician group payout
$45.00 professional fee
Transferred
Pharmacy fulfilment
$115.00 503A wholesale
Transferred
Clinic platform margin
$73.00 net to tenant
Settled
03 — What the physician sees

A 45-second SLA is a layout problem before it is an engineering one. Hover a numbered entry to find it on the screen.

Provider console showing a patient profile, contraindication assessment checklist, GLP-1 titration dosage curve, and the electronic prescription panel with a digital signature block.
Representative provider console — anonymized. Patient identifiers, prescriber credentials and clinic branding are stand-ins; the layout and clinical fields are as built.
04 — Provider console

Pick a queued patient, read the dossier, sign. The real decision surface, with synthetic records behind it.

Patient A-102

Texas (TX) · 38y · Female
Eligible · BMI ≥ 30Contraindications cleared
Biometric
BMI 31.2
Derived at intake from structured telemetry
Recommended protocol
Semaglutide SQ
Opening dose 0.25mg sub-Q / week
Lab integration
Sync verified
Fasting glucose and lipid panel synced from lab partner
21 CFR Part 11 signatureSign to dispatch this prescription to the 503A compounding hub
05 — n8n automation engine

Adherence reminders, queue SLA monitors, lab callbacks and refill scheduling run as self-hosted workflows. Run the graph to watch an approved encounter propagate.

n8n Engine
Encounter Sync v3.4
Swipe canvas horizontally to explore flow5 Nodes
trigger

Webhook: Encounter Signed

Listens for cryptographically signed encounters

StatusReady
transform

FHIR to SCRIPT Converter

Transforms JSON to NCPDP SCRIPT 10.6 XML

StatusReady
api

Surescripts / 503A Dispatch

Dispatches prescription to 503A pharmacy

StatusReady
action

Twilio Patient Flow

Automates patient SMS & titration tracker

StatusReady
action

Stripe Split-Billing

Reconciles $233 charge ($45/$115/$73 split)

StatusReady
Execution Output LogSLA < 50ms
Workflow loaded: Clinical Encounter Sync (Active)
Ready for webhook trigger
Node Inspector

FHIR to SCRIPT Converter

transform
Node Parameters
Runtime:Node.js 18 (Isolated V8)
Target Schema:NCPDP SCRIPT 10.6
Validation:Strict FHIR R4 to EDI
Output JSON Data
{
  "messageId": "RX-TX-992148",
  "format": "NCPDP_SCRIPT_10_6",
  "pharmacyNcpdp": "503A-AUSTIN-HUB-01",
  "dosageVial": "5mL Multi-Dose",
  "refills": 3
}
Avg Latency:12 ms
Error Retry Policy:Exponential Backoff
06 — Cold chain

In-box loggers and carrier webhooks stream transit telemetry continuously, so an excursion is predicted rather than reported.

Safe zone
36–46°F (2–8°C)
Packaging
Validated 48-hour cold box
Ingest
Carrier webhook, real time
In-box logger · 48-hour transitSafe zone 3646°F
32°36°40°44°48°52°Alert · 44.7°FPack out0hOrigin hub14hAlert raised31hDelivered48h

The alert fires on the trend, not the breach. At hour 31 the payload is still inside the safe band — which is the window in which a shipment can still be re-iced or re-routed rather than written off.

07 — Multi-tenant isolation

Every clinic's records share one table. Isolation is enforced by PostgreSQL, not application code — a query without a tenant context returns nothing rather than the wrong rows.

Signed in as
SET LOCAL app.current_tenant_id = 'tenant_01';  SELECT id, patient, rx, phi_data FROM clinical_encounters;
Row-level securityUSING (tenant_id =
  current_setting('app.current_tenant_id'))

Evaluated by PostgreSQL during query planning — before a row is handed back to the application.

Clinic tenant ATX region

Awaiting query

Clinic tenant BFL region

Awaiting query

Operator view

The same rule, seen from the network console.

A network administrator sees every clinic they own on one screen, and nothing they don't. Commercial figures and tenant names are redacted here for the same reason this case study is anonymized.

Network overview dashboard listing clinic tenants with revenue, encounter counts and active physician numbers, alongside encounter volume and pharmacy fulfilment charts.
Representative network overview — anonymized. Reported platform figures for this engagement are in the outcomes section below.
08 — System architecture

Select a tier to read the contract it hands the one below it.

Data tier

PostgreSQL row-level security and envelope keys

PostgreSQL 15 · RLS · KMS envelope encryption
RLS policy

Logical tenant isolation enforced in the database itself rather than in application code. PHI fields are encrypted at rest under per-tenant envelope keys.

Encryption at rest
AES-256, per-tenant envelope keys
Transit
TLS 1.3 · mTLS between services
Audit
Append-only, tamper-evident stream
RLS policyTier 04 / 6
-- Tenant isolation, enforced by the engine
ALTER TABLE clinical_encounters ENABLE ROW LEVEL SECURITY;

CREATE POLICY tenant_isolation_policy ON clinical_encounters
  FOR ALL
  USING (tenant_id = current_setting('app.current_tenant_id', true)::uuid);

-- Session context, set before any query runs
SET LOCAL app.current_tenant_id = '018f2d91-4e78-7102-a1b2-c3d4e5f60708';
09 — Outcomes
38clinic tenants

Onboarded onto one shared platform with no per-tenant code branch — 10 of them operating at full scale.

  • 12,400+
    Patient records under managementIsolated per tenant by row-level security
  • 311
    Encounters approved / monthAsynchronous physician review, 45s SLA
  • ~$76K
    Platform revenue / monthAveraging ~$233 per encounter, split at capture
  • < 1.2s
    Signature to pharmacy dispatchPreviously a manual re-key by a coordinator

This venture is described by sector and geography rather than by name, so publishing never waits on a client's sign-off. The figures are unchanged either way — our delivery record is independently verifiable on Upwork.

Work with us

Our pods already know what a BAA, an NPI registry and a 503A routing rule are — so compliance starts on day one, not after the audit.

  • HIPAA & BAA
  • EMR / EHR
  • HL7 & FHIR
  • e-Rx
  • 503A fulfilment
  • Cold chain