Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diegolozadev/DataMed/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Polysomnography module tracks comprehensive sleep study data for patients with sleep apnea. It consists of two distinct study types:Basal Study
Initial diagnostic polysomnography to assess baseline sleep apnea severity
Titration Study
Pressure titration study to determine optimal CPAP/BiPAP settings
Both study types are linked to the patient’s active admission (
ingreso) to ensure proper data organization across treatment cycles.Basal Polysomnography
Model: PolisomnografiaBasal
The basal study establishes the patient’s baseline sleep apnea metrics before treatment begins.
Location: apps/exams/models.py:184-224
Data Fields
Date when the basal sleep study was conductedForm Label: “Fecha de Estudio Basal”
Apnea-Hypopnea Index (AHI) - The number of apnea and hypopnea events per hour of sleep
- Format: Decimal (5 digits, 2 decimal places)
- Form Label: “Índice de Apneas (IAH)”
- Clinical Significance: Primary diagnostic metric for sleep apnea severity
Clinical severity classification based on AHI scoreAvailable Choices:
NORMAL- Normal (no sleep apnea)LEVE- Mild (AHI 5-15)MODERADA- Moderate (AHI 15-30)GRAVE- Severe (AHI > 30)
Oxygen Desaturation Index (ODI) - Average number of oxygen desaturation events per hour
- Format: Decimal (5 digits, 2 decimal places)
- Form Label: “IDO”
- Clinical Significance: Measures oxygen deprivation during sleep
Sleep Efficiency - Percentage of time in bed actually spent sleeping
- Format: Decimal (5 digits, 2 decimal places)
- Form Label: “Eficiencia(%)”
- Range: 0-100%
Relationships
Links to the patient’s active admission recordRelated Name:
polisomnografias_basalesUser who registered this basal studyRelated Name:
polisomnografias_basales_registradasRegistration Workflow
View:register_basal (apps/exams/views.py:217-242)
Titration Polysomnography
Model: PolisomnografiaTitulacion
The titration study determines the optimal pressure settings and mask configuration for PAP therapy.
Location: apps/exams/models.py:228-289
Data Fields
Date when the titration study was conductedForm Label: “Fecha de Estudio de Titulación”
Type of positive airway pressure therapy titratedAvailable Choices:
CPAP- Continuous Positive Airway PressureBPAP- Bilevel Positive Airway PressureBPAP ST- BiPAP with Spontaneous/Timed backup rate
Inspiratory Positive Airway Pressure - Pressure delivered during inhalation
- Format: Decimal (5 digits, 2 decimal places)
- Unit: cmH₂O
- Form Label: “Presión IPAP en Titulación”
- Clinical Note: For CPAP mode, IPAP = EPAP (single pressure)
Expiratory Positive Airway Pressure - Pressure maintained during exhalation
- Format: Decimal (5 digits, 2 decimal places)
- Unit: cmH₂O
- Form Label: “Presión EPAP en Titulación”
- Optional: Only applicable for BiPAP modes
Respiratory Rate - Breaths per minute for BiPAP ST mode
- Unit: Respirations per minute (rpm)
- Form Label: “Frecuencia Respiratoria”
- Optional: Only applicable for BiPAP ST mode
- Help Text: “Respiraciones por minuto (rpm)“
Mask Configuration
Type of interface mask used during titrationAvailable Choices:
PILLOW NASAL- Nasal pillow (minimalist, inserted into nostrils)NASAL- Nasal mask (covers nose only)ORONASAL- Full face mask (covers nose and mouth)
Size of the mask fitted to the patientAvailable Choices:
SMALL- SmallMEDIUM- MediumLARGE- Large
Relationships
Links to the patient’s active admission recordRelated Name:
polisomnografias_titulacionesUser who registered this titration studyRelated Name:
polisomnografias_titulaciones_registradasRegistration Workflow
View:register_titulacion (apps/exams/views.py:247-272)
Clinical Workflow
Step 1: Basal Study (Diagnostic)
Step 1: Basal Study (Diagnostic)
Purpose: Establish baseline sleep apnea severity
- Conduct overnight polysomnography without treatment
- Record AHI, ODI, and sleep efficiency
- Classify severity (Normal/Mild/Moderate/Severe)
- Determine if PAP therapy is indicated
Step 2: Titration Study (Treatment Planning)
Step 2: Titration Study (Treatment Planning)
Purpose: Determine optimal PAP settings and mask fit
- Trial different pressure levels during sleep
- Test various mask types and sizes for comfort
- Record optimal IPAP/EPAP pressures
- Document respiratory rate for BiPAP ST if needed
Step 3: Equipment Assignment
Step 3: Equipment Assignment
After titration, the determined settings are used to:
- Configure the patient’s home PAP device (see Medical Equipment)
- Provide the appropriately sized mask
- Begin ongoing monitoring (see Monitoring)
Data Retrieval
Accessing Polysomnography Data
View:patient_clinical (apps/exams/views.py:12-58)
All polysomnography data is filtered by the patient’s active admission (
estado='ACTIVO') to ensure data isolation between treatment cycles.Clinical Significance
Apnea-Hypopnea Index (AHI)
The AHI is the gold standard for diagnosing and classifying sleep apnea:| Severity | AHI Range | Clinical Significance |
|---|---|---|
| Normal | < 5 | No sleep apnea |
| Mild | 5-15 | Minimal symptoms, lifestyle modifications may suffice |
| Moderate | 15-30 | Significant symptoms, PAP therapy recommended |
| Severe | > 30 | High cardiovascular risk, immediate PAP therapy required |
Oxygen Desaturation Index (ODI)
Measures how often blood oxygen drops ≥3% or ≥4% per hour:- Correlates with cardiovascular complications
- Higher ODI indicates more severe oxygen deprivation
- Used to assess treatment urgency
Sleep Efficiency
Percentage of time in bed actually spent sleeping:- Normal: 85-95%
- Poor: < 85% (indicates sleep fragmentation)
- Low efficiency suggests frequent awakenings from apnea events
Related Modules
Monitoring
Track treatment effectiveness using basal IAH as reference
Medical Equipment
Assign PAP devices using titration pressure settings
Pulmonology
Specialist consultations for complex cases