From 14cf9437a6a8f9d993754b749be31be6218df1da Mon Sep 17 00:00:00 2001 From: MarianoCampetella Date: Mon, 20 Apr 2026 13:00:53 -0300 Subject: [PATCH] Error en visualizar notificaciones --- .../solicitudes/detalleSolicitud.component.ts | 18 +++ .../top/solicitudes/detalleSolicitud.html | 55 ++++++--- .../top/solicitudes/historialSolicitud.html | 28 ++--- .../top/solicitudes/solicitudes.component.ts | 18 ++- .../top/solicitudes/solicitudes.html | 108 +++++++++--------- 5 files changed, 142 insertions(+), 85 deletions(-) diff --git a/src/app/components/top/solicitudes/detalleSolicitud.component.ts b/src/app/components/top/solicitudes/detalleSolicitud.component.ts index 5e9d8e6c63..ce29f42195 100644 --- a/src/app/components/top/solicitudes/detalleSolicitud.component.ts +++ b/src/app/components/top/solicitudes/detalleSolicitud.component.ts @@ -26,6 +26,13 @@ export class DetalleSolicitudComponent implements OnChanges, OnDestroy { { key: 'historial', label: 'HISTORIAL' }, { key: 'turnos', label: 'TURNOS' } ]; + + public columns = [ + { key: 'fecha', label: 'Fecha' }, + { key: 'notificadorPor', label: 'Notificado por' }, + { key: 'observaciones', label: 'Observaciones' }, + ]; + public mostrar = 'solicitud'; public verIndicaciones = false; @@ -72,4 +79,15 @@ export class DetalleSolicitudComponent implements OnChanges, OnDestroy { ngOnDestroy() { this.internacion = null; } + + existeNotificaciones(notificaciones) { + if (notificaciones?.length === 0) { + return false; + } + return notificaciones?.some(notificacion => notificacion.accion === 'notificar'); + } + + obtenerNotificaciones(notificaciones) { + return (notificaciones || []).filter(notificacion => notificacion.accion === 'notificar'); + } } diff --git a/src/app/components/top/solicitudes/detalleSolicitud.html b/src/app/components/top/solicitudes/detalleSolicitud.html index edae79dad1..59c033c48e 100644 --- a/src/app/components/top/solicitudes/detalleSolicitud.html +++ b/src/app/components/top/solicitudes/detalleSolicitud.html @@ -10,39 +10,40 @@ + titulo="Tipo de prestación origen" + subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacionOrigen?.term}}"> + subtitulo="{{prestacionSeleccionada.solicitud.organizacionOrigen?.nombre}}"> + subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacion?.term}}"> + subtitulo="{{prestacionSeleccionada.solicitud.organizacion?.nombre}}"> + subtitulo="{{ turnoSeleccionado.horaInicio | fecha }} - {{ turnoSeleccionado.horaInicio | date: 'HH:mm' }}"> - - +
@@ -68,16 +69,40 @@

{{prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.motivo}}

+ *ngIf="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones"> + [icon]="verIndicaciones ? 'chevron-up' : 'chevron-down'" (click)="toggleIndicaciones()">
+ [innerHTML]="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones">
+
+ + + + + + + + {{notificacion.fechaDeNotificacion | date:'dd/MM/yyyy HH:mm'}} + {{notificacion.createdBy | nombre}} + {{notificacion.observaciones}} + + + + +
+
+ + +
+
+
+
@@ -90,7 +115,7 @@
+ subtitulo="{{prestacionSeleccionada.estadoActual.createdBy | nombre}}">
diff --git a/src/app/components/top/solicitudes/historialSolicitud.html b/src/app/components/top/solicitudes/historialSolicitud.html index 0607e42d11..517c9b4d4d 100644 --- a/src/app/components/top/solicitudes/historialSolicitud.html +++ b/src/app/components/top/solicitudes/historialSolicitud.html @@ -1,33 +1,33 @@ - +
+ titulo="{{ reg.createdAt | fecha }}" + subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }}"> + titulo="{{ reg.createdAt | fecha }}" + subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }} el {{ reg.fechaDeNotificacion | date: 'dd/MM/yyyy HH:mm' }}"> + subtitulo="{{ reg.observaciones? reg.observaciones :'Sin observaciones'}}"> + titulo="Prestación Destino Original" + subtitulo="{{ reg.tipoPrestacion?.term? reg.tipoPrestacion.term : 'No indica prestación' }}"> + titulo="Organizacion Destino Original" + subtitulo="{{ reg.organizacion?.nombre? reg.organizacion.nombre : 'No indica organización' }}"> + [tituloBold]="true" titulo="Profesional Destino Original" + subtitulo="{{ reg.profesional.nombre }} {{ reg.profesional.apellido }}"> + subtitulo="{{reg.createdBy.organizacion?.nombre? reg.createdBy.organizacion.nombre : 'No indica organización'}}">
@@ -35,6 +35,6 @@
+ titulo="No existe historial para esta solicitud">
\ No newline at end of file diff --git a/src/app/components/top/solicitudes/solicitudes.component.ts b/src/app/components/top/solicitudes/solicitudes.component.ts index 636f2f0b1b..3f62cf89fc 100644 --- a/src/app/components/top/solicitudes/solicitudes.component.ts +++ b/src/app/components/top/solicitudes/solicitudes.component.ts @@ -756,15 +756,23 @@ export class SolicitudesComponent implements OnInit { tipoPrestacion: this.prestacionSeleccionada.solicitud.historial[this.prestacionSeleccionada.solicitud.historial.length - 1].tipoPrestacion, fechaNotificacion: this.fechaNotificacion }; - this.servicioPrestacion.patch(this.prestacionSeleccionada.id, patch).subscribe(() => { - this.plex.toast('success', 'Paciente notificado con éxito.'); - this.cargarSolicitudes(); - }, error => { - this.plex.toast('danger', 'Ha ocurrido un error al notificar al paciente.'); + this.servicioPrestacion.patch(this.prestacionSeleccionada.id, patch).subscribe({ + next: () => { + this.plex.toast('success', 'Paciente notificado con éxito.'); + this.cargarSolicitudes(); + this.descripcionNotificacion = ''; + }, + error: () => { + this.plex.toast('danger', 'Ha ocurrido un error al notificar al paciente.'); + } }); this.closeSidebar(); } + onCloseComunicacion() { + this.descripcionNotificacion = ''; + } + onScroll(event: any) { if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight - 50) { if (!this.scrollEnd) { diff --git a/src/app/components/top/solicitudes/solicitudes.html b/src/app/components/top/solicitudes/solicitudes.html index 100cd6ccbe..788f77850f 100644 --- a/src/app/components/top/solicitudes/solicitudes.html +++ b/src/app/components/top/solicitudes/solicitudes.html @@ -92,7 +92,7 @@
+ (scroll)="onScroll($event)"> @@ -103,9 +103,9 @@ {{col.label}} + name="chevron-down" class="pl-1" size="md"> + name="chevron-up" class="pl-1" size="md"> @@ -122,7 +122,7 @@
+ [showUpdate]="false"> @@ -138,88 +138,91 @@
+ subtitulo="DNI: {{prestacion.paciente.documento}}"> + titulo="{{prestacion.solicitud.organizacionOrigen? prestacion.solicitud.organizacionOrigen.nombre : 'Sin organización de origen'}}" + subtitulo="{{prestacion.solicitud.profesionalOrigen?(prestacion.solicitud.profesionalOrigen | nombre) : 'Sin profesional de origen'}}"> + titulo="{{prestacion.solicitud.tipoPrestacion.term}}" + subtitulo="{{prestacion.solicitud.profesional? (prestacion.solicitud.profesional | nombre):'Sin profesional de destino'}}"> + titulo="{{prestacion.updatedAt | date:'dd/MM/yyyy - HH:mm'}}">
+ *ngIf="prestacion.solicitud.registros[0]?.valor.solicitudPrestacion?.conceptoAsociado" + type="warning"> + type="info" tooltip="Agenda Virtual" tooltipPosition="top"> + tooltip="Paciente notificado"> - AUTOCITADO + AUTOCITADO VENCIDA + *ngIf="prestacion.solicitud.registros[0]?.valor.solicitudPrestacion.prioridad === 'prioritario'"> {{prestacion.solicitud.registros[0].valor.solicitudPrestacion.prioridad}} + *ngIf="prestacion.estadoActual.tipo !== 'rechazada' && prestacion.estadoActual.tipo !== 'auditoria' && prestacion.estadoActual.tipo !== 'validada' && prestacion.estadoActual.tipo !== 'vencida'"> {{ prestacion | estadoSolicitud}} + *ngIf="!prestacion.solicitud.turno && prestacion.estadoActual.tipo === 'validada'"> Registro en HUDS + *ngIf="prestacion | estadoSolicitud as estado"> + *ngIf="!prestacion.solicitud.turno && estado === 'rechazada'"> CONTRARREFERIDA + *ngIf="!prestacion.solicitud.turno && prestacion.estadoActual.tipo === 'auditoria'"> {{prestacion | estadoSolicitud}} + *ngIf="prestacion | auditoriasSolicitud as auditorias"> {{auditorias}} - Turno dado - + Turno dado + Registro en HUDS REFERIDA @@ -266,9 +269,8 @@ label="Prioridad" ngModelOptions="{standalone: true}" (change)="cargarSolicitudes()"> + name="conceptoAsociado" label="Diagnóstico asociado" [data]="listaConceptosAsociados" + labelField="term" idField="conceptId" (change)="setConceptoAsociado($event)"> @@ -280,7 +282,7 @@
+ (scroll)="onScroll($event)"> @@ -291,9 +293,9 @@ {{col.label}} + name="chevron-down" class="pl-1" size="md"> + name="chevron-up" class="pl-1" size="md"> @@ -319,58 +321,61 @@
+ subtitulo="DNI: {{prestacion.paciente.documento}}"> + titulo="{{prestacion.solicitud.tipoPrestacion? prestacion.solicitud.tipoPrestacion.term : 'No indica'}}" + subtitulo=" {{prestacion.solicitud.profesionalOrigen?(prestacion.solicitud.profesionalOrigen | nombre) : 'Sin profesional de origen'}}"> + titulo="{{prestacion.solicitud.organizacion? prestacion.solicitud.organizacion.nombre : 'Sin organización de destino'}}" + subtitulo=" {{prestacion.solicitud.profesional?(prestacion.solicitud.profesional | nombre) : 'Sin profesional de destino'}}"> + titulo="{{prestacion.updatedAt | date:'dd/MM/yyyy - HH:mm'}}">
+ *ngIf="prestacion.solicitud.registros[0]?.valor.solicitudPrestacion?.conceptoAsociado" + type="warning"> + tooltip="Paciente notificado"> + *ngIf="prestacion.solicitud.registros[0]?.valor.solicitudPrestacion.prioridad === 'prioritario'"> {{prestacion.solicitud.registros[0].valor.solicitudPrestacion.prioridad}} + type="{{prestacion | estadoPrestacion}}"> CONTRARREFERIDA - + {{prestacion.estadoActual.tipo}} - + {{ prestacion | estadoSolicitud}} - Registro en + Registro en HUDS
@@ -521,7 +526,8 @@ + tooltip="Comunicación con el paciente" tooltipPosition="left" icon="telefono" + (close)="onCloseComunicacion()">