Fix: Organizacion de Editar Ingreso igual a Nuevo Ingreso, corregido formato de fecha
This commit is contained in:
+40
-2
@@ -8,6 +8,8 @@ import { Evoluciones } from '@/sections/Evoluciones';
|
||||
import { AcidoBaseSection } from '@/sections/AcidoBase';
|
||||
import { Cultivos } from '@/sections/Cultivos';
|
||||
import { HistoriaClinica } from '@/sections/HistoriaClinica';
|
||||
import { NuevoIngreso } from '@/sections/NuevoIngreso';
|
||||
import { EditIngreso } from '@/sections/EditIngreso';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
@@ -77,6 +79,7 @@ function App() {
|
||||
getPacienteById={store.getPacienteById}
|
||||
getCamaById={store.getCamaById}
|
||||
onVerHC={(id) => { store.setCurrentInternacion(id); store.setVista('historiaclinica'); }}
|
||||
onNuevoIngreso={() => store.setVista('nuevoingreso')}
|
||||
/>
|
||||
);
|
||||
case 'evoluciones':
|
||||
@@ -152,12 +155,47 @@ function App() {
|
||||
onActualizarInternacion={store.actualizarInternacion}
|
||||
onActualizarCama={store.actualizarCama}
|
||||
onVolver={() => store.setVista('internaciones')}
|
||||
onEditarIngreso={() => { store.setVista('editaringreso'); }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
case 'nuevoingreso':
|
||||
return (
|
||||
<NuevoIngreso
|
||||
pacientes={store.pacientes}
|
||||
camas={store.camas}
|
||||
areas={store.areas}
|
||||
onIniciarInternacion={store.iniciarInternacion}
|
||||
onVolver={() => store.setVista('internaciones')}
|
||||
getAreaName={(areaId) => store.areas.find(a => a.id === areaId)?.nombre || ''}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
default:
|
||||
case 'editaringreso': {
|
||||
const internacion = store.getInternacionById(store.currentInternacionId || '');
|
||||
const paciente = internacion ? store.getPacienteById(internacion.pacienteId) : undefined;
|
||||
if (!internacion || !paciente) {
|
||||
return (
|
||||
<div className="p-4 text-center">
|
||||
<p className="text-gray-500">Internación no encontrada</p>
|
||||
<Button onClick={() => store.setVista('internaciones')}>Volver a Internaciones</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<EditIngreso
|
||||
internacion={internacion}
|
||||
paciente={paciente}
|
||||
cama={store.getCamaById(internacion.camaId)}
|
||||
pacientes={store.pacientes}
|
||||
camas={store.camas}
|
||||
areas={store.areas}
|
||||
onActualizarInternacion={store.actualizarInternacion}
|
||||
onVolver={() => store.setVista('historiaclinica')}
|
||||
getAreaName={(areaId) => store.areas.find(a => a.id === areaId)?.nombre || ''}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user