From 989b171227245ce4eabbbbf64e4b864071286241 Mon Sep 17 00:00:00 2001 From: plammel Date: Fri, 18 Dec 2020 14:33:42 -0300 Subject: [PATCH] feat(top): mostrar cantidad solicitudes (#2080) --- .../top/pipes/auditorias-solicitud.pipe.ts | 19 +++++++++++++++++++ .../top/solicitudes/solicitudes.html | 16 ++++++++++++---- src/app/components/top/top.routing.ts | 2 ++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/app/components/top/pipes/auditorias-solicitud.pipe.ts diff --git a/src/app/components/top/pipes/auditorias-solicitud.pipe.ts b/src/app/components/top/pipes/auditorias-solicitud.pipe.ts new file mode 100644 index 0000000000..6781120733 --- /dev/null +++ b/src/app/components/top/pipes/auditorias-solicitud.pipe.ts @@ -0,0 +1,19 @@ +import { Auth } from '@andes/auth'; +import { Pipe, PipeTransform } from '@angular/core'; +import { IPrestacion } from '../../../modules/rup/interfaces/prestacion.interface'; + +@Pipe({ + name: 'auditoriasSolicitud' +}) +export class AuditoriasSolicitudPipe implements PipeTransform { + constructor(private auth: Auth) { } + transform(prestacion: IPrestacion): any { + const accionesAuditorias = [ + 'rechazada', + 'pendiente', + 'referir', + 'devolver' + ]; + return prestacion.solicitud.historial.filter(e => accionesAuditorias.includes(e.accion)).length; + } +} diff --git a/src/app/components/top/solicitudes/solicitudes.html b/src/app/components/top/solicitudes/solicitudes.html index c49034bae6..19df9e770a 100644 --- a/src/app/components/top/solicitudes/solicitudes.html +++ b/src/app/components/top/solicitudes/solicitudes.html @@ -107,10 +107,18 @@ CONTRARREFERIDA - - {{prestacion.estadoActual.tipo}} - + + + + {{prestacion.estadoActual.tipo}} + + + + {{auditorias}} + + + + Turno dado Registro en HUDS diff --git a/src/app/components/top/top.routing.ts b/src/app/components/top/top.routing.ts index 99df2d35ee..1ac39b9d82 100644 --- a/src/app/components/top/top.routing.ts +++ b/src/app/components/top/top.routing.ts @@ -24,6 +24,7 @@ import { DetalleSolicitudComponent } from './solicitudes/detalleSolicitud.compon import { PrestacionSolicitudComponent } from './solicitudes/prestacionSolicitud.component'; import { VisualizacionReglasTopComponent } from './reglas/visualizacionReglasTop.component'; import { EstadoSolicitudPipe } from './pipes/estado-solicitud.pipe'; +import { AuditoriasSolicitudPipe } from './pipes/auditorias-solicitud.pipe'; import { BotonesSolicitudPipe } from './pipes/botones.pipe'; @@ -63,6 +64,7 @@ export const TOP_ROUTES = [ ListaReglasComponent, BusquedaPacienteComponent, EstadoSolicitudPipe, + AuditoriasSolicitudPipe, BotonesSolicitudPipe ] })