Tratamiento Prolongado
{{recetaPrincipal.medicamento?.tiempoTratamiento?.nombre}} - orden: {{
@@ -80,16 +87,18 @@
Historial de medicamento
-
+
+ icon="adi adi-listado-receta" titulo="No hay elementos registrados">
-
+
|
{{ receta.fechaRegistro | date:'dd/MM/yyyy HH:mm' }}
|
@@ -113,7 +122,8 @@
-
+
|
@@ -123,11 +133,13 @@
0" #panelDispensa>
0">
-
+
@@ -159,21 +171,24 @@
Fecha
-
{{recetaPrincipal.estadoActual.createdAt | date:'dd/MM/yyyy HH:mm'}}
+
{{recetaPrincipal.estadoActual.createdAt | date:'dd/MM/yyyy HH:mm'}}
+
Profesional
{{recetaPrincipal.estadoActual.profesional?.apellido}},
{{recetaPrincipal.estadoActual.profesional?.nombre}}
-
- Sin profesional -
+
- Sin profesional -
+
Motivo
@@ -181,10 +196,11 @@
Observación
-
{{recetaPrincipal.estadoActual.observacion || "- Sin especificar -"}}
+
{{recetaPrincipal.estadoActual.observacion || "- Sin especificar -"}}
+
-
+
\ No newline at end of file
diff --git a/src/app/modules/rup/components/huds/vistaReceta.scss b/src/app/modules/rup/components/huds/vistaReceta.scss
index 295b34fec1..eaf87456af 100644
--- a/src/app/modules/rup/components/huds/vistaReceta.scss
+++ b/src/app/modules/rup/components/huds/vistaReceta.scss
@@ -25,6 +25,12 @@
display: flex;
column-gap: 5px;
align-items: center;
+ width: 100%;
+ }
+
+ .descargar-pdf {
+ margin-left: auto;
+ margin-bottom: 10px;
}
.registros {
@@ -47,6 +53,7 @@
.info-registro {
display: flex;
flex-direction: column;
+ flex-grow: 1;
plex-badge {
margin-bottom: 10px;
diff --git a/src/app/modules/rup/components/huds/vistaReceta.ts b/src/app/modules/rup/components/huds/vistaReceta.ts
index 008d23fb05..37462ab49e 100644
--- a/src/app/modules/rup/components/huds/vistaReceta.ts
+++ b/src/app/modules/rup/components/huds/vistaReceta.ts
@@ -3,6 +3,7 @@ import { IPaciente } from '../../../../core/mpi/interfaces/IPaciente';
import { HUDSService } from '../../services/huds.service';
import { RecetaService } from 'src/app/services/receta.service';
import { OrganizacionService } from 'src/app/services/organizacion.service';
+import { DocumentosService } from 'src/app/services/documentos.service';
import * as moment from 'moment';
@Component({
@@ -99,11 +100,13 @@ export class VistaRecetaComponent implements OnInit {
public recetas;
public recetaPrincipal: any;
public historialRecetas: any[];
+ public requestInProgress = false;
constructor(
public huds: HUDSService,
public recetaService: RecetaService,
- public organizacionesService: OrganizacionService
+ public organizacionesService: OrganizacionService,
+ private documentosService: DocumentosService
) { }
ngOnInit() {
@@ -159,4 +162,24 @@ export class VistaRecetaComponent implements OnInit {
return null;
}
+ descargarPdf() {
+ if (this.recetaPrincipal) {
+ this.requestInProgress = true;
+ const term = this.recetaPrincipal.medicamento?.concepto?.term || 'Receta';
+ const params = {
+ idPrestacion: this.recetaPrincipal.idPrestacion,
+ idRegistro: this.recetaPrincipal.idRegistro
+ };
+ this.documentosService.descargarReceta(params, term).subscribe(
+ () => this.requestInProgress = false,
+ () => this.requestInProgress = false
+ );
+ }
+ }
+
+ verDecargarReceta() {
+ return this.recetaPrincipal?.estadoActual?.tipo === 'vigente' && this.recetaPrincipal?.estadoDispensaActual?.tipo === 'sin-dispensa';
+ }
+
+
}
diff --git a/src/app/services/documentos.service.ts b/src/app/services/documentos.service.ts
index 19160a83b4..5cb3cc9401 100644
--- a/src/app/services/documentos.service.ts
+++ b/src/app/services/documentos.service.ts
@@ -18,6 +18,12 @@ export class DocumentosService {
);
}
+ descargarReceta(params, nombreArchivo: string): Observable {
+ return this.download('pdf', params).pipe(
+ saveAs(nombreArchivo, 'pdf')
+ );
+ }
+
descargarLaboratorio(params, nombreArchivo: string): Observable {
return this.download('laboratorio/pdf', params).pipe(
saveAs(nombreArchivo, 'pdf')