From c023384f1fd96bd0b9443d41a1f5350f0239e278 Mon Sep 17 00:00:00 2001 From: Fabio-Ramirez Date: Wed, 19 Aug 2026 17:37:23 -0300 Subject: [PATCH 1/2] =?UTF-8?q?AM=20-=20Agregar=20leyenda=20para=20turnos?= =?UTF-8?q?=20de=20prestaciones=20asincr=C3=B3nicas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mobileApp/routes/turnos.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mobileApp/routes/turnos.ts b/modules/mobileApp/routes/turnos.ts index aaae851f51..4ea2658be7 100644 --- a/modules/mobileApp/routes/turnos.ts +++ b/modules/mobileApp/routes/turnos.ts @@ -124,10 +124,12 @@ router.get('/turnos', async (req: any, res, next) => { turno.duracionTurno = elem.duracionTurno; turno.bloque_id = elem.bloque_id; turno.agenda_estado = elem.agenda_estado; + turno.webexLinks = elem.bloques.turnos.webexLinks; delete turno.updatedBy; delete turno.updatedAt; + /* Busco el turno anterior cuando fue reasignado */ const reasignado = turno.reasignado && turno.reasignado.siguiente; From 17f1a38d8c7d0ccfa1fb04c52bc9d29fd7785cd6 Mon Sep 17 00:00:00 2001 From: Fabio-Ramirez Date: Thu, 20 Aug 2026 12:17:55 -0300 Subject: [PATCH 2/2] Se agrega fix para ver la videollamada y filtro para permitir el turno visible durante su vigencia --- modules/mobileApp/routes/turnos.ts | 20 +++++++++++++++++--- modules/webex/webex.controller.ts | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/mobileApp/routes/turnos.ts b/modules/mobileApp/routes/turnos.ts index 4ea2658be7..0500e1e490 100644 --- a/modules/mobileApp/routes/turnos.ts +++ b/modules/mobileApp/routes/turnos.ts @@ -64,23 +64,37 @@ router.get('/turnos', async (req: any, res, next) => { if (req.query.codificado) { matchTurno['bloques.turnos.diagnosticos.0'] = { $exists: true }; } + const matchTurnoPost = { ...matchTurno }; if (req.query.horaInicio) { - matchTurno['bloques.turnos.horaInicio'] = { $gte: new Date(req.query.horaInicio) }; + matchTurno['horaFin'] = { $gte: new Date(req.query.horaInicio) }; + matchTurnoPost['$expr'] = { + $gte: [ + { + $add: [ + '$bloques.turnos.horaInicio', + { $multiply: ['$bloques.duracionTurno', 60, 1000] } + ] + }, + new Date(req.query.horaInicio) + ] + }; } if (req.query.horaFinal) { - matchTurno['bloques.turnos.horaInicio'] = { $lt: new Date(req.query.horaFinal) }; + matchTurno['horaInicio'] = { $lt: new Date(req.query.horaFinal) }; + matchTurnoPost['bloques.turnos.horaInicio'] = { $lt: new Date(req.query.horaFinal) }; } if (req.query.tiposTurno) { matchTurno['bloques.turnos.tipoTurno'] = { $in: req.query.tiposTurno }; + matchTurnoPost['bloques.turnos.tipoTurno'] = { $in: req.query.tiposTurno }; } pipelineTurno.push({ $match: matchTurno }); pipelineTurno.push({ $unwind: '$bloques' }); pipelineTurno.push({ $unwind: '$bloques.turnos' }); - pipelineTurno.push({ $match: matchTurno }); + pipelineTurno.push({ $match: matchTurnoPost }); pipelineTurno.push({ $group: { _id: { id: '$_id', bloqueId: '$bloques._id' }, diff --git a/modules/webex/webex.controller.ts b/modules/webex/webex.controller.ts index b200987998..192fb250ee 100644 --- a/modules/webex/webex.controller.ts +++ b/modules/webex/webex.controller.ts @@ -6,7 +6,7 @@ const dbgWebex = debug('dbgWebex'); export async function generateWebexLinks(turno: any, agenda: any, usuario: string) { try { const params = { - idTurno: String(turno._id || turno.horaInicio), + idTurno: String(turno._id || turno.horaInicio || turno.horaFin), }; const servicio = services.get('teleconsulta');