feat: update hospital management system and fix linter issues
This commit is contained in:
+11
-9
@@ -17,6 +17,7 @@ import { Spinner } from '@/components/ui/spinner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
import type { Indicacion, MovimientoIndicacion } from '@/types';
|
||||
|
||||
function AppContent() {
|
||||
const store = useHospitalStore();
|
||||
@@ -53,7 +54,7 @@ function AppContent() {
|
||||
pacientes={store.pacientes}
|
||||
internaciones={store.internaciones}
|
||||
onActualizarCama={store.actualizarCama}
|
||||
onAgregarCama={store.agregarCama as any}
|
||||
onAgregarCama={store.agregarCama}
|
||||
onEliminarCama={store.eliminarCama}
|
||||
onIniciarInternacion={store.iniciarInternacion}
|
||||
getPacienteById={store.getPacienteById}
|
||||
@@ -85,6 +86,7 @@ function AppContent() {
|
||||
cultivos={store.cultivos}
|
||||
onIniciarInternacion={store.iniciarInternacion}
|
||||
onFinalizarInternacion={store.finalizarInternacion}
|
||||
onEliminarInternacion={store.eliminarInternacion}
|
||||
getPacienteById={store.getPacienteById}
|
||||
getCamaById={store.getCamaById}
|
||||
onVerHC={(id) => { store.setCurrentInternacion(id); store.setVista('historiaclinica'); }}
|
||||
@@ -134,7 +136,6 @@ function AppContent() {
|
||||
case 'historiaclinica': {
|
||||
const internacionId = store.currentInternacionId || '';
|
||||
const internacion = store.getInternacionById(internacionId);
|
||||
const { datosVitales, evoluciones, laboratorios, acidosBase, cultivos, estudios, interconsultas, atb, indicaciones } = store;
|
||||
const paciente = internacion ? store.getPacienteById(internacion.pacienteId) : undefined;
|
||||
if (!internacion || !paciente) {
|
||||
return (
|
||||
@@ -151,11 +152,11 @@ function AppContent() {
|
||||
cama={store.getCamaById(internacion.camaId)}
|
||||
allCamas={store.camas}
|
||||
evoluciones={store.getEvolucionesByInternacion(internacion.id)}
|
||||
laboratorios={store.getLaboratoriosByPaciente(paciente.id)}
|
||||
glucemias={store.getGlucemiasByPaciente(paciente.id)}
|
||||
acidosBase={store.getAcidosBaseByPaciente(paciente.id)}
|
||||
cultivos={store.getCultivosByPaciente(paciente.id)}
|
||||
estudiosComplementarios={store.estudiosComplementarios.filter(e => e.pacienteId === paciente.id)}
|
||||
laboratorios={store.getLaboratoriosByInternacion(internacion.id)}
|
||||
glucemias={store.getGlucemiasByInternacion(internacion.id)}
|
||||
acidosBase={store.getAcidosBaseByInternacion(internacion.id)}
|
||||
cultivos={store.getCultivosByInternacion(internacion.id)}
|
||||
estudiosComplementarios={store.estudiosComplementarios.filter(e => e.internacionId === internacion.id)}
|
||||
interconsultas={(store.interconsultas || []).filter(ic => ic.internacionId === internacion.id)}
|
||||
atb={(store.atb || []).filter(a => a.internacionId === internacion.id)}
|
||||
onAgregarEvolucion={store.agregarEvolucion}
|
||||
@@ -182,12 +183,12 @@ function AppContent() {
|
||||
onAgregarATB={(atb) => store.agregarATB({ ...atb, internacionId: internacion.id })}
|
||||
onActualizarATB={store.actualizarATB}
|
||||
onEliminarATB={store.eliminarATB}
|
||||
indicadores={(Array.isArray(store.indicaciones) ? store.indicaciones : []).filter((i: any) => i.internacionId === internacion.id)}
|
||||
indicadores={(Array.isArray(store.indicaciones) ? store.indicaciones : []).filter((i: Indicacion) => i.internacionId === internacion.id)}
|
||||
movimientos={store.getMovimientosByInternacion ? store.getMovimientosByInternacion(internacion.id) : []}
|
||||
onAgregarIndicacion={(i) => store.agregarIndicacion({ ...i, internacionId: internacion.id })}
|
||||
onActualizarIndicacion={store.actualizarIndicacion}
|
||||
onEliminarIndicacion={store.eliminarIndicacion}
|
||||
onAgregarMovimiento={(m: any) => store.agregarMovimientoIndicacion ? store.agregarMovimientoIndicacion({ ...m, internacionId: internacion.id }) : null}
|
||||
onAgregarMovimiento={(m: MovimientoIndicacion) => store.agregarMovimientoIndicacion ? store.agregarMovimientoIndicacion({ ...m, internacionId: internacion.id }) : null}
|
||||
onActualizarInternacion={store.actualizarInternacion}
|
||||
onActualizarCama={store.actualizarCama}
|
||||
onVolver={() => store.setVista('internaciones')}
|
||||
@@ -212,6 +213,7 @@ function AppContent() {
|
||||
onAgregarCama={store.agregarCama}
|
||||
onVolver={() => store.setVista('internaciones')}
|
||||
getGrupoName={(grupoId) => store.grupos.find(a => a.id === grupoId)?.nombre || ''}
|
||||
internaciones={store.internaciones}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user