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 Exams API provides endpoints for viewing and registering clinical data including monitoring, psychology, nutrition, pneumology, polysomnography, and medical equipment records. Base Path:/exams/patients/<patient_id>/
All exam endpoints are patient-specific and require a valid
patient_id in the URL path.Patient Clinical History
View Clinical History
patient_clinical in apps/exams/views.py:13
URL Parameters
Patient’s unique identifier
Response Context
Complete patient record
Current active Ingreso entry (filters all exam data)
Most recent followup appointment
List of Monitoreo records, ordered by most recent
List of Psicologia records, ordered by most recent
List of Nutricion records, ordered by most recent
List of Neumologia records, ordered by most recent
List of PolisomnografiaBasal records, ordered by most recent
List of PolisomnografiaTitulacion records, ordered by most recent
List of EquipoMedico records, ordered by most recent
List of SeguimientoAdaptacion records, ordered by most recent
Key Behavior
Fromapps/exams/views.py:23-36:
Monitoring (Monitoreo)
Register Monitoring Data
register_monitoreo in apps/exams/views.py:63
URL Parameters
Patient’s unique identifier
POST Parameters - Technical Monitoring
Submit withbtn_monitoreo button:
Daily usage percentage. Max 5 digits, 2 decimal places.
Days with >4 hours usage. Max 5 digits, 2 decimal places.
Average daily usage hours. Max 5 digits, 2 decimal places.
Basal IAH value (copied from last PSG Basal). Max 5 digits, 2 decimal places.
Residual IAH value. Max 5 digits, 2 decimal places.
Correction percentage: ((Basal - Residual) / Basal) * 100. Max 5 digits, 2 decimal places.
Ventilatory mode. Options:
CPAP, BPAP, BPAP STIPAP pressure setting. Max 5 digits, 2 decimal places.
EPAP pressure setting (for BPAP modes). Max 5 digits, 2 decimal places.
Respiratory rate in breaths per minute (rpm).
Mask type. Options:
PILLOW NASAL, NASAL, ORONASALMask size. Options:
SMALL, MEDIUM, LARGEAverage EtCO2 measurement. Max 5 digits, 2 decimal places.
POST Parameters - Contact Notes
Submit withbtn_contacto button:
Followup/contact observations and notes.
Response
Success (302): Redirects to/exams/patients/<patient_id>/clinical/ with success message
Validation Error (200): Re-displays form with errors, maintains active tab
Basal IAH Pre-fill
Fromapps/exams/views.py:78-80:
hipopnea_basal from the most recent basal polysomnography.
Psychology (Psicología)
Register Psychology Session
register_psicologia in apps/exams/views.py:122
POST Parameters
Beck Depression Inventory score.
Beck Anxiety Inventory score.
Athens Insomnia Scale score.
Response
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsNutrition (Nutrición)
Register Nutrition Session
register_nutricion in apps/exams/views.py:154
POST Parameters
Nutritional status. Options:
DESNUTRICIÓN, EUTRÓFICO, SOBREPESO, OBESIDAD I, OBESIDAD II, OBESIDAD IIICarbohydrate percentage. Max 5 digits, 2 decimal places.
Rumination presence. Options:
SI, NOCaffeine consumption level. Max 5 digits, 2 decimal places.
Response
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsPneumology (Neumología)
Register Pneumology Consultation
register_neumologia in apps/exams/views.py:189
POST Parameters
Consultation date in YYYY-MM-DD format.
Treating physician name. Max 100 characters.
Physician specialty. Max 200 characters.
Response
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsPolysomnography - Basal
Register Basal Polysomnography
register_basal in apps/exams/views.py:218
POST Parameters
Basal PSG date in YYYY-MM-DD format.
Apnea-Hypopnea Index (IAH). Max 5 digits, 2 decimal places.
Apnea severity. Options:
LEVE, MODERADA, NORMAL, GRAVEOxygen Desaturation Index (IDO). Max 5 digits, 2 decimal places.
Sleep efficiency percentage. Max 5 digits, 2 decimal places.
Response
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsUsage in Monitoring
The most recent basal IAH value is automatically used to pre-fill monitoring forms.Polysomnography - Titration
Register Titration Polysomnography
register_titulacion in apps/exams/views.py:247
POST Parameters
Titration type. Options:
CPAP, BPAP, BPAP STTitration date in YYYY-MM-DD format.
Titrated IPAP pressure. Max 5 digits, 2 decimal places.
Titrated EPAP pressure (for BPAP). Max 5 digits, 2 decimal places.
Respiratory rate in breaths per minute (rpm).
Mask size. Options:
SMALL, MEDIUM, LARGEMask type. Options:
PILLOW NASAL, NASAL, ORONASALResponse
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsMedical Equipment
Register Medical Equipment
register_equipo_medico in apps/exams/views.py:277
POST Parameters
Mask type. Options:
PILLOW NASAL, NASAL, ORONASALMask reference/model. Max 100 characters.
Mask size. Options:
SMALL, MEDIUM, LARGEEquipment brand. Options:
BMC, RESMED, PHILIPS RESPIRONICS, SEFAN, RESVENT, CURATIVE, PRISMA, DEVILBISEquipment serial number. Max 100 characters.
Ventilatory mode. Options:
CPAP, BiPAP, BiPAP STResponse
Success (302): Redirects to clinical history with success message Validation Error (200): Re-displays form with errorsCommon Patterns
Automatic Field Assignment
All exam registration endpoints automatically set:Active Ingreso Filtering
All endpoints work exclusively with the patient’s active Ingreso:Success Messages
Fromapps/exams/views.py:96:
Timestamps
All exam models include:Model Structures
Monitoreo Model
Fromapps/exams/models.py:8:
ingreso(ForeignKey) - Links to Ingresoregistrado_por(ForeignKey) - User who registered- Technical metrics (uso_diario, dias_uso_horas_4, horas_uso_diario)
- IAH values (hipopnea_basal, hipopnea_residual, porcentaje_correccion)
- Equipment settings (modo_ventilatorio, presiones, mascara)
created_at(DateTime) - Auto-timestamp
Psicologia Model
Fromapps/exams/models.py:68:
ingreso(ForeignKey)registrado_por(ForeignKey)inventario_depre_beck(Integer)inventario_ansiedad_beck(Integer)escala_atenas(Integer)created_at(DateTime)
Other Exam Models
All exam models follow similar structure:- Foreign key to Ingreso
- Foreign key to User (registrado_por)
- Exam-specific fields
- Automatic created_at timestamp
Related Endpoints
Patients API
View patient demographics and details
Ingresos API
Manage program entries that organize exam data