diff --git a/modules/descargas/laboratorio/laboratorio-body.ts b/modules/descargas/laboratorio/laboratorio-body.ts index 9681457c6f..3bbed4d2da 100644 --- a/modules/descargas/laboratorio/laboratorio-body.ts +++ b/modules/descargas/laboratorio/laboratorio-body.ts @@ -57,7 +57,7 @@ export class FarmaciaBody extends HTMLComponent { `; - constructor(public encabezado, public paciente, public detalle) { + constructor(public encabezado, public paciente, public detalle, public tipoUsuario) { super(); } @@ -71,6 +71,22 @@ export class FarmaciaBody extends HTMLComponent { this.encabezado.data.estado = 'En Proceso'; } + if (this.tipoUsuario === 'paciente-token') { + this.detalle.forEach(d => { + d.grupos.forEach(grupo => { + + grupo.items.forEach(subItem => { + + if (subItem.codificaHiv) { + subItem.resultado = 'Este resultado debe ser entregado personalmente en el establecimiento de salud.'; + subItem.unidadMedida = ''; + subItem.valorReferencia = ''; + } + }); + }); + }); + } + if (this.paciente[0].alias) { this.encabezado.data.nombre = this.paciente[0].alias; } diff --git a/modules/descargas/laboratorio/laboratorio.ts b/modules/descargas/laboratorio/laboratorio.ts index b6b0008474..3aaeaefaba 100644 --- a/modules/descargas/laboratorio/laboratorio.ts +++ b/modules/descargas/laboratorio/laboratorio.ts @@ -4,7 +4,7 @@ import { FarmaciaHeader } from './laboratorio-header'; import { LaboratorioFooter } from './laboratorio-footer'; export class Laboratorio extends InformePDF { - constructor(private encabezado, private detalle, private paciente, private usuario) { + constructor(private encabezado, private detalle, private paciente, private usuario, private tipoUsuario) { super(); } @@ -14,7 +14,7 @@ export class Laboratorio extends InformePDF { public async process() { this.header = new FarmaciaHeader(this.encabezado); - this.body = new FarmaciaBody(this.encabezado, this.paciente, this.detalle); + this.body = new FarmaciaBody(this.encabezado, this.paciente, this.detalle, this.tipoUsuario); this.footer = new LaboratorioFooter(this.usuario); await super.process(); diff --git a/modules/descargas/routes/descargas.ts b/modules/descargas/routes/descargas.ts index a5fc8782fd..203091ad60 100644 --- a/modules/descargas/routes/descargas.ts +++ b/modules/descargas/routes/descargas.ts @@ -182,7 +182,7 @@ router.post('/laboratorio/:tipo?', Auth.authenticate(), async (req: any, res, ne if (!response.length || !paciente) { throw new Error('Error al generar laboratorio.'); } - const docLaboratorio = new Laboratorio(req.body.protocolo, response, paciente, req.body.usuario); + const docLaboratorio = new Laboratorio(req.body.protocolo, response, paciente, req.body.usuario, req.user.type); const opciones = { header: { height: '2cm' } }; const fileName: any = await docLaboratorio.informe(opciones); res.download(fileName); diff --git a/modules/rup/laboratorios.controller.ts b/modules/rup/laboratorios.controller.ts index b965ba8312..44070e7c70 100644 --- a/modules/rup/laboratorios.controller.ts +++ b/modules/rup/laboratorios.controller.ts @@ -14,7 +14,8 @@ function agrupar(elementos) { unidadMedida: e.UnidadMedida || e.unidadMedida, metodo: e.Metodo, valorReferencia: e.valorReferencia, - firma: e.esTitulo === 'True' ? '' : e.userValida + firma: e.esTitulo === 'True' ? '' : e.userValida, + codificaHiv: e.codificaHiv === 'True' ? true : false }); areasStr.forEach(area => {