The Patients module is the central repository for every person treated at the clinic. Beyond basic demographics, each patient record holds a structured gynecological profile, obstetric history, family and personal antecedents, and the full chain of consultations. The registry is searchable, filterable, and paginated to remain performant regardless of clinic size.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KevxxAlva/femesalud-zen-flow/llms.txt
Use this file to discover all available pages before exploring further.
Patient Status Values
Every patient is assigned one of four lifecycle statuses that appear as colour-coded badges throughout the platform:nuevo
Recently registered patient who has not yet had a completed visit. Default status on creation. Displayed in pink (blush).
activo
Patient with at least one completed visit and no ongoing treatment protocol. Displayed in green (sage).
en_tratamiento
Patient currently under an active treatment plan (e.g., prenatal control, post-procedure follow-up). Displayed in purple (mauve).
alta
Discharged patient — treatment concluded and no follow-up required. Displayed in muted grey. The record is retained in full.
Patient Profile Fields
ThePatient interface maps directly to the patients table in Supabase:
Family History (family_history)
Stored as a JSON object with the following structure:
| Field | Description |
|---|---|
mother | Hereditary or chronic conditions on the maternal side. |
father | Hereditary or chronic conditions on the paternal side. |
siblings | Relevant conditions among siblings. |
children | Relevant conditions among the patient’s children. |
Personal History (personal_history)
| Field | Description |
|---|---|
alcohol | Alcohol consumption pattern. |
drugs | Drug use history. |
tobacco | Smoking history. |
base_pathology | Chronic baseline pathologies (e.g., hypertension, diabetes). |
surgical | Previous surgical procedures. |
allergies | Known allergies — displayed in red on the Clinical Records screen as a safety highlight. |
Gynecological Data (gynecological_data)
| Field | Description |
|---|---|
menarche | Age of first menstruation (years). |
sexarche | Age of first sexual intercourse (years). |
menstrual_cycle | Cycle description (e.g., “28/5 días regular”). |
dysmenorrhea | Painful menstruation: absent, mild, moderate, or severe. |
nps | Number of sexual partners. |
its | History of sexually transmitted infections. |
cytology | Date or result of the most recent Pap smear. |
contraceptives | Current or previous contraceptive method. |
Obstetric Data (obstetric_data)
| Field | Abbreviation | Description |
|---|---|---|
g | G | Total gestations (pregnancies). |
p | P | Vaginal deliveries (partos). |
c | C | Caesarean sections. |
a | A | Abortions / pregnancy losses. |
pig | PIG | Intergenesic period — time between last delivery and current pregnancy. |
fum | FUM | Date of last menstrual period (fecha última menstruación). |
eg | EG | Current gestational age. |
fpp | FPP | Estimated due date (fecha probable de parto). |
em | EM | Molar pregnancies (embarazo molar). |
ee | EE | Ectopic pregnancies (embarazo ectópico). |
vaccines | — | Vaccination history during pregnancy. |
complications | — | Obstetric complications. |
num_consultations | — | Number of prenatal check-ups completed. |
Duplicate Prevention
The system enforces uniqueness on two fields before inserting or updating a patient:document_id(cédula/pasaporte): an exact match query runs against thepatientstable. If a record with the samedocument_idalready exists (differentid), the mutation throws: “Ya existe un paciente con este mismo número de cédula/pasaporte.”full_name(case-insensitive): anilikequery checks for an identical name. If a match is found, the mutation throws: “Ya existe un paciente registrado con este mismo nombre completo.”
INSERT / UPDATE is sent to Supabase, providing immediate user feedback via a toast error.
Pagination and Search
Patient lists throughout the app useusePaginatedPatients, which accepts:
| Parameter | Default | Description |
|---|---|---|
page | 1 | Current page number. |
pageSize | 10 | Records per page (15 in the full Patients list). |
search | undefined | Filters by full_name, email, or document_id using ilike. |
status | undefined | Exact match on status column. |
1 automatically.
The Patients page also provides an Exportar Excel button that downloads the current filtered result set as an .xlsx file using the xlsx library.
Document Exports
From the patient detail panel, four PDF documents can be generated:Ficha Médica
Full patient profile including demographics, gynecological data, obstetric history, and all clinical notes. Exported via
exportFichaMedica.Historia Clínica Completa
Complete clinical record including all consultations and their details. Exported via
exportFullHistory from the Clinical Records module.Constancia de Reposo
Medical rest certificate specifying the number of days, start date, and reason. Exported via
exportReposo.Justificativo
Medical justification letter (e.g., work or school absence). Exported via
exportJustificativo.