Overview
This module allows you to:- Document vital status and age of family members
- Assign pathologies from the catalog using drag-and-drop
- Add custom pathologies not in the catalog
- Track hereditary disease patterns
- Generate family health reports
The system includes built-in validation to prevent assigning sex-specific conditions to incompatible family members (e.g., prostate cancer to female relatives).
Family member structure
The form includes seven predefined family member categories:| Family Member | Spanish Name | Lineage Color |
|---|---|---|
| Mother | Madre | Maternal (pink) |
| Maternal Grandmother | Abuela (Materna) | Maternal (pink) |
| Maternal Grandfather | Abuelo (Materno) | Maternal (pink) |
| Father | Padre | Paternal (blue) |
| Paternal Grandmother | Abuela (Paterna) | Paternal (blue) |
| Paternal Grandfather | Abuelo (Paterno) | Paternal (blue) |
| Siblings | Hermanos | Neutral (orange) |
Visual color coding helps quickly identify maternal vs. paternal lineage when reviewing family history.
Drag-and-drop interface
Pathologies available section
At the top of the form, all active pathologies from your catalog are displayed as draggable tags. Each pathology shows:- Grip icon (⋮⋮) indicating it can be dragged
- Pathology name
- Count badge showing total available pathologies
- Settings icon linking to the pathology catalog
Assigning pathologies
Drag to family member
Drag the pathology over the desired family member’s row. The row will highlight with a blue background.
Drop to assign
Release the mouse to drop the pathology. It appears in the family member’s pathology column.
Sex-based validation
The system automatically validates pathology assignments: Female family members (Madre, Abuela Materna, Abuela Paterna):- Cannot receive male-specific pathologies
- Error message: “La patología ‘[name]’ es específica de sexo Masculino y no puede ser asignada a [member].”
- Cannot receive female-specific pathologies
- Error message: “La patología ‘[name]’ es específica de sexo Femenino y no puede ser asignada a [member].”
- Can receive any pathology since the group can be mixed gender
Family member fields
For each family member, you can document:Vital status (Estado Vital)
Dropdown options:- Vivo/Viva (Alive)
- Fallecido/Fallecida (Deceased)
- Desconocido (Unknown)
Age (Edad)
Numeric field for:- Current age (if alive)
- Age at death (if deceased)
Pathologies (Patologías)
A drag-and-drop zone that:- Shows placeholder text: “Arrastre patologías aquí”
- Highlights blue when dragging over: “Suelte aquí la patología”
- Displays assigned pathologies as removable tags
- Prevents duplicate pathology assignments
Observations (Observaciones)
Free-text area for:- Additional context about conditions
- Family member’s medical history notes
- Age at diagnosis
- Disease progression details
Pathology catalog integration
The module uses React Query for efficient data loading:Managing the catalog
Click the Settings icon (⚙️) next to “Patologías Disponibles” to:- Navigate to Settings → Pathology Catalog
- Add new pathologies with sex classification
- Activate/deactivate pathologies
- Edit existing entries
Changes to the pathology catalog are immediately reflected in the family history interface.
Drag-and-drop implementation
The module uses @dnd-kit library for smooth drag-and-drop:Mouse and touch support
- MouseSensor: Requires 8px movement before drag starts (prevents accidental drags)
- TouchSensor: 200ms delay with 5px tolerance (optimized for mobile)
Visual feedback
- DragOverlay: Shows semi-transparent pathology tag while dragging
- Drop zone highlight: Blue background with ring border
- Cursor changes: From grab (⊕) to grabbing (⊙) during drag
Data structure
Each family member record contains:Saving the family history
Click Guardar (Save) to:- Save all family member data in one operation
- Create or update records for each family member
- Only save members with relevant data (vital status or pathologies)
Generate report
Click “Ver Informe” (View Report) to open a modal with:- Complete family health history
- Organized by family member
- Pathologies listed for each relative
- Print-friendly format
- Patient identification header
Instructions panel
The form includes a helpful instructions section:- Arrastre desde “Patologías Disponibles” al familiar correspondiente
- Al soltarlas, se asignarán automáticamente
- Complete estado vital, edad y observaciones de cada familiar
- Presione “Guardar” para confirmar cambios
Identifying hereditary patterns
Common hereditary conditions
Look for patterns across generations: Cancer syndromes:- Breast cancer in multiple female relatives (BRCA genes)
- Colon cancer in multiple generations (Lynch syndrome)
- Multiple cancer types in family (Li-Fraumeni)
- Early heart attacks (<55 men, <65 women)
- Familial hypercholesterolemia
- Hypertension across generations
- Diabetes Type 2 in multiple relatives
- Thyroid disease patterns
- Obesity across family
- Depression, anxiety, bipolar disorder
- Alzheimer’s and dementia
- Schizophrenia
Red flags for genetic counseling
Red flags for genetic counseling
Consider genetic counseling referral when:
- Multiple first-degree relatives with same cancer
- Cancer at unusually young age (<50)
- Same person with multiple primary cancers
- Bilateral cancer (e.g., both breasts)
- Rare cancers (e.g., male breast cancer)
- Pattern suggesting autosomal dominant inheritance
Clinical workflow
During patient interview
- Start with first-degree relatives: Parents, siblings
- Ask about vital status: Confirm if alive or deceased
- Document ages: Current age or age at death
- Inquire about diagnoses: Known health conditions
- Note age at diagnosis: Important for risk assessment
- Move to second-degree: Grandparents
- Ask about patterns: Multiple relatives with same condition
Risk assessment
Use family history to:- Identify high-risk patients for screening
- Recommend preventive measures
- Consider genetic testing when appropriate
- Adjust screening schedules (earlier/more frequent)
- Provide patient education about risks
Best practices
Effective data collection
- Use pedigree symbols: Consider drawing a traditional pedigree alongside digital entry
- Verify information: Ask patient to confirm with relatives when uncertain
- Update regularly: Family history changes as relatives age or develop conditions
- Document unknowns: Record when patient doesn’t know family history
Genetic counseling indicators
Source code reference
Implemented in:/workspace/source/src/pages/HeredoFamHistory.tsx(930 lines)- Uses @dnd-kit/core for drag-and-drop functionality
- React Hook Form with Zod validation
- React Query for pathology catalog loading
- DraggablePathologyTag: Individual pathology with drag handle
- DroppableFamilyRow: Family member row accepting drops
- DragOverlay: Visual feedback during drag
api.heredoFamilialHistory.getAllByPatientId()api.heredoFamilialHistory.createOrUpdate()api.patologies.getAllActive()