Understanding medical records
A medical record in BarberApp consists of:- Appointment history: All completed appointments for a specific client
- Diagnosis information: Details and notes added by the specialist
- Metadata: Date, time, specialty, and specialist information
- Optional metrics: Height and weight updates (if recorded)
For clients: Viewing your history
Accessing your medical history
Navigate to your history
From your client dashboard, find and click the “Historial de Turnos” (Appointment History) option.
UserMedicalRecordPageComponent (user-record-page.component.ts:33)
What you’ll see
Each appointment entry displays:Service information
- Specialty icon and name
- Example: “Haircut”, “Beard Trim”, etc.
Specialist details
- Specialist’s first and last name
- Who performed the service
Date
- When the appointment took place
- Formatted as localized date
Time
- Time of the appointment
- Formatted as localized time
Viewing diagnosis details
Clicking “Ver Diagnóstico” (View Diagnosis) opens a dialog showing:- Dialog header
- Diagnosis fields
- Title: “Resumen” (Summary)
- Subtitle with full context:
- Specialist who provided the service
- Service type
- Exact date of appointment
- Uses
AppointmentInformDialogComponent - Displays diagnosis details and annotations
- Read-only view for clients
Empty state
If you have no completed appointments:- Message displayed: “No hay entradas en la historia para mostrar.” (No history entries to display)
- The grid remains empty until appointments are completed
For specialists: Adding diagnoses
When to add a diagnosis
Specialists add diagnosis information when completing an appointment. This happens after the appointment service is finished.Click 'Completar Turno'
Click the “Completar Turno” (Complete Appointment) button.Component:
AppointmentActionsComponent (appointment-actions.component.ts:73-90)Diagnosis form fields
The completion dialog (CompleteAppointmentDialogComponent) contains:
Required fields
Detalle general (General details)
- Main diagnosis summary
- Minimum 12 characters
- Maximum 255 characters
- Character counter displayed
- Placeholder: “Completar con el detalle general del resumen.”
Validators.required, Validators.minLength(12) (complete-appointment-dialog.component.ts:59)Optional fields
Otras anotaciones (Other notes)
- Additional observations or notes
- Maximum 145 characters
- Character counter displayed
- Placeholder: “Completar con anotaciones extras.”
- Stored as
undefinedif left empty
Actualizar Altura (Update height)
- Optional height in centimeters
- Range: 100-250 cm
- Used to track client metrics over time
- Stored as
nullif not provided
Actualizar Peso (Update weight)
- Optional weight in kilograms
- Range: 30-250 kg
- Used to track client metrics over time
- Stored as
nullif not provided
- Responsive layout with proper spacing
- Real-time character counting
- Height and weight fields side-by-side
Form validation
The completion form validates: ✅ Submit button enabled when:- Details field has at least 12 characters
- Form is valid
- Details field is empty or too short
- Form has validation errors
Data processing
When the form is submitted (complete-appointment-dialog.component.ts:82-98):- Form values are validated
- Empty optional fields are converted:
- Empty
anotations→undefined - Empty
height→null - Empty
weight→null
- Empty
- Data is emitted to the parent component
- Appointment status changes to “completed”
- Dialog closes with animation
After completion
Once an appointment is marked as completed:- It appears in the client’s medical history
- The diagnosis can be viewed but not edited
- The appointment can no longer be canceled
- Clients can rate the appointment (see Ratings & Reviews)
Viewing client history (specialists)
Specialists can access any client’s complete medical history:Navigate from appointment
From an appointment details page, click “Ver Historia” (View History).Handler:
medicalRecordHandler (appointment-actions.component.ts:145-148)PDF generation
Downloading appointment receipts
Both clients and specialists can download appointment information as PDF.PDF generation uses the jsPDF library (appointment-actions.component.ts:26, package.json:33).
What’s included in the PDF
The generated PDF contains: Header section:- “BarberApp” title (centered, 20pt font)
- “Comprobante de Turno” (Appointment Receipt) subtitle (16pt)
- Generation date and preamble text (10pt)
- Appointment ID
- Client full name
- Specialist full name
- Service/specialty name
- Date (localized format)
- Time (localized format)
- Current status (Pending/Completed/Canceled)
- Notice recommending arrival 15 minutes early
- Reference to BarberApp portal for management
Generating the PDF
PDF is generated
The system:
- Creates a new jsPDF document
- Formats all appointment data
- Applies proper styling and layout
- Generates appointment status labels
PDF formatting
The PDF uses a structured layout:- Page margins: 20 units from left edge
- Line spacing: 10 units between fields
- Text alignment: Centered headers, left-aligned content
- Font sizes: 20pt (title), 16pt (subtitle), 12pt (content), 10pt (notes)
Data loading and states
Loading medical records
When accessing a client’s medical history:- Route parameter extraction: Client ID from URL (user-record-page.component.ts:78)
- Data fetching: Load completed appointments via
appointmentFacade.loadCompletedAppointmentsByClientId() - Minimum display time: 1-second minimum to prevent flickering (user-record-page.component.ts:86-88)
- Loading indicator: Spinner with “Cargando información…” text
Empty vs loading states
- Loading
- Empty
- Shows spinner animation
- Text: “Cargando información…”
- Displayed while data is being fetched
Back navigation
The medical records page includes smart back navigation (user-record-page.component.ts:56-74):- From appointment detail: Returns to “Turno” (Appointment)
- From client list: Returns to “Turno” (Appointment)
- From dashboard: Returns to “Perfil” (Profile)
- Role-specific: Navigates to client or specialist dashboard based on user role
Related topics
- Appointments - Full appointment lifecycle
- Ratings and reviews - How clients rate completed appointments
- Specialist dashboard - How specialists add diagnoses