diff --git a/src/app/modules/rup/components/core/_rup.scss b/src/app/modules/rup/components/core/_rup.scss index 3e4b1d1eab..dfc87c3035 100644 --- a/src/app/modules/rup/components/core/_rup.scss +++ b/src/app/modules/rup/components/core/_rup.scss @@ -1,5 +1,10 @@ @import "../variables"; +rup { + display: block; + width: 100%; +} + $rotate: -90deg; .rup-card { @@ -770,4 +775,10 @@ plex-layout [type="invert"] { .readonly span { color: white; } +} + +.hr-grueso { + border: none; + height: 1px; + background-color: #4a4a4a; } \ No newline at end of file diff --git a/src/app/modules/rup/components/core/rup.component.ts b/src/app/modules/rup/components/core/rup.component.ts index 18cc0e04cf..8bfaba43ab 100644 --- a/src/app/modules/rup/components/core/rup.component.ts +++ b/src/app/modules/rup/components/core/rup.component.ts @@ -1,7 +1,7 @@ import { Auth } from '@andes/auth'; import { Plex, PlexVisualizadorService } from '@andes/plex'; import { calcularEdad } from '@andes/shared'; -import { AfterViewInit, Component, ComponentFactoryResolver, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, QueryList, SimpleChanges, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation } from '@angular/core'; +import { AfterViewInit, Component, ComponentFactoryResolver, ComponentRef, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, QueryList, SimpleChanges, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { Engine } from 'json-rules-engine'; @@ -41,11 +41,20 @@ import { InternacionResumenHTTP } from '../../../../apps/rup/mapa-camas/services @Component({ selector: 'rup', encapsulation: ViewEncapsulation.None, - template: '' + template: ` + +
+ {{ params?.titulo || registro?.nombre || elementoRUP?.conceptos[0]?.term }} +
+
+ +
+ ` }) export class RUPComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges { - @ViewChildren(RUPComponent) rupElements: QueryList; + @ViewChildren(RUPComponent) rupElements!: QueryList; @ViewChild('form', { static: false }) formulario: any; + @ViewChild('componentContainer', { read: ViewContainerRef, static: true }) componentContainer!: ViewContainerRef; // Propiedades @Input() elementoRUP: IElementoRUP; @@ -65,6 +74,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges private rulesEngine: Engine; private rulesEvent = new Subject<{ type: string; params: any }>(); private rulesEvent$ = this.rulesEvent.asObservable(); + @Input() public mostrarTituloSubmolecula = null; /** * Determina si un elemento RUP es valido. Se setea apartir de reglas. @@ -96,9 +106,12 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges } // Cargamos el componente - const component = ElementosRUPRegister.get(this.elementoRUP.componente).component; + const component = ElementosRUPRegister.get(this.elementoRUP!.componente)?.component; + if (!component) { + return; + } const componentFactory = this.componentFactoryResolver.resolveComponentFactory(component as any); - const componentReference = this.viewContainerRef.createComponent(componentFactory); + const componentReference: ComponentRef = this.componentContainer.createComponent(componentFactory); // Copia todas las propiedades componentReference.instance['prestacion'] = this.prestacion; @@ -173,8 +186,12 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges ngOnInit() { this.loadComponent(); + if (this.mostrarTituloSubmolecula === null) { + this.mostrarTituloSubmolecula = !!this.params?.mostrarTituloSubmolecula; + } } + ngOnDestroy() { this.onDestroy(); this.onDestroy$.next(null); diff --git a/src/app/modules/rup/components/core/rup.html b/src/app/modules/rup/components/core/rup.html index 17ed995b04..0493f15392 100644 --- a/src/app/modules/rup/components/core/rup.html +++ b/src/app/modules/rup/components/core/rup.html @@ -8,18 +8,29 @@ +
+ {{ params?.titulo || + registro?.nombre || elementoRUP?.conceptos[0]?.term }} +
+ + - - + +
+
+ class="col-{{ (item.params?.mostrarTituloSubmolecula || item.elementoRUP?.requeridos?.length) ? 12 : item.style.columns }} mr-{{ item.style?.offset ? item.style.offset : '0' }}">
+
\ No newline at end of file diff --git a/src/app/modules/rup/components/elementos/consultaDeNinoSanoE2Y3A.html b/src/app/modules/rup/components/elementos/consultaDeNinoSanoE2Y3A.html index d3138accb7..323b40465d 100644 --- a/src/app/modules/rup/components/elementos/consultaDeNinoSanoE2Y3A.html +++ b/src/app/modules/rup/components/elementos/consultaDeNinoSanoE2Y3A.html @@ -1,11 +1,11 @@
- Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ ultimaConsulta.createdBy + Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ + ultimaConsulta.createdBy | nombre }})
-
-
+
+
+
@@ -29,12 +34,17 @@
-
+
+
+
@@ -45,12 +55,17 @@
-
+
+
+
diff --git a/src/app/modules/rup/components/elementos/consultaDeNinoSanoE3Y6A.html b/src/app/modules/rup/components/elementos/consultaDeNinoSanoE3Y6A.html index d3138accb7..323b40465d 100644 --- a/src/app/modules/rup/components/elementos/consultaDeNinoSanoE3Y6A.html +++ b/src/app/modules/rup/components/elementos/consultaDeNinoSanoE3Y6A.html @@ -1,11 +1,11 @@
- Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ ultimaConsulta.createdBy + Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ + ultimaConsulta.createdBy | nombre }})
-
-
+
+
+
@@ -29,12 +34,17 @@
-
+
+
+
@@ -45,12 +55,17 @@
-
+
+
+
diff --git a/src/app/modules/rup/components/elementos/consultaDeNinoSanoM2A.html b/src/app/modules/rup/components/elementos/consultaDeNinoSanoM2A.html index bf7b398098..ec006fd792 100644 --- a/src/app/modules/rup/components/elementos/consultaDeNinoSanoM2A.html +++ b/src/app/modules/rup/components/elementos/consultaDeNinoSanoM2A.html @@ -1,11 +1,11 @@
- Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ ultimaConsulta.createdBy + Registros tomados el {{ (ultimaConsulta.updatedAt || ultimaConsulta.createdAt) | fecha }}, por {{ + ultimaConsulta.createdBy | nombre }}
-
-
+
+
+
@@ -29,12 +34,17 @@
-
+
+
+
@@ -45,12 +55,17 @@
-
+
+
+
diff --git a/src/app/modules/rup/components/elementos/desarrolloPsicomotor.html b/src/app/modules/rup/components/elementos/desarrolloPsicomotor.html index 70d838695e..1c7f3718e7 100644 --- a/src/app/modules/rup/components/elementos/desarrolloPsicomotor.html +++ b/src/app/modules/rup/components/elementos/desarrolloPsicomotor.html @@ -1,12 +1,13 @@ -

- + \ No newline at end of file diff --git a/src/app/modules/rup/components/elementos/lactancia.html b/src/app/modules/rup/components/elementos/lactancia.html index d55be9f6c5..8938052033 100644 --- a/src/app/modules/rup/components/elementos/lactancia.html +++ b/src/app/modules/rup/components/elementos/lactancia.html @@ -1,12 +1,13 @@ - - +

@@ -21,4 +22,4 @@
-

+

\ No newline at end of file diff --git a/src/app/modules/rup/components/elementos/moleculaBase.html b/src/app/modules/rup/components/elementos/moleculaBase.html index e2417ceb81..530474ec04 100644 --- a/src/app/modules/rup/components/elementos/moleculaBase.html +++ b/src/app/modules/rup/components/elementos/moleculaBase.html @@ -45,13 +45,17 @@
+
+ class="col-{{ (item.params?.mostrarTituloSubmolecula || item.elementoRUP?.requeridos?.length) ? 12 : item.style.columns }} mr-{{ item.style?.offset ? item.style.offset : '0' }}">
+