-
Notifications
You must be signed in to change notification settings - Fork 12
Receta - Implementa job para actualizar estados de dispensa #2056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
89b3d6a to
5bf1280
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En lineas generales muy bien, pero sugiero un par de mejoras
modules/recetas/recetasController.ts
Outdated
| const pacienteId = receta.paciente.id; | ||
| const recetaDisp = await getReceta(Types.ObjectId(receta.id), pacienteId, sistema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Por algun motivo este get falla bastante pasandole el id del paciente como bson. Dejo sugerencia que corrigió todas las ocurrencias:
| const pacienteId = receta.paciente.id; | |
| const recetaDisp = await getReceta(Types.ObjectId(receta.id), pacienteId, sistema); | |
| const pacienteId = receta.paciente.id.toString(); | |
| const recetaDisp = await getReceta(Types.ObjectId(receta.id), Types.ObjectId(pacienteId), sistema); |
jobs/actualizarEstadosDispensa.ts
Outdated
| dispensadas: 0, | ||
| sinDispensa: 0, | ||
| enUso: 0, // Recetas que están en uso y no se pueden actualizar | ||
| errores: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agregaría un contador mas a modo de control: errorConsultandoEstado: 0 para en la linea 45 (cuando no se cumple resultado.success) sumar un else aumentando este contador:
| errores: 0 | |
| if (resultado.success) { | |
| . | |
| . | |
| . | |
| } else { | |
| resultados.errorConsultandoEstado++; | |
| } |
Requerimiento
https://proyectos.andes.gob.ar/browse/HUDS-146
Funcionalidad desarrollada
UserStories llegó a completarse
Requiere actualizaciones en la base de datos
Requiere actualizaciones en otro repositorio