Skip to content
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
18 changes: 15 additions & 3 deletions src/app/apps/rup/plantillas-rup/plantillas-rup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { take } from 'rxjs/operators';
import { PrestacionesService } from '../../../../app/modules/rup/services/prestaciones.service';
import { Auth } from '@andes/auth';
import { Router } from '@angular/router';
import { ElementosRUPService } from 'src/app/modules/rup/services/elementosRUP.service';
@Component({
selector: 'app-plantillas-rup',
templateUrl: './plantillas-rup.component.html',
Expand Down Expand Up @@ -57,6 +58,7 @@ export class PlantillasRUPComponent implements OnInit {
private sp: PlantillasService,
private snomedService: SnomedService,
public servicioPrestacion: PrestacionesService,
private elementoRupService: ElementosRUPService,
private router: Router,
private auth: Auth
) { }
Expand Down Expand Up @@ -147,17 +149,27 @@ export class PlantillasRUPComponent implements OnInit {
cargarPlantillas(procedimiento) {

this.procedimiento = procedimiento;
const elementoRUP = this.elementoRupService.buscarElemento(this.procedimiento);

if (elementoRUP?.params?.habilitarPlantilla === false) {// null o true no ingresa
this.addItems = [
{
label: 'Enlace externo',
handler: ($event: Event) => {
$event.stopPropagation();
this.agregarPlantilla(this.procedimiento, true);
}
}
];
}
this.subject.next([]);
this.sp.get(procedimiento.conceptId, procedimiento.esSolicitud, true).subscribe(plantillas => {

if (plantillas) {
plantillas.forEach(x => {
if (x.id) {
this.addElementToObservableArray(x);
}
});
} else {
// this.addElementToObservableArray({});
}
});
}
Expand Down
7 changes: 5 additions & 2 deletions src/app/modules/rup/components/elementos/valorNumerico.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form #form="ngForm">
<div class="row flex-column">
<div class="col-12">
<ng-container *ngIf="!soloValores; else showSoloValores">
<ng-container *ngIf="!soloValores && params; else showSoloValores">
<plex-int [label]="params.title ? params.title : registro.concepto.term" name="intValue"
*ngIf="params.numericType === 'integer'" [(ngModel)]="registro.valor"
[suffix]="params.unit ? params.unit : '' " [min]="params.min" [max]="params.max"
Expand All @@ -24,7 +24,10 @@
<ng-template #showTerm>
<label class="text-capitalize">{{ registro.concepto.term }}</label>
</ng-template>
{{registro.valor}} {{params.unit}}
<div *ngIf="params">
{{registro.valor}} {{params.unit}}
</div>

</ng-template>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/rup/services/elementosRUP.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class ElementosRUPService {
* @returns {IElementoRUP} Elemento que implementa el concepto
* @memberof ElementosRUPService
*/
buscarElemento(concepto: ISnomedConcept, esSolicitud: boolean, esIndicacion?: boolean): IElementoRUP {
buscarElemento(concepto: ISnomedConcept, esSolicitud?: boolean, esIndicacion?: boolean): IElementoRUP {
// Busca el elemento RUP que implemente el concepto
if (typeof concepto.conceptId === 'undefined') {
concepto = concepto[1];
Expand Down