diff --git a/src/app/modules/rup/components/core/rup.component.ts b/src/app/modules/rup/components/core/rup.component.ts
index 471d24bc4b..7b67eec4f4 100644
--- a/src/app/modules/rup/components/core/rup.component.ts
+++ b/src/app/modules/rup/components/core/rup.component.ts
@@ -51,6 +51,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy {
@Input() vistaHUDS = false;
@Input() params: any;
@Input() style: any;
+ @Input() habilitado: any;
public mensaje: any = {};
@@ -100,6 +101,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy {
componentReference.instance['paciente'] = this.paciente;
componentReference.instance['params'] = this.params;
componentReference.instance['style'] = this.style;
+ componentReference.instance['habilitado'] = this.habilitado;
// Event bubbling
componentReference.instance['change'].subscribe(value => {
@@ -283,7 +285,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy {
get isValid() {
if (this.rupInstance) {
- return (!this.rupInstance.formulario || !this.rupInstance.formulario.touched || (!this.rupInstance.formulario.invalid) ) && this.rupInstance.onValidate();
+ return (!this.rupInstance.formulario || !this.rupInstance.formulario.touched || (!this.rupInstance.formulario.invalid)) && this.rupInstance.onValidate();
}
return true;
}
@@ -316,7 +318,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy {
for (let i = 0; i < this.registro.registros.length; i++) {
const concepto = this.registro.registros[i].concepto;
const requerido = requeridos[i];
- const elementoRUP = this.registro.registros[i].elementoRUP ? this.elementosRUPService.getById(this.registro.registros[i].elementoRUP): null;
+ const elementoRUP = this.registro.registros[i].elementoRUP ? this.elementosRUPService.getById(this.registro.registros[i].elementoRUP) : null;
if (requerido && requerido.concepto.conceptId === concepto.conceptId) {
requerido.elementoRUP = elementoRUP || requerido.elementoRUP;
response.push(requerido);
diff --git a/src/app/modules/rup/components/elementos/FormulaBase.component.ts b/src/app/modules/rup/components/elementos/FormulaBase.component.ts
index 9573afbfef..e3833a8e6c 100644
--- a/src/app/modules/rup/components/elementos/FormulaBase.component.ts
+++ b/src/app/modules/rup/components/elementos/FormulaBase.component.ts
@@ -13,6 +13,7 @@ export class FormulaBaseComponent extends RUPComponent implements OnInit {
public formulaProvider: FormulaBaseService;
public resultado;
public hasRules = false;
+ public habilitado = false;
public valorManual: Boolean = false;
ngOnInit() {
@@ -62,7 +63,8 @@ export class FormulaBaseComponent extends RUPComponent implements OnInit {
this.addFact('value', this.registro.valor);
}
- changeValorManual() {
+ changeValorManual(valor) {
+ this.valorManual = valor;
if (this.valorManual) {
this.registro.valorManual = true;
this.registro.registros.map(reg => reg.valor = null);
diff --git a/src/app/modules/rup/components/elementos/FormulaBase.html b/src/app/modules/rup/components/elementos/FormulaBase.html
index 72a8870904..80323ee106 100644
--- a/src/app/modules/rup/components/elementos/FormulaBase.html
+++ b/src/app/modules/rup/components/elementos/FormulaBase.html
@@ -1,45 +1,69 @@
-
+