Skip to content

Conversation

@JuanIRamirez
Copy link
Contributor

@JuanIRamirez JuanIRamirez commented Dec 18, 2025

Requerimiento

https://proyectos.andes.gob.ar/browse/CIT-395

Funcionalidad desarrollada

  1. En mobileApp/agendasDisponibles y /turnos/routes/agenda.ts, si viene el parámetro teleConsulta, devolver todas las agendas, sino no, devolver solo las otras agendas.
  2. Agregar prestacion Consulta telemédica asincrónica a conceptosTurneables (conceptId: '6421000013106') con el atributo teleConsulta: true
  3. Al esquema de conceptoTurneable agregar atributo: teleConsulta.

UserStories llegó a completarse

  • Si
  • No

Requiere actualizaciones en la base de datos

  • Si
  • No


if (!req.query.teleConsulta) {
const conceptosTurneables: any = await tipoPrestacion.find({ teleConsulta: true });
const conceptId = [];
Copy link
Contributor

@negro89 negro89 Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta parte se podría resolver con un map y quedaría mas legible:

Suggested change
const conceptId = [];
const conceptIdArray = conceptosTurneables?.map(ct => ct.conceptId);
query.where('tipoPrestaciones.conceptId').nin(conceptIdArray);

Sugiero tambien renombrarlo "conceptIdArray" o algo similar, ya que "conceptId" es un atributo propio de todos los conceptos snomed

Copy link
Contributor

@negro89 negro89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Juancho, dejé algunas dudas y/u observaciones. Cualquier cosita consultame 👌🏼

}

query.exec((err, data) => {
await query.exec((err, data) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acá si vamos a awaitear deberíamos eliminar callbacks (una u otra):

Suggested change
await query.exec((err, data) => {
try {
const data = await query.exec();
res.json(data);
} catch (err) {
return next(err);
}

const tipoPrestacion = Auth.getPermissions(req, 'visualizacionInformacion:dashboard:citas:tipoPrestacion:?');
if (tipoPrestacion.length > 0 && tipoPrestacion[0] !== '*') {
permisos.tipoPrestacion = tipoPrestacion;
const tipo_Prestacion = Auth.getPermissions(req, 'visualizacionInformacion:dashboard:citas:tipoPrestacion:?');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por qué el renombre de tipoPrestacion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants