From 904086f333f632f082eb888fcb26000dbb985737 Mon Sep 17 00:00:00 2001 From: MarianoCampetella Date: Wed, 26 Jun 2024 13:19:30 -0300 Subject: [PATCH] =?UTF-8?q?feat(IN-599):=20Cambiar=20orden=20en=20Registro?= =?UTF-8?q?s=20m=C3=A9dicos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registros-huds-detalle.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/apps/rup/mapa-camas/sidebar/registros-huds-detalle/registros-huds-detalle.component.ts b/src/app/apps/rup/mapa-camas/sidebar/registros-huds-detalle/registros-huds-detalle.component.ts index f39b93e225..4769b2a90f 100644 --- a/src/app/apps/rup/mapa-camas/sidebar/registros-huds-detalle/registros-huds-detalle.component.ts +++ b/src/app/apps/rup/mapa-camas/sidebar/registros-huds-detalle/registros-huds-detalle.component.ts @@ -133,6 +133,11 @@ export class RegistrosHudsDetalleComponent implements OnInit { } else { return fechaValida && noEsInternacion && tipoPrestacionValida && !this.prestacionesEliminadas.some(id => id === registro.id); } + }).sort((pres1, pres2) => { + // Ordenamos las prestaciones junto con los CDAs de forma descendente. + const fechaPrestacion1 = moment(pres1.ejecucion?.fecha || pres1.fecha); + const fechaPrestacion2 = moment(pres2.ejecucion?.fecha || pres2.fecha); + return fechaPrestacion2.diff(fechaPrestacion1); }); }), cache()