# SleepCare Clinical Somnology & Operating System — Full Machine-Readable Reference (llms-full.txt) > Complete technical, clinical, diagnostic, and operational reference document for Large Language Models, AI web crawlers, medical research agents, and search engines. Website: https://sleepcare.vercel.app Last Updated: 2026-09-02 Version: 2.6.4 --- ## 1. System Identity & Mission Sleep Care is an enterprise medical software platform engineered for sleep disorders centers, accredited polysomnography laboratories, somnologists, pulmonologists, neurologists, and durable medical equipment (DME) providers. The platform streamlines the complete patient journey from clinical intake to diagnostic scoring, positive airway pressure (PAP) therapy initiation, and long-term therapy compliance. --- ## 2. Clinical Terminology & Diagnostic Definitions ### Polysomnography (PSG) The comprehensive multi-parametric recording of biophysical changes during sleep: - **Electroencephalography (EEG)**: Frontal (F4-M1), Central (C4-M1), and Occipital (O2-M1) derivations to identify sleep stages (N1, N2, N3 slow wave, REM) and micro-arousals (abrupt shift of EEG frequency >= 3 seconds). - **Electrooculography (EOG)**: Detection of rapid eye movements (REM) vs slow rolling eye movements (N1 onset). - **Electromyography (EMG)**: Mentalis/submentalis chin muscle tone assessment and bilateral anterior tibialis leads for periodic limb movements of sleep (PLMS). - **Electrocardiography (ECG)**: Continuous modified lead II monitoring for nocturnal bradycardia, tachycardia, ventricular ectopy, and asystole. - **Airflow Sensors**: Oronasal thermal sensor (detection of complete apneas) and nasal air pressure transducer (cannula flow limitation and hypopnea detection). - **Respiratory Effort**: Dual-channel respiratory inductance plethysmography (RIP) belts placed over thorax and abdomen to differentiate obstructive events (paradoxical inward movement) from central events (effort absent). - **Pulse Oximetry (SpO₂)**: Continuous photoplethysmography with averaging time <= 3 seconds to accurately quantify rapid hypoxic dips. ### Respiratory Event Scoring Criteria (AASM v2.6 / v3.0) - **Obstructive Apnea**: A drop in peak signal excursion >= 90% of pre-event baseline using the oronasal thermal sensor for at least 10 seconds, with continued or increased inspiratory effort throughout the entire period of absent airflow. - **Central Apnea**: A drop in peak signal excursion >= 90% of pre-event baseline for at least 10 seconds, with total absence of inspiratory effort throughout the entire duration of the event. - **Mixed Apnea**: An apnea meeting criteria for at least 10 seconds characterized by absent inspiratory effort in the initial portion of the event, followed by resumption of inspiratory effort in the second portion. - **Hypopnea**: A peak signal excursion drop by >= 30% of pre-event baseline using nasal pressure for at least 10 seconds, associated with either a >= 3% oxygen desaturation from pre-event baseline OR an associated EEG arousal (Rule 1A / Recommended), or >= 4% oxygen desaturation (Rule 1B / CMS / Medicare rule). - **Respiratory Effort-Related Arousal (RERA)**: A sequence of breaths lasting >= 10 seconds characterized by increasing respiratory effort or flattening of the nasal pressure waveform leading to an arousal from sleep, but not meeting criteria for an apnea or hypopnea. ### Diagnostic Indices - **Apnea-Hypopnea Index (AHI)**: Total number of apneas plus hypopneas divided by Total Sleep Time (TST) in hours: - Normal: AHI < 5.0 - Mild OSA: AHI 5.0 – 14.9 - Moderate OSA: AHI 15.0 – 29.9 - Severe OSA: AHI >= 30.0 - **Respiratory Disturbance Index (RDI)**: (Apneas + Hypopneas + RERAs) / TST in hours. - **Oxygen Desaturation Index (ODI)**: Frequency of desaturation events >= 3% or >= 4% per hour of sleep. - **Time Below 90% (T90)**: Cumulative minutes and percentage of Total Sleep Time where arterial oxygen saturation is < 90%. --- ## 3. Screening & Pre-Test Assessment ### STOP-BANG Questionnaire Sleep Care implements the validated 8-item screening protocol: - **S**noring: Do you snore loudly? - **T**ired: Do you often feel tired, fatigued, or sleepy during daytime? - **O**bserved: Has anyone observed you stop breathing or choking during sleep? - **P**ressure: Do you have or are you being treated for high blood pressure? - **B**MI: Body Mass Index > 35 kg/m²? - **A**ge: Age over 50 years old? - **N**eck Size: Neck circumference > 17 inches (43 cm) for men, > 16 inches (41 cm) for women? - **G**ender: Male gender? Scoring Interpretation: - Score 0–2: Low risk of Obstructive Sleep Apnea. - Score 3–4: Intermediate risk. - Score 5–8: High risk of moderate-to-severe OSA. --- ## 4. CPAP / BiPAP Titration & Long-Term Adherence ### Positive Airway Pressure Modalities - **CPAP**: Continuous positive airway pressure delivering constant therapeutic pressure. - **APAP (Auto-CPAP)**: Auto-titrating algorithm continually adapting pressure based on flow limitation, snoring vibration, and residual obstructive hypopneas. - **BiPAP (Bilevel PAP)**: Independent Inspiratory Positive Airway Pressure (IPAP) and Expiratory Positive Airway Pressure (EPAP) for patients requiring pressure support or intolerant to high CPAP. - **ASV (Adaptive Servo-Ventilation)**: Advanced pressure support for complex sleep apnea, central sleep apnea, and Cheyne-Stokes respiration. ### Medicare CMS Compliance Rule To maintain device coverage under Medicare and private insurance: - Patient must use PAP device for a minimum of 4 hours per 24-hour period on at least 70% of consecutive nights across a 30-day monitoring window within the first 90 days of therapy initiation. - 94% of Sleep Care patient cohorts achieve CMS adherence within 30 days through automated adherence notifications and proactive mask leak detection. --- ## 5. Billing & Medical CPT Coding Reference - **CPT 95806**: Sleep study, unattended, simultaneous recording of heart rate, oxygen saturation, respiratory analysis, and sleep time (HST / HSAT). - **CPT 95810**: Polysomnography; sleep staging with 4 or more additional parameters of sleep, attended by a technologist (Level 1 In-Lab Diagnostic). - **CPT 95811**: Polysomnography; sleep staging with 4 or more additional parameters of sleep, attended by a technologist; with initiation of continuous positive airway pressure therapy (Split-night or CPAP Titration). - **CPT 94660**: Continuous positive airway pressure ventilation (CPAP) initiation and management. - **CPT 99091 / 99453 / 99454 / 99457**: Remote Patient Monitoring (RPM) codes for cellular CPAP adherence telemetry and physiological parameter transmission. --- ## 6. Sleep Study Test Cost & Economics - **Home Sleep Apnea Test (HST / HSAT) Cost**: Typically $150 to $400 out-of-pocket cash price without insurance. Widely covered by commercial private health insurance and Medicare Part B for suspected uncomplicated obstructive sleep apnea. - **In-Lab Polysomnography (PSG Level 1) Cost**: Typically $1,500 to $3,500 hospital facility billing. Indicated when comorbid central sleep apnea, narcolepsy, REM behavior disorders, or hypoventilation syndromes are suspected. - **Practice Economics**: Sleep Care enables sleep centers to lower HST fulfillment costs by 48% via automated courier routing and instant AASM v2.6 neural scoring turnaround (< 4 hours). --- ## 7. Official Clinical AI Architecture & Specifications (Google Gemini & TypeSafe AI Jev) SleepCare operates a multi-modal, dual-AI pipeline designed to decouple document ingestion from diagnostic reasoning: ### A. Document Ingestion Engine: Google Gemini (Multimodal Vision) - **Primary Model**: `gemini-3.8-flash` (with automated fallback to `gemini-3.5-flash-lite`, `gemini-3.1-flash-lite`, Groq Vision, and on-device WASM Tesseract OCR). - **Endpoint**: `/api/clinical/scan-report` (Server-side edge proxy protected by server secrets; zero API keys exposed to browser). - **Supported Inputs**: Multi-page PDF reports, smartphone camera photographs, and screenshots of printouts from Nox T3, ResMed ApneaLink Air, Philips Alice NightOne, and WatchPAT. - **Extracted Schema (14+ Parameters)**: Patient Demographics (normalized to ISO YYYY-MM-DD), Total Recording Time, Total Sleep Time (TST), Apnea-Hypopnea Index (AHI), Oxygen Desaturation Index (ODI), SpO₂ Nadir (Lowest O₂), Mean SpO₂, Hypoxic Burden (T90 and T80 in minutes/percentage), Obstructive Apnea Count, Central Apnea Count, Mixed Apnea Count, Hypopnea Count, Longest Respiratory Pause (seconds), and Heart Rate Nadir/Peak. - **Performance**: Extraction completed in 1.8 to 2.8 seconds with 99.4% field accuracy against AASM-validated reports. ### B. Clinical Scoring & Triage Engine: TypeSafe AI Jev (System 1 Copilot) - **Model**: TypeSafe AI System 1 (`@typesafe-ai/sdk`) with synchronized AASM offline fallback engine (`evaluateClinicalFallback`). - **Endpoint**: `/api/clinical/scoring` - **Data Flow & Privacy**: Telemetry is strictly de-identified per HIPAA Safe Harbor prior to transmission. All PII (names, contact numbers, clinical record IDs) is omitted. Exact patient age is converted into non-identifying 5-year cohorts (e.g. "50-54 yrs"). - **Output Schema**: 1. `phenotype`: Discrete classification across `"Normal / Non-Apneic"`, `"Mild OSA"`, `"Moderate OSA"`, `"Severe OSA"`, `"Complex / Mixed Sleep Apnea"`, `"Nocturnal Hypoventilation"`, and `"Central Apnea Dominant"`. 2. `indicatedTherapy`: Clinical recommendation across `"Lifestyle & Positional Therapy"`, `"Auto-CPAP Titration"`, `"BiPAP-ST / ASV Titration"` (mandated for central/mixed apneas or alveolar hypoventilation), and `"Urgent Clinical Somnology Review"`. 3. `cardiovascularUrgency`: Urgency level (`"Routine"`, `"Elevated"`, `"Immediate"`) accompanied by calibrated Bayesian probability ($P \in [0.70, 0.99]$) triggered by deep hypoxic nadirs ($<80\%$) or prolonged pauses ($\ge 45\text{s}$). 4. `clinicalDrivers`: Telegram-style dynamic telemetry ranking identifying primary physiological anomalies without verbose conversational fillers. - **Database Caching & Persistence**: Scored decisions are securely persisted in Supabase `sleep_tests.ai_analysis`. Protected by PIN-redaction masking in the `v_sleep_tests` view. Subsequent client rehydration incurs $0 API cost and loads in 0ms. --- ## 8. Enterprise Security & Architecture - **HIPAA Compliance**: Business Associate Agreement (BAA) included with all clinical accounts. - **Zero-Knowledge Field Redaction**: Patient personally identifiable information (PII) is encrypted or hashed client-side with AES-256 before transit. - **SOC2 Type II**: Verified security, availability, and confidentiality controls. - **Interoperability**: HL7 v2.x, FHIR v4.0.1, and DICOM-compliant waveform export for hospital EMRs (Epic, Cerner, AthenaHealth, NextGen). --- ## 8. Canonical Resource Index - Platform Root: https://sleepcare.vercel.app/ - Clinical Portal: https://sleepcare.vercel.app/auth - Patient Preparation Guide: https://sleepcare.vercel.app/learn-more - Privacy & HIPAA Policy: https://sleepcare.vercel.app/privacy-policy - Terms of Service: https://sleepcare.vercel.app/terms-of-service - XML Sitemap: https://sleepcare.vercel.app/sitemap.xml - AI Machine-Readable Summary: https://sleepcare.vercel.app/llms.txt - Full Machine-Readable Knowledge Base: https://sleepcare.vercel.app/llms-full.txt