Add motivo field to interconsultas with dark mode badges
This commit is contained in:
+8
-2
@@ -167,6 +167,7 @@ try {
|
||||
internacionId TEXT NOT NULL,
|
||||
fecha TEXT,
|
||||
servicioInterconsultado TEXT,
|
||||
motivo TEXT,
|
||||
respuestaInterconsulta TEXT,
|
||||
respuestaFecha TEXT
|
||||
)
|
||||
@@ -178,6 +179,11 @@ try {
|
||||
} catch (e) {
|
||||
// Column already exists
|
||||
}
|
||||
try {
|
||||
db.exec("ALTER TABLE interconsultas ADD COLUMN motivo TEXT");
|
||||
} catch (e) {
|
||||
// Column already exists
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Error tabla interconsultas:', e.message);
|
||||
@@ -337,9 +343,9 @@ if (state.laboratorios?.length) {
|
||||
|
||||
run('DELETE FROM interconsultas');
|
||||
if (state.interconsultas?.length) {
|
||||
const stmt = db.prepare('INSERT INTO interconsultas (id, pacienteId, internacionId, fecha, servicioInterconsultado, respuestaInterconsulta, respuestaFecha) VALUES (?, ?, ?, ?, ?, ?, ?)');
|
||||
const stmt = db.prepare('INSERT INTO interconsultas (id, pacienteId, internacionId, fecha, servicioInterconsultado, motivo, respuestaInterconsulta, respuestaFecha) VALUES (?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
for (const ic of state.interconsultas) {
|
||||
stmt.run(ic.id, ic.pacienteId, ic.internacionId, ic.fecha, ic.servicioInterconsultado, ic.respuestaInterconsulta || null, ic.respuestaFecha || null);
|
||||
stmt.run(ic.id, ic.pacienteId, ic.internacionId, ic.fecha, ic.servicioInterconsultado, ic.motivo || null, ic.respuestaInterconsulta || null, ic.respuestaFecha || null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user