Corregir migraciones de base de datos

- Agregar DELETE e INSERT para estudiosComplementarios
- Corregir typo: culpable -> sensible en cultivos
- Verificar columna fio2 en acidosbase
This commit is contained in:
2026-04-16 01:33:02 -03:00
parent 0b77297c3d
commit 8999496d24
+2 -1
View File
@@ -217,6 +217,7 @@ app.put('/api/state', (req, res) => {
run('DELETE FROM camas'); run('DELETE FROM camas');
run('DELETE FROM areas'); run('DELETE FROM areas');
run('DELETE FROM pacientes'); run('DELETE FROM pacientes');
run('DELETE FROM estudiosComplementarios');
if (state.pacientes?.length) { if (state.pacientes?.length) {
const stmt = db.prepare('INSERT INTO pacientes (id, apellido, nombre, dni, fechaNacimiento, sexo, telefono, email, direccion, obraSocial, nacionalidad, medicacionHabitual, antecedentes, alergias, grupoSanguineo, historiaClinica) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); const stmt = db.prepare('INSERT INTO pacientes (id, apellido, nombre, dni, fechaNacimiento, sexo, telefono, email, direccion, obraSocial, nacionalidad, medicacionHabitual, antecedentes, alergias, grupoSanguineo, historiaClinica) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
@@ -268,7 +269,7 @@ app.put('/api/state', (req, res) => {
} }
if (state.cultivos?.length) { if (state.cultivos?.length) {
const stmt = db.prepare('INSERT INTO cultivos (id, pacienteId, internacionId, fechaToma, protocolo, tipoMuestra, observaciones, estado, fechaResultado, germen, culpable, resistente) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); const stmt = db.prepare('INSERT INTO cultivos (id, pacienteId, internacionId, fechaToma, protocolo, tipoMuestra, observaciones, estado, fechaResultado, germen, sensible, resistente) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
for (const c of state.cultivos) { for (const c of state.cultivos) {
stmt.run(c.id, c.pacienteId, c.internacionId, c.fechaToma, c.protocolo, c.tipoMuestra, c.observaciones, c.estado, c.fechaResultado, c.germen, c.sensible, c.resistente); stmt.run(c.id, c.pacienteId, c.internacionId, c.fechaToma, c.protocolo, c.tipoMuestra, c.observaciones, c.estado, c.fechaResultado, c.germen, c.sensible, c.resistente);
} }