Add area assignment to internaciones and permission controls

- Add areaId field to Internacion type and database schema
- Add area selection in NuevoIngreso, EditIngreso, and Internaciones forms
- Filter out 'Fuera de area' from area selection dropdowns
- Add permission controls for users to only edit internaciones in their area
- Add canEdit check to hide 'Editar Ingreso' button in HistoriaClinica
- Fix getInternacionAreaId to use new areaId field first, fallback to cama area
- Add INSERT OR IGNORE to prevent duplicate errors
This commit is contained in:
2026-04-23 17:49:07 -03:00
parent 6611258ce9
commit 56402563fb
9 changed files with 345 additions and 47 deletions
+1
View File
@@ -40,6 +40,7 @@ export interface Internacion {
id: string;
pacienteId: string;
camaId: string;
areaId: string;
fechaIngresoHospital?: string;
fechaIngresoClinica?: string;
fechaEgreso?: string;