Skip to content

Commit

Permalink
bug(PER): se actualiza FechaProximoControl
Browse files Browse the repository at this point in the history
  • Loading branch information
maring0019 committed May 8, 2023
1 parent f497c29 commit 665eb6d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions modules/perinatal/controller/carnet-perinatal.events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ EventCore.on('perinatal:control:validacion', async ({ prestacion, registro }) =>
carnetExistente.controles = carnetExistente.controles.sort((a, b) => {
return new Date(a.fechaControl).getTime() - new Date(b.fechaControl).getTime();
});
if (carnetExistente.fechaProximoControl < fechaProximoControl) {
carnetExistente.fechaProximoControl = fechaProximoControl;
}
carnetExistente.fechaProximoControl = fechaProximoControl;
carnetExistente.fechaUltimoControl = carnetExistente.controles[carnetExistente.controles.length - 1].fechaControl;
await CarnetPerinatalCtr.update(carnetExistente.id, carnetExistente, userScheduler as any);

Expand Down Expand Up @@ -144,10 +142,10 @@ export const proximoCtrol = (prestacion) => {
export const cargarDatos = (prestacion) => {
const registros = prestacion.getRegistros(true);
const datos = {
fechaUltimaMenstruacion : registros.find(itemRegistro => itemRegistro.concepto.conceptId === '21840007'),
pesoPrevio : registros.find(itemRegistro => itemRegistro.concepto.conceptId === '248351003'),
talla : registros.find(itemRegistro => itemRegistro.concepto.conceptId === '14456009'),
fechaProbableDeParto : registros.find(itemRegistro => itemRegistro.concepto.conceptId === '161714006'),
fechaUltimaMenstruacion: registros.find(itemRegistro => itemRegistro.concepto.conceptId === '21840007'),
pesoPrevio: registros.find(itemRegistro => itemRegistro.concepto.conceptId === '248351003'),
talla: registros.find(itemRegistro => itemRegistro.concepto.conceptId === '14456009'),
fechaProbableDeParto: registros.find(itemRegistro => itemRegistro.concepto.conceptId === '161714006'),
};
return datos;
};
Expand All @@ -156,9 +154,9 @@ export const obtenerCarnetYdatos = async (registro, prestacion) => {
const embarazo = registro.valor;
let primeriza;
if (embarazo.conceptId === '199719009'
|| embarazo.conceptId === '127364007'
|| embarazo.conceptId === '29399001'
|| embarazo.conceptId === '53881005') {
|| embarazo.conceptId === '127364007'
|| embarazo.conceptId === '29399001'
|| embarazo.conceptId === '53881005') {
primeriza = true;
}
const query = {
Expand Down

0 comments on commit 665eb6d

Please sign in to comment.