Overview
DoctorSoft+ provides specialized form components for managing patient information, scheduling appointments, and recording vital signs. All forms include validation, loading states, and theme integration.PatientForm
Comprehensive form for creating and editing patient records with three tabbed sections: basic info, complementary data, and personal details.Props
Callback fired when patient is successfully saved, receives the created/updated patient object
Callback fired when user cancels the form
Existing patient data for edit mode. When provided, form switches to edit mode with confirmation dialog
Usage
Form structure
The form is organized into three tabs:Básicos tab
Required patient identification and contact information:- Nombre (required)
- Apellido Paterno (required)
- Apellido Materno
- Fecha de Nacimiento (required)
- Sexo (required) - “Masculino” or “Femenino”
- Teléfono
- Tipo de Sangre - A+, A-, B+, B-, AB+, AB-, O+, O-
- Refiere - referring physician name
- Alergias - comma-separated list
- Observaciones - notes for physicians
Complementarios tab
Address and additional identification:- CURP (18 characters max)
- RFC
- Estado Civil - Soltero, Casado, Viudo, Divorciado, Unión Libre
- Código Postal (with lookup integration)
- Calle y número
- Colonia (auto-populated from postal code)
- Población
- Municipio
- Entidad Federativa
- Contacto de Emergencia
Personales tab
Demographic and insurance information:- Ocupación
- Aseguradora (dropdown of active insurances)
- Tipo de Paciente - Particular, Aseguradora, Empresa
- Estado de Nacimiento (federal entities dropdown)
- Nacionalidad (autocomplete)
- Religión
- Lengua Indígena
- Grupo Étnico
- Discapacidad
- Responsable
Features
Postal code lookup Integrated with PostalCodeLookup component to automatically populate:- Asentamiento type
- Colonia
- Municipio
- Entidad Federativa
- Población
get_idbu RPC function.
Responsive design
Fixed bottom action buttons on mobile, relative positioning on desktop.
AppointmentForm
Visual calendar-based form for scheduling and rescheduling patient appointments.Props
Callback fired when appointment is successfully saved
Callback fired when user cancels the form
Existing appointment data for edit mode. Includes nested patient object
Usage
Configuration
Appointment scheduling constants (~/workspace/source/src/components/AppointmentForm.tsx:32-36):Form fields
Selected appointment date from visual calendar
Selected time slot in HH:MM format
Patient ID from selected patient context
Reason for appointment
Appointment status ID. Available options filtered based on current status and workflow rules
Additional notes (optional)
Features
Visual date selector Week-based calendar grid showing 6 days at a time with navigation:- Previous/next week buttons
- Past dates disabled
- Current selection highlighted
- Month/year display
- Taken slots disabled (grayed out)
- Available slots clickable
- Selected time highlighted
- Shows conflict prevention
- Current appointment status
- Allowed state transitions
- User permissions
api.appointments.getFilteredStatusOptions() (~/workspace/source/src/components/AppointmentForm.tsx:88-116)
Conflict detection
Prevents double-booking by checking existing appointments:
- Fetches all appointments on mount
- Excludes current appointment when editing
- Disables time slots already taken
VitalSignRecordForm
Form for recording patient vital signs with validation against normal ranges and critical values.Props
Array of vital sign catalog entries with normal ranges and validation rules
ID of the patient being measured
Patient age in years, used to filter age-appropriate vital signs
Patient biological sex for sex-specific vital signs
Optional appointment ID to link vital sign to specific visit
Async callback to handle form submission
Callback fired when user cancels the form
Initial form values for edit mode
Usage
Form data structure
Catalog filtering
Automatically filters vital sign options based on:- Patient age (in months) vs. catalog edad_minima and edad_maxima
- Patient sex vs. catalog sexo field (“AMBOS”, “M”, or “F”)
Validation levels
Real-time validation displays color-coded status:- Normal
- Abnormal
- Critical
✓ Value within normal range (green)Condition:
valor_minimo_normal ≤ value ≤ valor_maximo_normalFeatures
Reference ranges display When a vital sign is selected, shows info panel with:- Normal range (min-max with units)
- Critical low threshold (if defined)
- Critical high threshold (if defined)
- Recommended measurement method