Fix: Organizacion de Editar Ingreso igual a Nuevo Ingreso, corregido formato de fecha

This commit is contained in:
2026-04-14 00:04:40 -03:00
parent 88bfefc782
commit d43163590c
11 changed files with 708 additions and 30 deletions
+7 -4
View File
@@ -47,7 +47,8 @@ db.exec(`
id TEXT PRIMARY KEY,
pacienteId TEXT NOT NULL,
camaId TEXT,
fechaIngreso TEXT NOT NULL,
fechaIngresoHospital TEXT,
fechaIngresoClinica TEXT,
fechaEgreso TEXT,
diagnosticoIngreso TEXT,
motivoConsulta TEXT,
@@ -56,7 +57,9 @@ db.exec(`
diagnosticoEgreso TEXT,
medicoIngresante TEXT,
motivoEgreso TEXT,
activa INTEGER DEFAULT 1
activa INTEGER DEFAULT 1,
apache TEXT,
derivacion TEXT
);
CREATE TABLE IF NOT EXISTS evoluciones (
@@ -200,9 +203,9 @@ app.put('/api/state', (req, res) => {
}
if (state.internaciones?.length) {
const stmt = db.prepare('INSERT INTO internaciones (id, pacienteId, camaId, fechaIngreso, fechaEgreso, diagnosticoIngreso, motivoConsulta, enfermedadActual, antecedentesEnfermedadActual, diagnosticoEgreso, medicoIngresante, motivoEgreso, activa) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
const stmt = db.prepare('INSERT INTO internaciones (id, pacienteId, camaId, fechaIngresoHospital, fechaIngresoClinica, fechaEgreso, diagnosticoIngreso, motivoConsulta, enfermedadActual, antecedentesEnfermedadActual, diagnosticoEgreso, medicoIngresante, motivoEgreso, activa, apache, derivacion) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
for (const i of state.internaciones) {
stmt.run(i.id, i.pacienteId, i.camaId, i.fechaIngreso, i.fechaEgreso || null, i.diagnosticoIngreso || null, i.motivoConsulta || null, i.enfermedadActual || null, i.antecedentesEnfermedadActual || null, i.diagnosticoEgreso || null, i.medicoIngresante || null, i.motivoEgreso || null, i.activa ? 1 : 0);
stmt.run(i.id, i.pacienteId, i.camaId, i.fechaIngresoHospital || null, i.fechaIngresoClinica || null, i.fechaEgreso || null, i.diagnosticoIngreso || null, i.motivoConsulta || null, i.enfermedadActual || null, i.antecedentesEnfermedadActual || null, i.diagnosticoEgreso || null, i.medicoIngresante || null, i.motivoEgreso || null, i.activa ? 1 : 0, i.apache || null, i.derivacion || null);
}
}