From 43244f24578a6461773b0dfa22c3907b68ae3776 Mon Sep 17 00:00:00 2001 From: Mariano Andres Botta Date: Thu, 1 Oct 2020 12:14:24 -0300 Subject: [PATCH] =?UTF-8?q?feat(rup):=20parametrizar=20repetici=C3=B3n=20d?= =?UTF-8?q?e=20conceptos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rup/interfaces/elementoRUP.interface.ts | 5 +++++ src/app/modules/rup/services/ejecucion.service.ts | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/modules/rup/interfaces/elementoRUP.interface.ts b/src/app/modules/rup/interfaces/elementoRUP.interface.ts index b1807fafac..af56744b4e 100644 --- a/src/app/modules/rup/interfaces/elementoRUP.interface.ts +++ b/src/app/modules/rup/interfaces/elementoRUP.interface.ts @@ -44,6 +44,11 @@ export interface IElementoRUP { frecuentes: ISnomedConcept[]; inactiveAt?: Date; + + /** + * Puede repetirse el concepto mas de una vez en la prestaciĆ³n. + */ + permiteRepetidos?: boolean; } export interface IElementoRUPRequeridos { diff --git a/src/app/modules/rup/services/ejecucion.service.ts b/src/app/modules/rup/services/ejecucion.service.ts index 5a86edda64..f265a5590e 100644 --- a/src/app/modules/rup/services/ejecucion.service.ts +++ b/src/app/modules/rup/services/ejecucion.service.ts @@ -8,6 +8,7 @@ import { PrestacionesService } from './prestaciones.service'; import { switchMap, map, filter } from 'rxjs/operators'; import { IPrestacion } from '../interfaces/prestacion.interface'; import { cache } from '@andes/shared'; +import { ElementosRUPService } from './elementosRUP.service'; @Injectable() @@ -35,7 +36,8 @@ export class RupEjecucionService { constructor( private plex: Plex, - private prestacionService: PrestacionesService + private prestacionService: PrestacionesService, + private elementosRUPService: ElementosRUPService ) { } @@ -75,7 +77,13 @@ export class RupEjecucionService { } chequearRepetido(data: EmitConcepto) { - const { concepto } = data; + const { concepto, esSolicitud } = data; + + const elementoRUP = this.elementosRUPService.buscarElemento(concepto, esSolicitud); + if (elementoRUP.permiteRepetidos) { + return true; + } + const registros = this.getPrestacionRegistro(); const registoExiste = registros.find(registro => registro.concepto.conceptId === concepto.conceptId); if (registoExiste) {