diff --git a/src/app/components/top/solicitudes/solicitudes.component.ts b/src/app/components/top/solicitudes/solicitudes.component.ts index 361a45e494..7aaced163e 100644 --- a/src/app/components/top/solicitudes/solicitudes.component.ts +++ b/src/app/components/top/solicitudes/solicitudes.component.ts @@ -131,14 +131,24 @@ export class SolicitudesComponent implements OnInit { public check; public collapse = false; public loader = true; + public sort = 'fechaSolicitudAsc'; + public sortBy = 'fechaSolicitud'; + public sortOrder = 'asc'; public columns = [ { - key: 'fecha', - label: 'Fecha', + key: 'fechaRegistro', + label: 'Fecha registro', + sorteable: true + }, + { + key: 'fechaSolicitud', + label: 'Fecha Solicitud', + sorteable: true }, { key: 'paciente', label: 'Paciente', + sorteable: false }, { key: 'origen', @@ -150,7 +160,8 @@ export class SolicitudesComponent implements OnInit { }, { key: 'actualizacion', - label: 'actualización', + label: 'Actualización', + sorteable: true }, { key: 'EstadoAcciones', @@ -287,10 +298,11 @@ export class SolicitudesComponent implements OnInit { } closeSidebar() { - if (!this.columns.some(col => col.key === 'paciente')) { - this.columns.splice(1, 0, { key: 'paciente', label: 'Paciente' }); + if (this.columns && !this.columns.some(col => col.key === 'paciente')) { + this.columns.splice(2, 0, { key: 'paciente', label: 'Paciente', sorteable: false }); + this.showPacienteData = true; } - this.showPacienteData = true; + this.showAuditar = false; this.showReferir = false; this.showSidebar = false; @@ -308,9 +320,8 @@ export class SolicitudesComponent implements OnInit { this.closeSidebar(); } else { this.prestacionSeleccionada = prestacion; - const tableCols = (this.columnas as any).columns$.source._value; - if (tableCols.some(col => col.key === 'paciente')) { - (this.columnas as any).columns$.source._value.splice(1, 1); + if (this.columns.some(col => col.key === 'paciente')) { + this.columns = this.columns.filter(col => col.key !== 'paciente'); this.showPacienteData = false; } (this.tipoSolicitud === 'entrada' ? this.prestacionesEntrada : this.prestacionesSalida).forEach(e => e.seleccionada = false); @@ -428,6 +439,21 @@ export class SolicitudesComponent implements OnInit { this.buscarSolicitudes(); } + sortTable(event: string) { + const column = this.columns.find(p => p.key === event); + if (!column?.sorteable) { + return; + } + if (this.sortBy === event) { + this.sortOrder = (this.sortOrder === 'asc') ? 'desc' : 'asc'; + } else { + this.sortBy = event; + this.sortOrder = 'desc'; + } + this.sort = this.sortBy + (this.sortOrder === 'asc' ? 'Asc' : 'Desc'); + this.cargarSolicitudes(); + } + getParams() { const params: any = { estados: [ @@ -447,7 +473,10 @@ export class SolicitudesComponent implements OnInit { } else { params['solicitudDesdeActualizacion'] = this.fechaDesde; params['solicitudHastaActualizacion'] = this.fechaHasta; - params['ordenFechaDescAct'] = true; + params['solicitudHastaActualizacion'] = this.fechaHasta; + if (!this.sort) { + params['sortBy'] = 'fechaSolicitudDesc'; + } } /* TODO: Se remueve temporalmente la inclusión de referidas en la búsqueda de prestaciones. @@ -499,7 +528,10 @@ export class SolicitudesComponent implements OnInit { } else { params['solicitudDesdeActualizacion'] = this.fechaDesde; params['solicitudHastaActualizacion'] = this.fechaHasta; - params['ordenFechaDescAct'] = true; + params['solicitudHastaActualizacion'] = this.fechaHasta; + if (!this.sort) { + params['sortBy'] = 'fechaSolicitudDesc'; + } } if (this.asignadas) { params['idProfesionalOrigen'] = this.auth.profesional; @@ -538,6 +570,9 @@ export class SolicitudesComponent implements OnInit { } } this.setOrganizacionesParams(params); + if (this.sort) { + params['sortBy'] = this.sort; + } params['skip'] = this.skip; params['limit'] = this.limit; return params; @@ -638,7 +673,7 @@ export class SolicitudesComponent implements OnInit { this.showAuditar = false; this.showReferir = false; this.showSidebar = false; - this.columns.splice(1, 0, { key: 'paciente', label: 'Paciente' }); + this.columns.splice(2, 0, { key: 'paciente', label: 'Paciente', sorteable: false }); if (event.status !== false) { if (event?.status !== this.prestacionSeleccionada.estados && this.prestacionSeleccionada.estados?.length) { const patch = { @@ -674,9 +709,11 @@ export class SolicitudesComponent implements OnInit { this.closeSidebar(); } - onScroll() { - if (!this.scrollEnd) { - this.buscarSolicitudes(); + onScroll(event: any) { + if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight - 50) { + if (!this.scrollEnd) { + this.buscarSolicitudes(); + } } } diff --git a/src/app/components/top/solicitudes/solicitudes.html b/src/app/components/top/solicitudes/solicitudes.html index 4100b83f7d..d1583fff7d 100644 --- a/src/app/components/top/solicitudes/solicitudes.html +++ b/src/app/components/top/solicitudes/solicitudes.html @@ -1,81 +1,78 @@ + *ngIf="!showDarTurnos && !showCargarSolicitud && !showEditarReglas"> + routerLink="/solicitudes/reglasVisualizacion"> + label="Nueva Solicitud de Entrada" (click)="nuevaSolicitud()"> + label="Reglas de entrada" (click)="editarReglas()"> + label="Nueva Solicitud de Salida" (click)="nuevaSolicitud()"> + label="Reglas de entrada" (click)="editarReglas()">
+ (change)="cambioFechaDesde()" name="fechaDesdeLimitada" label="Registro desde" + class="fechas" required> + (change)="cambioFechaHasta()" name="fechaHastaLimitada" label="Registro hasta" + class="fechas" required> + [(ngModel)]="fechaDesde" (change)="cargarSolicitudes()" name="fechaDesde" + label="Registro desde" class="fechas" [max]="fechaHasta" required> + [(ngModel)]="fechaHasta" (change)="cargarSolicitudes()" name="fechaHasta" + label="Registro hasta" class="fechas" [min]="fechaDesde" [max]="hoy" required> + label="Prestación destino" name="prestacionDestino" + tmPrestaciones="solicitudes:tipoPrestacion:?" (change)="cargarSolicitudes()" + [preload]="true" [multiple]="true"> + label="Filtrar por paciente" debounce="400"> + [data]="selectEstados" name="estado" label="Estado" ngModelOptions="{standalone: true}">
+ label="Organización origen" placeholder="Seleccione la organización" labelField="nombre" + [multiple]="true" (change)="cargarSolicitudes()"> + tmProfesionales label="Equipo de salud" placeholder="Buscar por equipo de salud" + (change)="cargarSolicitudes()" [closeAfterSelect]="true"> + label="Prioridad" ngModelOptions="{standalone: true}" (change)="cargarSolicitudes()"> + name="conceptoAsociado" label="Diagnóstico asociado" name="conceptoAsociado" + [data]="listaConceptosAsociados" labelField="term" idField="conceptId" + (change)="setConceptoAsociado($event)"> + (change)="onChange()" [ngModelOptions]="{standalone: true}" type="slide">
@@ -87,122 +84,154 @@
+ titulo="No hay solicitudes de entrada en el rango de fechas">
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + - - + + - - - - + + + + - - + Registro en HUDS + + REFERIDA + + + + + +
+
+ {{col.label}} + + + + +
+
+ +
+ + + + +
+
+
+ + + + - - - + + - - - + + - - - - - + + + + - - - + + - - + + - - - + + - AUTOCITADO - - - VENCIDA - - + + VENCIDA + + - {{prestacion.solicitud.registros[0].valor.solicitudPrestacion.prioridad}} - - + - {{ prestacion | estadoSolicitud}} + {{ prestacion | estadoSolicitud}} - - + - Registro en HUDS - - + + - CONTRARREFERIDA - - - - - {{prestacion | estadoSolicitud}} - - + + + + {{prestacion | estadoSolicitud}} + + - - {{auditorias}} - - - - + {{auditorias}} + + + + Turno dado - - Registro en HUDS - - REFERIDA - - -
+ @@ -212,40 +241,37 @@ + name="fechaDesde" label="Registro desde" class="fechas" [max]="fechaHasta" required> + name="fechaHasta" label="Registro hasta" class="fechas" [min]="fechaDesde" [max]="hoy" + required> + label="Prestación destino" name="prestacionDestino" + tmPrestaciones="solicitudes:tipoPrestacion:?" (change)="cargarSolicitudes()" + [preload]="true" [multiple]="true"> + label="Filtrar por paciente" debounce="400"> + name="estado" label="Estado" ngModelOptions="{standalone: true}">
+ label="Organización destino" placeholder="Seleccione la organización" + labelField="nombre" [multiple]="true" (change)="cargarSolicitudes()"> + label="Prioridad" ngModelOptions="{standalone: true}" (change)="cargarSolicitudes()"> - + + (change)="onChange()" [ngModelOptions]="{standalone: true}" type="slide">
@@ -253,86 +279,113 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - - - + HUDS + + + + +
+
+ {{col.label}} + + + + +
+
+ + + + + + + - - - + + - - - + + - - - + + - - + + + - - - + + - - - + + - {{prestacion.solicitud.registros[0].valor.solicitudPrestacion.prioridad}} - - + - CONTRARREFERIDA - + - {{prestacion.estadoActual.tipo}} - - + - {{ prestacion | estadoSolicitud}} - - + Registro en - HUDS - -
+
+ titulo="No hay solicitudes de salida en el rango de fechas">
@@ -343,7 +396,7 @@ + (click)="closeSidebar()"> @@ -351,87 +404,82 @@
+ [turnoSeleccionado]="turnoSeleccionado" (internacionPaciente)="verInternacionPaciente($event)"> + *ngIf="botones.iniciarPrestacion && isPrestationEnabled(prestacionSeleccionada)" + icon="notas-check" btnType="success" type="info" tooltip="Iniciar prestación"> + tooltipPosition="left" [disabled]="formIniciar.invalid" + (click)="showModal('iniciar', true)"> + [required]="true" name="fechaIniciar" label="Fecha y hora de la prestación"> + [(ngModel)]="observacionesIniciarPrestacion" + placeholder="Ingrese observaciones..."> + tooltip="Continuar registro" tooltipPosition="left" size="sm" type="success" + (click)="onContinuarRegistro()"> + tooltip="Volver a auditoría" type="info" size="sm" (click)="volverAuditoria()"> + type="success" (click)="$event.stopPropagation(); onDarTurno()" title="Dar Turno"> + type="info" tooltip="Citar paciente">
+ tooltipPosition="left" [disabled]="formCitar.invalid" + (click)="$event.stopPropagation(); citar()"> + [(ngModel)]="observacionesCitar" [required]="true"> + label="Prioridad" ngModelOptions="{standalone: true}">
+ type="info" size="sm" (click)="onVerHuds()"> + btnType="danger" type="info" tooltip="Anular solicitud">
+ tooltipPosition="left" [disabled]="formAnular.invalid" + (click)="$event.stopPropagation(); anular()"> + [(ngModel)]="observacionesAnular" [required]="true">
@@ -439,54 +487,53 @@ + icon="chevron-double-right" btnType="warning" (click)="referir()"> + (returnReferir)="returnReferir($event)"> + tooltip="Auditar Solicitud" + [tooltipPosition]="prestacionSeleccionada.estadoActual.tipo === 'rechazada' ? 'left' : 'top'"> + (returnAuditoria)="returnAuditoria($event)"> + *ngIf="botones.cancelar && tipoSolicitud === 'salida' && permisoAnular" icon="cancel" + tooltip="Anular solicitud" size="sm" type="danger" (click)="onCancelar()"> + tooltip="Comunicación con el paciente" tooltipPosition="left" icon="telefono"> + tooltipPosition="left" [disabled]="!formComunicacion.valid" + (click)="onNotificarPaciente()">
+ name="fechaNotificacion" [max]="hoy" [(ngModel)]="fechaNotificacion" + [required]="true" placeholder="Ingrese una fecha"> + [(ngModel)]="descripcionNotificacion" placeholder="Ingrese una descripción" + [required]="true">
+ tooltip="{{ prestacionSeleccionada.solicitud.profesional?.id === auth.profesional ? 'Devolver' : 'Deshacer' }}" + tooltipPosition="left" type="danger" size="sm" (click)="showModal('devolver')">
@@ -508,8 +555,8 @@ + (afterDarTurno)="volverDarTurno($event)" [pacienteSeleccionado]="pacienteSeleccionado" + [solicitudPrestacion]="solicitudTurno"> @@ -529,7 +576,7 @@
+ [required]="true">
@@ -543,7 +590,7 @@ + (closed)="showModal('iniciar')">
?
@@ -554,10 +601,10 @@ + subtitulo="{{ prestacionSeleccionada.solicitud.tipoPrestacion.term }}"> + icon="paciente" subtitulo="{{ prestacionSeleccionada.paciente.documento }}">
diff --git a/src/app/components/top/solicitudes/solicitudes.scss b/src/app/components/top/solicitudes/solicitudes.scss index 056fcf48e1..f92f505d93 100644 --- a/src/app/components/top/solicitudes/solicitudes.scss +++ b/src/app/components/top/solicitudes/solicitudes.scss @@ -13,4 +13,37 @@ width: 60px; height: 60px; font-size: 3rem; +} + +.table { + + th, + td { + vertical-align: middle + } + +} + +.table-container { + th { + position: sticky; + top: 0; + z-index: 10; + background-color: rgba(255, 255, 255, 0.8); + white-space: nowrap; + } +} + +th.sortable { + cursor: pointer; +} + +.column-right { + plex-badge { + margin-right: 4px; + + &:last-child { + margin-right: 0; + } + } } \ No newline at end of file