Mejoras de diseño responsive en Sistema y Configuración, gestor de parser de laboratorio y tipos de cultivo

This commit is contained in:
2026-08-16 22:29:34 +00:00
parent 5b51e4e8eb
commit 770a4ea426
9 changed files with 2132 additions and 441 deletions
+47
View File
@@ -13,6 +13,7 @@ import { initDb,
getAllAcidosBase, createAcidoBase, updateAcidoBase, deleteAcidoBase,
getAllCultivos, createCultivo, updateCultivo, deleteCultivo,
getAllTiposCultivo, createTipoCultivo, updateTipoCultivo, deleteTipoCultivo, restablecerTiposCultivo,
getAllGruposLaboratorio, createGrupoLaboratorio, updateGrupoLaboratorio, deleteGrupoLaboratorio, restablecerGruposLaboratorio,
getAllEstudiosComplementarios, createEstudioComplementario, updateEstudioComplementario, deleteEstudioComplementario,
getAllInterconsultas, createInterconsulta, updateInterconsulta, deleteInterconsulta,
getAllAtb, createAtb, updateAtb, deleteAtb,
@@ -97,6 +98,7 @@ app.get('/api/state', async (req, res) => {
acidosBase: await getAllAcidosBase(),
cultivos: await getAllCultivos(),
tiposCultivo: await getAllTiposCultivo(),
gruposDeterminacionesLab: await getAllGruposLaboratorio(),
estudiosComplementarios: await getAllEstudiosComplementarios(),
interconsultas: (await getAllInterconsultas()).map(ic => ({ ...ic, realizada: !!ic.realizada })),
atb: await getAllAtb(),
@@ -627,6 +629,51 @@ app.post('/api/tipos-cultivo/reset', async (req, res) => {
}
});
// ========== GRUPOS DE DETERMINACIONES DE LABORATORIO ==========
app.get('/api/grupos-laboratorio', async (req, res) => {
try {
res.json(await getAllGruposLaboratorio());
} catch (err) {
res.status(500).json({ error: 'Error al obtener grupos de determinaciones de laboratorio' });
}
});
app.post('/api/grupos-laboratorio', async (req, res) => {
try {
const nuevo = await createGrupoLaboratorio(req.body);
res.json(nuevo);
} catch (err) {
res.status(400).json({ error: err.message || 'Error al crear grupo de determinaciones' });
}
});
app.put('/api/grupos-laboratorio/:id', async (req, res) => {
try {
const updated = await updateGrupoLaboratorio(req.params.id, req.body);
res.json(updated);
} catch (err) {
res.status(400).json({ error: err.message || 'Error al actualizar grupo de determinaciones' });
}
});
app.delete('/api/grupos-laboratorio/:id', async (req, res) => {
try {
await deleteGrupoLaboratorio(req.params.id);
res.json({ ok: true });
} catch (err) {
res.status(500).json({ error: 'Error al eliminar grupo de determinaciones' });
}
});
app.post('/api/grupos-laboratorio/reset', async (req, res) => {
try {
const list = await restablecerGruposLaboratorio();
res.json(list);
} catch (err) {
res.status(500).json({ error: 'Error al restablecer grupos de determinaciones' });
}
});
// ========== ESTUDIOS COMPLEMENTARIOS ==========
app.get('/api/estudios-complementarios', async (req, res) => {
try {