diff --git a/server/server.js b/server/server.js index a8d3ef6..ea616de 100644 --- a/server/server.js +++ b/server/server.js @@ -217,6 +217,7 @@ app.put('/api/state', (req, res) => { run('DELETE FROM camas'); run('DELETE FROM areas'); run('DELETE FROM pacientes'); + run('DELETE FROM estudiosComplementarios'); 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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -268,7 +269,7 @@ app.put('/api/state', (req, res) => { } 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) { 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); }