Skip to content
Open
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
72 changes: 38 additions & 34 deletions modules/descargas/laboratorio/laboratorio-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@ export class FarmaciaBody extends HTMLComponent {
<div class="rTable header-table">
<div class="rTableRow">
<div class="rTableCell1">
&nbsp;Paciente: <strong>{{ encabezado.data.apellido }} {{ encabezado.data.nombre }}</strong>
<br/>&nbsp;DNI: <strong>{{ encabezado.data.documento }}</strong>
</div>
<div class="rTableCell2">
Fecha Nac.: <strong>{{ encabezado.data.fechanacimiento }}</strong>
</div>
<div class="rTableCell2">
Género: <strong>{{ encabezado.data.sexo }}</strong>
</div>
</div>
<div class="rTableRow">
<div class="rTableCell1">
&nbsp;Laboratorio: <strong>{{ encabezado.data.laboratorio }}</strong>
<br/>&nbsp;Efector solicitante: <strong>{{ encabezado.data.efectorSolicitante }}</strong>
</div>
<div class="rTableCell2">
Orden Nro: <strong>{{ encabezado.data.numero }}</strong>
<br/>Origen: <strong>{{ encabezado.data.origen }}</strong>
</div>
<div class="rTableCell2">
Fecha: <strong>{{ encabezado.data.fecha }}</strong>
<br/>Prioridad: <strong>{{ encabezado.data.prioridad }}</strong>
<span class="header-section-title">DATOS DEL PACIENTE</span>
<strong class="header-patient-name">{{ encabezado.data.apellido }} {{ encabezado.data.nombre }}</strong>
<span class="header-patient-info">{{ encabezado.data.sexo }} | {{#if encabezado.data.edad }}{{ encabezado.data.edad }} años | {{/if}}DNI: {{ encabezado.data.documento }}</span>
</div>
</div>
<div class="rTableRow">
<div class="rTableCell1">
&nbsp;Solicitante: <strong>{{ encabezado.data.solicitante }}</strong>
</div>
<div class="rTableCell2">
Tipo de Servicio: <strong>{{ encabezado.data.tipoServicio }}</strong>
</div>
<div class="rTableCell2">
Muestra: <strong>{{ encabezado.data.tipoMuestra }}</strong>
<div class="rTableCell1" style="width: 100%;">
<span class="header-section-title">DATOS DEL PROTOCOLO / LABORATORIO</span>
<table class="protocolo-table" style="width: 100%; border-collapse: separate; border-spacing: 5px 0; margin-bottom: 4px;">
<tr>
<td style="background-color: #eee; padding: 3px 6px; font-size: .24cm; color: #333; border-radius: 2px; white-space: nowrap;">
PROTOCOLO N°: <strong style="font-size: .30cm; color: #000;">{{ encabezado.data.numero }}</strong>
</td>
<td style="background-color: #eee; padding: 3px 6px; font-size: .24cm; color: #333; border-radius: 2px; white-space: nowrap;">
FECHA: <strong style="font-size: .28cm; color: #000;">{{ encabezado.data.fecha }}</strong>
</td>
<td style="background-color: #eee; padding: 3px 6px; font-size: .24cm; color: #333; border-radius: 2px; white-space: nowrap;">
Prioridad: <strong style="font-size: .26cm; color: #000; text-transform: uppercase;">{{ encabezado.data.prioridad }}</strong>
</td>
<td style="width: 100%;"></td>
</tr>
</table>
<table class="protocolo-details-table" style="width: 100%; border-collapse: collapse; margin-top: 4px;">
<tr>
<td style="width: 60%; vertical-align: top; font-size: .21cm; line-height: 1.35; color: #333;">
Laboratorio: <strong style="color: #000;">{{ encabezado.data.laboratorio }}</strong><br/>
Efector Solicitante: <strong style="color: #000;">{{ encabezado.data.efectorSolicitante }}</strong><br/>
Solicitante: <strong style="color: #000;">{{ encabezado.data.solicitante }}</strong>
</td>
<td style="width: 40%; vertical-align: top; font-size: .21cm; line-height: 1.35; color: #333;">
Origen: <strong style="color: #000;">{{ encabezado.data.origen }}</strong><br/>
Servicio: <strong style="color: #000;">{{ encabezado.data.tipoServicio }}</strong>
</td>
</tr>
</table>
</div>
</div>
<div class="rTableRow">
<div class="rTableCell1">
&nbsp;Prácticas: <strong>{{ encabezado.data.practicas }}</strong>
<span class="header-section-title">PRÁCTICAS</span>
</div>
<div class="rTableCell2"></div>
<div class="rTableCell2"></div>
</div>
</div>
<br/>
Expand Down Expand Up @@ -161,7 +161,11 @@ export class FarmaciaBody extends HTMLComponent {
public async process() {
this.encabezado.data.fecha = moment(this.encabezado.data.fecha).format('DD-MM-YYYY');
this.encabezado.data.fechanacimiento = moment(this.encabezado.data.fechanacimiento || this.encabezado.data.fechaNacimiento).format('DD-MM-YYYY');
this.encabezado.data.sexo = this.paciente[0].genero;
const fechaNac = this.paciente[0]?.fechaNacimiento || this.encabezado.data.fechanacimiento || this.encabezado.data.fechaNacimiento;
if (fechaNac) {
this.encabezado.data.edad = moment().diff(moment(fechaNac), 'years');
}
this.encabezado.data.sexo = this.paciente[0]?.genero || this.encabezado.data.sexo;
if (this.encabezado.data.estado !== 'EnProceso') {
this.encabezado.data.estado = null;
} else {
Expand Down
47 changes: 39 additions & 8 deletions modules/descargas/laboratorio/laboratorio-header.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,55 @@
import { HTMLComponent } from '../model/html-component.class';
import { loadImage } from '../model/informe.class';
import * as configPrivate from '../../../config.private';

export class FarmaciaHeader extends HTMLComponent {

template = `
<div class="contenedor-principal-data">
<div class="contenedor-secundario">
<h5>Resultados de Laboratorio</h5>
<h4>{{ organizacion }}</h4>
</div>
</div>
<hr/>
<section class="contenedor-logos">
<span class="contenedor-logo-efector">
{{#if logos.organizacion}}
<img class="logo-efector" src="data:image/png;base64,{{ logos.organizacion }}">
{{else}}
<b class="no-logo-efector">
{{ organizacion.nombre }}
</b>
{{/if}}
</span>
<span class="contenedor-logos-secundarios">
<img class="logo-adicional" src="data:image/png;base64,{{ logos.adicional }}">
<img class="logo-andes" src="data:image/png;base64,{{ logos.andes }}">
</span>
</section>
`;

constructor(public encabezado) {
super();
}

public async process() {
const organizacion = this.encabezado.data.Efector || this.encabezado.data.Laboratorio;
const provincia = configPrivate.provincia || 'neuquen';

this.data = {
organizacion: this.encabezado.data.Efector || this.encabezado.data.Laboratorio,
organizacion: {
nombre: organizacion?.nombre || organizacion || ''
},
logos: {
organizacion: organizacion ? this.getLogoOrganizacion(organizacion) : '',
adicional: loadImage(`templates/rup/informes/img/logo-adicional-${provincia}.png`),
andes: loadImage('templates/rup/informes/img/logo-andes-h.png'),
},
};
}

getLogoOrganizacion(organizacion) {
try {
const nombre = organizacion.nombre || organizacion;
const nombreLogo = nombre.toLocaleLowerCase().replace(/-|\./g, '').replace(/ {2,}| /g, '-');
const realPath = `templates/rup/informes/img/efectores/${nombreLogo}.png`;
return loadImage(realPath);
} catch {
return null;
}
}
}
96 changes: 91 additions & 5 deletions templates/laboratorio/laboratorio.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

* {
box-sizing: border-box;
}

header, main, section, article, footer {
header,
main,
section,
article,
footer {
display: block;
}

Expand Down Expand Up @@ -92,23 +95,106 @@ hr {
/* HEADER */
/* ========================= */

.contenedor-logos {
display: inline-block;
height: 1cm;
width: 100%;

.contenedor-logo-efector {
margin-top: .05cm;
display: inline-block;
height: 60px;
width: 40%;

.logo-efector {
height: .75cm;
width: auto;
max-width: 7cm;
}

.no-logo-efector {
font-size: .20cm;
}
}

.contenedor-logos-secundarios {
margin-top: .15cm;
float: right;
width: 40%;

.logo-adicional {
filter: grayscale(100%);
-webkit-filter: grayscale(1);
height: .55cm;
width: auto;
}

.logo-andes {
float: right;
height: .55cm;
width: auto;
}
}
}

.header-table {
border: 1px solid #000;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
border-left: none;
border-right: none;
margin-top: 4px;
margin-bottom: 10px;
}

.header-table .rTableRow:not(:last-child) {
border-bottom: 1px solid #000;
border-bottom: 1px solid #ccc;
}

.header-table .rTableCell1,
.header-table .rTableCell2 {
padding: 5px 6px;
padding: 6px 4px;
font-size: .20cm;
text-align: left !important;
}

.header-section-title {
display: block;
margin-bottom: 3px;
color: #888888;
font-size: .22cm;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.header-patient-name {
display: block;
margin-bottom: 2px;
font-size: .36cm;
font-weight: 900;
color: #000;
text-transform: uppercase;
}

.header-patient-info {
display: block;
font-size: .24cm;
color: #222;
}

.protocolo-table {
border-collapse: separate;
border-spacing: 5px 0;
margin-left: -5px;
margin-bottom: 4px;
}

.protocolo-details-table {
width: 100%;
border-collapse: collapse;
margin-top: 4px;
}

.header-table {
page-break-inside: avoid;
}
Expand Down
Loading