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
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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');
}
}
55 changes: 40 additions & 15 deletions src/app/components/top/solicitudes/detalleSolicitud.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,40 @@
</plex-title>
<plex-grid cols="3" size="md" direction="row">
<plex-label *ngIf="prestacionSeleccionada.solicitud.tipoPrestacionOrigen?.term"
titulo="Tipo de prestación origen"
subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacionOrigen?.term}}">
titulo="Tipo de prestación origen"
subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacionOrigen?.term}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.solicitud.organizacionOrigen?.nombre" titulo="Organización origen"
subtitulo="{{prestacionSeleccionada.solicitud.organizacionOrigen?.nombre}}">
subtitulo="{{prestacionSeleccionada.solicitud.organizacionOrigen?.nombre}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.solicitud.profesionalOrigen" titulo="Profesional de origen" subtitulo="{{ prestacionSeleccionada.solicitud.profesionalOrigen?.nombre }} {{
prestacionSeleccionada.solicitud.profesionalOrigen?.apellido
}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.solicitud.tipoPrestacion?.term" titulo="Tipo de prestación destino"
subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacion?.term}}">
subtitulo="{{prestacionSeleccionada.solicitud.tipoPrestacion?.term}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.solicitud.organizacion?.nombre" titulo="Organización destino"
subtitulo="{{prestacionSeleccionada.solicitud.organizacion?.nombre}}">
subtitulo="{{prestacionSeleccionada.solicitud.organizacion?.nombre}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.solicitud.profesional" titulo="Profesional de destino" subtitulo="{{ prestacionSeleccionada.solicitud.profesional?.nombre }} {{
prestacionSeleccionada.solicitud.profesional?.apellido
}}">
</plex-label>
<plex-label *ngIf="turnoSeleccionado" titulo="Fecha de turno"
subtitulo="{{ turnoSeleccionado.horaInicio | fecha }} - {{ turnoSeleccionado.horaInicio | date: 'HH:mm' }}">
subtitulo="{{ turnoSeleccionado.horaInicio | fecha }} - {{ turnoSeleccionado.horaInicio | date: 'HH:mm' }}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.estadoActual.observaciones" titulo="Observaciones" subtitulo="
{{prestacionSeleccionada.estadoActual.observaciones}}">
</plex-label>
<plex-label *ngIf="!prestacionSeleccionada.estadoActual.observaciones && prestacionSeleccionada.estadoActual.motivoRechazo"
titulo="Observaciones" subtitulo="
<plex-label
*ngIf="!prestacionSeleccionada.estadoActual.observaciones && prestacionSeleccionada.estadoActual.motivoRechazo"
titulo="Observaciones" subtitulo="
{{prestacionSeleccionada.estadoActual.motivoRechazo}}">
</plex-label>
<plex-label *ngIf="prestacionSeleccionada.estadoActual.observaciones || prestacionSeleccionada.estadoActual.motivoRechazo"
titulo="Usuario que responde"
subtitulo="{{prestacionSeleccionada.estadoActual.createdBy | nombre}}">
<plex-label
*ngIf="prestacionSeleccionada.estadoActual.observaciones || prestacionSeleccionada.estadoActual.motivoRechazo"
titulo="Usuario que responde" subtitulo="{{prestacionSeleccionada.estadoActual.createdBy | nombre}}">
</plex-label>
<ng-container *ngIf="internacion">
<div class="internacion-estado">
Expand All @@ -68,16 +69,40 @@
<p>{{prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.motivo}}</p>

<plex-title size="sm" titulo="Indicaciones"
*ngIf="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones">
*ngIf="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones">
<plex-button type="info" size="sm" label="Ver Indicaciones"
[icon]="verIndicaciones ? 'chevron-up' : 'chevron-down'" (click)="toggleIndicaciones()">
[icon]="verIndicaciones ? 'chevron-up' : 'chevron-down'" (click)="toggleIndicaciones()">
</plex-button>
</plex-title>
<div *ngIf="verIndicaciones">
<span
[innerHTML]="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones"></span>
[innerHTML]="prestacionSeleccionada.solicitud.registros[0].valor.solicitudPrestacion.indicaciones"></span>
</div>
</div>
<div class="col-12">
<plex-title size="sm" titulo="Notificaciones"></plex-title>
<ng-container *ngIf="existeNotificaciones(prestacionSeleccionada.solicitud?.historial)">
<plex-table [columns]="columns" #table="plTable" [headOpacity]="10">
<plex-table-columns>
</plex-table-columns>

<tr *ngFor="let notificacion of obtenerNotificaciones(prestacionSeleccionada.solicitud?.historial)">
<td *plTableCol="'fecha'">{{notificacion.fechaDeNotificacion | date:'dd/MM/yyyy HH:mm'}}</td>
<td *plTableCol="'notificadorPor'">{{notificacion.createdBy | nombre}}</td>
<td *plTableCol="'observaciones'">{{notificacion.observaciones}}</td>
</tr>
</plex-table>
</ng-container>
<ng-container *ngIf="!existeNotificaciones(prestacionSeleccionada.solicitud?.historial)">
<section>
<div justify="center" class="mt-4" style="margin-bottom: 2em;">
<plex-label class="flex-column" icon="informacion" size="md" direction="column"
titulo="No existen notificaciones para esta solicitud.">
</plex-label>
</div>
</section>
</ng-container>
</div>
</div>
<div class="row" *ngIf="prestacionSeleccionada.estadoActual.tipo === 'anulada'">
<div class="col-12">
Expand All @@ -90,7 +115,7 @@
<div class="row mb-3">
<div class="col-4">
<plex-label titulo="Anulada por"
subtitulo="{{prestacionSeleccionada.estadoActual.createdBy | nombre}}">
subtitulo="{{prestacionSeleccionada.estadoActual.createdBy | nombre}}">
</plex-label>
</div>
<div class="col-4">
Expand Down
28 changes: 14 additions & 14 deletions src/app/components/top/solicitudes/historialSolicitud.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<plex-list *ngIf="itemsHistorial.length">
<plex-item *ngFor="let reg of itemsHistorial">
<plex-icon name="entrada" type="info" size="md"></plex-icon>
<plex-icon name="{{ reg.fechaDeNotificacion ? 'telefono' : 'entrada' }}" type="info" size="md"></plex-icon>
<div>
<plex-grid cols="3" size="md" type="auto">
<plex-label size="md" *ngIf="reg.accion !== 'notificar'" [tituloBold]="true"
titulo="{{ reg.createdAt | fecha }}"
subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }}">
titulo="{{ reg.createdAt | fecha }}"
subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }}">
</plex-label>
<plex-label size="md" *ngIf="reg.accion === 'notificar'" [tituloBold]="true"
titulo="{{ reg.createdAt | fecha }}"
subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }} el {{ reg.fechaDeNotificacion | date: 'dd/MM/yyyy HH:mm' }}">
titulo="{{ reg.createdAt | fecha }}"
subtitulo="{{ reg.descripcion }} por {{ reg.createdBy.nombreCompleto }} el {{ reg.fechaDeNotificacion | date: 'dd/MM/yyyy HH:mm' }}">
</plex-label>
<plex-label size="md" [tituloBold]="true" titulo="Notas"
subtitulo="{{ reg.observaciones? reg.observaciones :'Sin observaciones'}}"></plex-label>
subtitulo="{{ reg.observaciones? reg.observaciones :'Sin observaciones'}}"></plex-label>
<plex-label size="md" *ngIf="reg.descripcion === 'Referida'" [tituloBold]="true"
titulo="Prestación Destino Original"
subtitulo="{{ reg.tipoPrestacion?.term? reg.tipoPrestacion.term : 'No indica prestación' }}">
titulo="Prestación Destino Original"
subtitulo="{{ reg.tipoPrestacion?.term? reg.tipoPrestacion.term : 'No indica prestación' }}">
</plex-label>

<plex-label size=" md" *ngIf="reg.descripcion === 'Referida'" [tituloBold]="true"
titulo="Organizacion Destino Original"
subtitulo="{{ reg.organizacion?.nombre? reg.organizacion.nombre : 'No indica organización' }}">
titulo="Organizacion Destino Original"
subtitulo="{{ reg.organizacion?.nombre? reg.organizacion.nombre : 'No indica organización' }}">
</plex-label>
<plex-label size="md" *ngIf="reg.profesional && (reg.accion === 'referir' || reg.accion === 'asignada')"
[tituloBold]="true" titulo="Profesional Destino Original"
subtitulo="{{ reg.profesional.nombre }} {{ reg.profesional.apellido }}">
[tituloBold]="true" titulo="Profesional Destino Original"
subtitulo="{{ reg.profesional.nombre }} {{ reg.profesional.apellido }}">
</plex-label>
<plex-label size="md" [tituloBold]="true" titulo="Efector"
subtitulo="{{reg.createdBy.organizacion?.nombre? reg.createdBy.organizacion.nombre : 'No indica organización'}}">
subtitulo="{{reg.createdBy.organizacion?.nombre? reg.createdBy.organizacion.nombre : 'No indica organización'}}">
</plex-label>
</plex-grid>
</div>
</plex-item>
</plex-list>
<div *ngIf="!itemsHistorial.length" justify="center" class="mt-4">
<plex-label class="flex-column" icon="informacion" size="xl" direction="column"
titulo="No existe historial para esta solicitud">
titulo="No existe historial para esta solicitud">
</plex-label>
</div>
18 changes: 13 additions & 5 deletions src/app/components/top/solicitudes/solicitudes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Loading