Clinical Services Layer (The Clinic)
This document defines the Clinical Services Layer, which enables optional physician involvement in the Regain Health. When enabled, the app can function as a medical provider, diagnostic authority, and medication management tool—with a licensed physician in the loop.
Detailed Physician Integration Architecture: See 10-Clinical-Expanded-Mode.md for the "Collaborative Intelligence" model.
1) Purpose
The Clinical Services Layer extends the core system to support telemedicine, clinical decision support, and prescription management. It transforms the app from a wellness-only product into a hybrid platform where licensed physicians can deliver care using the full context of the user's Health State.
Key references:
- Operating modes: 01-Vision-and-First-Principles.md § 3
- Core architecture: 02-Core-Product-System.md
- Compliance: 05-Compliance-Safety-Privacy.md
2) Architecture Overview
The core system has four layers:
- The Spine (Health State)
- The Brain (Assessment Engine)
- The Muscle (Protocol Engine)
- The Shield (Safety/Escalation)
The Clinical Services Layer adds a fifth: The Clinic.
| Component | Purpose | | :--- | :--- | | Clinical Decision Support (CDS) | Surfaces Health State + Assessment to physicians | | Visit Management | Async messaging and sync video visits | | Prescription Management | e-Prescribe routing, tracking, outcome correlation | | Provider Network | Partner API + BYOD physician management | | Jurisdiction Router | Routes actions based on regulatory constraints |
3) Operating Modes
3.1 Standalone Mode (Default)
- No physician involvement
- Wellness product positioning
- Lifestyle recommendations only
- Not a medical provider, diagnostic authority, or medication manager
- Escalates to external healthcare when red flags appear
3.2 Expanded Mode (Opt-in)
- Licensed physician in the loop
- Can function as medical provider
- Can render diagnoses (physician validates using CDS)
- Can manage medications (physician prescribes; app tracks)
- Regulatory and liability posture shifts to clinical entity
Users can transition between modes based on their needs and subscription tier.
4) Provider Network #providers
4.1 Partner Network
On-demand access via telemedicine API partners (e.g., Wheel, Truepill, Akido).
| Attribute | Description | | :--- | :--- | | Credentialing | Partner handles physician credentialing and licensing | | Multi-state | Partner maintains licenses across US states | | Use case | Users without existing PCP, quick access needs | | Scheduling | On-demand or scheduled appointments |
4.2 BYOD Network (Bring Your Own Doctor)
User invites their existing physician to join the platform.
| Attribute | Description | | :--- | :--- | | Invite flow | User sends secure invite link to their doctor | | Verification | Doctor creates provider account, credentials verified | | Access | Read access to user's Health State + CDS views | | Capabilities | Document visits, validate assessments, e-prescribe | | Use case | Continuity of care, complex cases, established relationships |
4.3 Provider Licensing Requirements
- Partner Network: Partner API is responsible for ensuring physicians are licensed in the patient's state.
- BYOD Network: System verifies the physician holds an active license in the state where the patient is located at time of service.
5) Clinical Decision Support (CDS) #cds
The CDS surfaces existing system intelligence to physicians, enabling informed decision-making.
5.1 CDS Components
| Component | What it shows | | :--- | :--- | | Health State Summary | Current vitals, labs, wearable data, adherence metrics | | Assessment Engine Output | Best explanation, what can't be ruled out, suggested next tests | | Protocol Status | Current program, stalls detected, bottleneck hypotheses | | Medication Reconciliation | Active medications, interactions, adherence tracking |
5.2 CDS Principle
CDS is decision support, not decision making. The physician always makes the final clinical decision. This framing is critical for FDA regulatory posture (avoiding Software as a Medical Device classification for autonomous decision-making).
5.3 CDS Integration Points
- Async visits: Health State summary + Assessment auto-attached to messages
- Sync visits: Live CDS panel displayed alongside video call
- Post-visit: CDS informs prescription decisions and follow-up recommendations
6) Visit Management #visits
6.1 Async Visits
| Feature | Description | | :--- | :--- | | Channel | Secure messaging (HIPAA-compliant) | | Scheduling | On-demand or scheduled response windows | | Documentation | Threaded conversation + structured intake forms | | CDS Integration | Health State summary auto-attached to initial message |
6.2 Sync Visits
| Feature | Description | | :--- | :--- | | Channel | Video/voice (WebRTC or partner infrastructure) | | Scheduling | Calendar booking with availability management | | Documentation | Visit note generation (AI-assisted) | | CDS Integration | Live CDS panel during call |
6.3 Visit Documentation
All visits generate structured documentation:
- Chief complaint and HPI
- Relevant Health State data reviewed
- Assessment and plan
- Prescriptions issued (if any)
- Follow-up recommendations
Documentation is stored as part of the user's Health State and accessible for future visits.
7) Prescription Management #prescriptions
7.1 Jurisdiction-Aware Routing
The system maintains a database of state/country regulations and routes prescriptions accordingly:
| Jurisdiction Type | Routing | | :--- | :--- | | Full prescribe | Direct e-prescribe via Surescripts | | Partner-only | Route through partner fulfillment API | | Restricted | Block or require additional verification |
7.2 Routing Logic
Before routing a prescription, the Jurisdiction Router checks:
- Prescriber license status and state
- Patient location at time of service
- Drug schedule (controlled vs non-controlled)
- Telehealth prescribing rules for the jurisdiction
- Ryan Haight Act compliance (in-person exam requirements)
7.3 Prescription Tracking
Once prescribed, medications become part of the Health State:
- Adherence tracking: User logs doses; correlate with outcomes
- Refill management: Surface refill needs and expiration
- Outcome correlation: Feed prescription data back into CDS for future visits
8) Regulatory Considerations #compliance
8.1 HIPAA
When Expanded mode is active, the platform operates as a covered entity or business associate depending on structure:
- All partners must sign Business Associate Agreements (BAAs)
- PHI handling follows HIPAA Security Rule requirements
- Audit logging for all access to clinical data
8.2 State Medical Licensing
- Partner Network: Partner API handles multi-state licensing
- BYOD Network: System verifies physician license in patient's state
- Visit cannot proceed if licensing requirements are not met
8.3 FDA Software as a Medical Device (SaMD)
The CDS is framed as decision support:
- Presents information for physician review
- Does not make autonomous clinical decisions
- Physician always renders final judgment
This positions the system outside FDA's enforcement focus for clinical decision support (per FDA guidance on CDS).
8.4 DEA and Controlled Substances
For controlled substance prescriptions:
- Route through partner with DEA registration
- EPCS (Electronic Prescribing for Controlled Substances) compliance
- Identity proofing requirements for prescribers
8.5 Ryan Haight Act
For controlled substances prescribed via telemedicine:
- Ensure in-person exam requirements are met (either via partner protocol or initial visit requirement)
- Document compliance in visit record
9) Safety Integration
The Clinical Services Layer integrates with the existing safety system (The Shield):
9.1 Red Flag Escalation
If the system detects red-flag symptoms during a clinical visit:
- Immediately surface to the physician
- If no physician available, escalate to 911 guidance
- Never gate safety-critical information behind paywall or appointment availability
9.2 Medication Safety
- Drug interaction checking against current medications in Health State
- Allergy/contraindication alerts surfaced to prescriber
- Dosing guidance (non-binding) from evidence sources
9.3 Audit Trail
All clinical interactions are logged:
- Who accessed what data, when
- Clinical decisions made and rationale
- Prescriptions issued and routing
- User available for compliance review and quality assurance
10) North Star
When a physician joins the loop, they should feel like they have a world-class support team: the Health State gives them complete context, the Assessment Engine gives them hypotheses to validate or refute, and the Protocol Engine shows what's already been tried. They make better decisions faster, and the user gets elite-clinic care without the elite-clinic price.