Skip to content
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

RUP: posibilidad de registrar conceptos repetidos en una prestación #1895

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/app/modules/rup/interfaces/elementoRUP.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 10 additions & 2 deletions src/app/modules/rup/services/ejecucion.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -35,7 +36,8 @@ export class RupEjecucionService {

constructor(
private plex: Plex,
private prestacionService: PrestacionesService
private prestacionService: PrestacionesService,
private elementosRUPService: ElementosRUPService
) {

}
Expand Down Expand Up @@ -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) {
Expand Down