Skip to content

Commit 3ed39f7

Browse files
committed
RUP - Firma profesional
1 parent eca34b1 commit 3ed39f7

File tree

2 files changed

+65
-16
lines changed

2 files changed

+65
-16
lines changed

modules/descargas/informe-rup/informe-footer.ts

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Profesional } from '../../../core/tm/schemas/profesional';
2+
import { searchMatriculas } from '../../../core/tm/controller/profesional';
13
import { HTMLComponent } from '../model/html-component.class';
24
import { loadImage } from '../model/informe.class';
35
import * as moment from 'moment';
@@ -35,6 +37,9 @@ export class InformeRupFooter extends HTMLComponent {
3537
<h6>
3638
{{ validacion.usuario }}
3739
</h6>
40+
<div class="matriculas-grid">
41+
{{{ validacion.matriculas }}}
42+
</div>
3843
<h6>
3944
{{ validacion.fecha }}hs
4045
</h6>
@@ -49,36 +54,60 @@ export class InformeRupFooter extends HTMLComponent {
4954

5055
constructor(public prestacion, public paciente, public organizacion, public user) {
5156
super();
57+
}
5258

59+
public async process() {
60+
const validacion = await this.getDatosValidacion();
5361

5462
this.data = {
55-
usuario: user.usuario,
63+
usuario: this.user.usuario,
5664
organizacion: {
57-
nombre: organizacion ? organizacion.nombre.replace(' - ', '</br>') : '',
58-
direccion: organizacion ? organizacion.direccion.valor + ', ' + organizacion.direccion.ubicacion.localidad.nombre : ''
65+
nombre: this.organizacion ? this.organizacion.nombre.replace(' - ', '</br>') : '',
66+
direccion: this.organizacion ? this.organizacion.direccion.valor + ', ' + this.organizacion.direccion.ubicacion.localidad.nombre : ''
5967
},
6068
hora: moment().format('DD/MM/YYYY HH:mm'),
6169
logos: {
6270
pdp: loadImage('templates/rup/informes/img/logo-pdp.png'),
6371
},
64-
validacion: this.getDatosValidacion(),
72+
validacion,
6573
numeracionHTML: '<small> {{page}} </small> de <small> {{pages}} </small>',
66-
notaPie: organizacion.configuraciones?.notaAlPie || InformeRupFooter.notaAlPieDefault
74+
notaPie: this.organizacion.configuraciones?.notaAlPie || InformeRupFooter.notaAlPieDefault
6775
};
6876
}
6977

70-
getDatosValidacion() {
78+
async getDatosValidacion() {
7179
const lastState = this.prestacion.estados[this.prestacion.estados.length - 1];
7280
const esValidada = lastState.tipo === 'validada';
81+
let matriculas;
82+
const searchProfesional: any = await Profesional.findOne({ documento: lastState.createdBy.documento });
83+
84+
if (searchProfesional) {
85+
matriculas = await this.getMatriculas(searchProfesional);
86+
}
87+
7388
if (esValidada) {
7489
return {
7590
usuario: lastState.createdBy.nombreCompleto,
76-
fecha: moment(lastState.createdAt).format('DD/MM/YYYY HH:mm')
91+
fecha: moment(lastState.createdAt).format('DD/MM/YYYY HH:mm'),
92+
matriculas
7793
};
7894
}
7995
return null;
8096
}
8197

98+
private async getMatriculas(profesional) {
99+
const infoMatriculas = await searchMatriculas(profesional.id);
100+
101+
const grado = infoMatriculas.formacionGrado.map(e => {
102+
return `${e.nombre} MP ${e.numero}`
103+
});
104+
const posgrado = infoMatriculas.formacionPosgrado.map(e => {
105+
return `${e.nombre} ME ${e.numero}`
106+
});
107+
108+
return [...grado, ...posgrado].join(' - ');
109+
}
110+
82111
static readonly notaAlPieDefault = `El contenido de este informe ha sido validado digitalmente siguiendo los estándares de
83112
calidad y seguridad
84113
requeridos. El ministerio de salud de la provincia de Neuquén es responsable inscripto en el

templates/rup/informes/sass/main.scss

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ main {
246246
font-weight: 400;
247247
}
248248

249-
.nivel-1 p:first-child, .nivel-2 p:first-child, .nivel-3 p:first-child {
249+
.nivel-1 p:first-child,
250+
.nivel-2 p:first-child,
251+
.nivel-3 p:first-child {
250252
text-transform: capitalize;
251253
}
252254

@@ -258,7 +260,7 @@ main {
258260
margin-left: 0em;
259261
}
260262

261-
263+
262264
.nivel-2:not(:first-child) {
263265
margin-left: 1em;
264266
width: 100%;
@@ -275,15 +277,15 @@ main {
275277
}
276278

277279
}
278-
280+
279281
.nivel-3 {
280282
margin-left: 2em;
281283
}
282-
284+
283285
.adjunto {
284286
padding: .2cm 0;
285287
// border-bottom: 1px solid rgba(0, 0, 0, 0.25);
286-
288+
287289
small {
288290
font-size: 0.25cm;
289291
}
@@ -358,7 +360,6 @@ footer {
358360
width: 37%;
359361
display: inline-block;
360362
margin-left: 0.5cm;
361-
text-align: justify;
362363
}
363364

364365
.contenedor-data-pdpCenso {
@@ -369,19 +370,38 @@ footer {
369370
}
370371

371372
.contenedor-data-impresion,
372-
.contenedor-data-validacion,
373373
.contenedor-data-organizacion {
374-
// display: inline-block;
375374
float: right;
376375
max-width: 2.25cm;
377-
margin-left: 0; // text-align: right;
378376
margin-left: 0.25cm;
379377
}
380378

381379
.contenedor-data-organizacion {
382380
text-align: left;
383381
}
384382

383+
.contenedor-data-validacion {
384+
width: 27%;
385+
display: inline-block;
386+
margin-left: 0.25cm;
387+
text-align: justify;
388+
}
389+
390+
.matriculas-grid {
391+
column-count: 2;
392+
column-gap: 4px;
393+
font-size: 9px;
394+
line-height: 1.1;
395+
margin-top: 4px;
396+
}
397+
398+
.matriculas-grid h6,
399+
.matriculas-grid p,
400+
.matriculas-grid span {
401+
margin: 0;
402+
padding: 0;
403+
}
404+
385405
.numeracion {
386406
// display: inline-block;
387407
float: right;

0 commit comments

Comments
 (0)