From 62c0e4433c260fa309a4379926acfd55c167c270 Mon Sep 17 00:00:00 2001 From: Fabio-Ramirez Date: Thu, 23 Apr 2026 15:26:54 -0300 Subject: [PATCH 1/3] MPI - Marcar paciente como corregido en el listado de reporte de errores --- .../mpi/components/datos-basicos.component.ts | 12 +++--- .../core/mpi/components/datos-basicos.html | 4 ++ .../core/mpi/components/paciente.component.ts | 40 ++++++++++------- src/app/core/mpi/interfaces/IPaciente.ts | 1 + .../component/auditoria-listado.component.ts | 43 ++++++++++++++----- .../component/auditoria-listado.html | 8 +++- .../component/auditoria.component.ts | 14 +++++- .../auditoria/component/auditoria.html | 30 ++++++++----- .../modal-correccion-paciente.component.ts | 34 ++++++++++++--- .../component/modal-correccion-paciente.html | 4 ++ .../component/reporte-errores.component.ts | 4 ++ .../auditoria/component/reporte-errores.html | 2 +- 12 files changed, 144 insertions(+), 52 deletions(-) diff --git a/src/app/core/mpi/components/datos-basicos.component.ts b/src/app/core/mpi/components/datos-basicos.component.ts index 4f9d61be71..3ba989384f 100644 --- a/src/app/core/mpi/components/datos-basicos.component.ts +++ b/src/app/core/mpi/components/datos-basicos.component.ts @@ -46,7 +46,7 @@ export class DatosBasicosComponent implements OnInit, OnChanges, AfterViewInit, noPoseeDNI = false; botonRegistroDNI = false; pacienteExtranjero: IPaciente; - pacienteEditado = { nombre: '', apellido: '' }; + pacienteEditado = { nombre: '', apellido: '', fechaNacimiento: null as Date | null }; public requiereGenero: boolean; public nuevoPaciente = false; public disableRegistro = false; @@ -267,6 +267,7 @@ export class DatosBasicosComponent implements OnInit, OnChanges, AfterViewInit, registrarError() { this.pacienteEditado.nombre = this.paciente.nombre; this.pacienteEditado.apellido = this.paciente.apellido; + this.pacienteEditado.fechaNacimiento = this.paciente.fechaNacimiento; this.paciente.reportarError = true; this.changes.emit({ pacienteError: this.pacienteEditado }); } @@ -536,12 +537,9 @@ export class DatosBasicosComponent implements OnInit, OnChanges, AfterViewInit, } verificarNombreApellido(data) { - if (data.nombre) { - this.pacienteEditado.nombre = data.nombre; - } - if (data.apellido) { - this.pacienteEditado.apellido = data.apellido; - } + this.pacienteEditado.nombre = data.hasOwnProperty('nombre') ? data.nombre : this.pacienteEditado.nombre; + this.pacienteEditado.apellido = data.hasOwnProperty('apellido') ? data.apellido : this.pacienteEditado.apellido; + this.pacienteEditado.fechaNacimiento = data.hasOwnProperty('fechaNacimiento') ? data.fechaNacimiento : this.pacienteEditado.fechaNacimiento; this.changes.emit({ pacienteError: this.pacienteEditado }); } diff --git a/src/app/core/mpi/components/datos-basicos.html b/src/app/core/mpi/components/datos-basicos.html index 4dd93a223b..e11f8f6b1a 100644 --- a/src/app/core/mpi/components/datos-basicos.html +++ b/src/app/core/mpi/components/datos-basicos.html @@ -297,6 +297,10 @@ [required]="true" [debounce]="500" (change)="verificarNombreApellido({nombre: pacienteEditado.nombre})"> + +
- Fallecido: {{ paciente.fechaFallecimiento | fecha:'utc'}} @@ -54,6 +53,13 @@ {{ registroReportes[paciente.id][0]?.createdAt | fecha:'utc'}} + + + + + + \ No newline at end of file diff --git a/src/app/modules/auditoria/component/auditoria.component.ts b/src/app/modules/auditoria/component/auditoria.component.ts index 2200713fed..bfec42562c 100644 --- a/src/app/modules/auditoria/component/auditoria.component.ts +++ b/src/app/modules/auditoria/component/auditoria.component.ts @@ -239,15 +239,25 @@ export class AuditoriaComponent implements OnInit { this.resultadoBusqueda = []; } + tieneDatosCorrectos() { + const p = this.pacienteSelected; + + return !!( + p.nombreCorrectoReportado || + p.apellidoCorrectoReportado || + p.fechaNacimientoCorrectoReportado + ); + } + tieneNombreApellidoCorrecto() { return (this.pacienteSelected.nombreCorrectoReportado && !this.pacienteSelected.apellidoCorrectoReportado) || !this.pacienteSelected.nombreCorrectoReportado && this.pacienteSelected.apellidoCorrectoReportado; } tieneNotaError() { - return !this.pacienteSelected.nombreCorrectoReportado && !this.pacienteSelected.apellidoCorrectoReportado && this.pacienteSelected.notaError; + return !this.pacienteSelected.nombreCorrectoReportado && !this.pacienteSelected.apellidoCorrectoReportado && !this.pacienteSelected.fechaNacimientoCorrectoReportado && this.pacienteSelected.notaError; } noTieneNotaError() { - return !this.pacienteSelected.nombreCorrectoReportado && !this.pacienteSelected.apellidoCorrectoReportado && !this.pacienteSelected.notaError; + return !this.pacienteSelected.nombreCorrectoReportado && !this.pacienteSelected.apellidoCorrectoReportado && !this.pacienteSelected.fechaNacimientoCorrectoReportado && !this.pacienteSelected.notaError; } } diff --git a/src/app/modules/auditoria/component/auditoria.html b/src/app/modules/auditoria/component/auditoria.html index 63c3c16a74..938343bfec 100644 --- a/src/app/modules/auditoria/component/auditoria.html +++ b/src/app/modules/auditoria/component/auditoria.html @@ -87,18 +87,25 @@ {{ listaReportes[0].createdAt | fecha:'utc' }} - - - - - - + + + + + + + + + - + {{pacienteSelected.notaError}} No se ha encontrado alguna descripción del error @@ -119,6 +126,9 @@ subtitulo="{{ pacienteSelected.nombreCorrectoReportado}}"> + diff --git a/src/app/modules/auditoria/component/modal-correccion-paciente.component.ts b/src/app/modules/auditoria/component/modal-correccion-paciente.component.ts index 22f73b4617..f9801dbc7e 100644 --- a/src/app/modules/auditoria/component/modal-correccion-paciente.component.ts +++ b/src/app/modules/auditoria/component/modal-correccion-paciente.component.ts @@ -14,7 +14,7 @@ export class ModalCorreccionPacienteComponent { @Output() patientCorrected = new EventEmitter(); @ViewChild('modal', { static: true }) modal: PlexModalComponent; - public pacienteEdited = { nombre: '', apellido: '' }; + public pacienteEdited = { nombre: '', apellido: '', fechaNacimiento: null as Date | null }; public pacienteFoto = { fotoId: '', id: '' }; /** @@ -22,10 +22,32 @@ export class ModalCorreccionPacienteComponent { * y que los campos editados no sean vacíos */ get pacienteEdit() { - const res = (this.pacienteEdited && this.pacienteEdited.nombre && this.pacienteEdited.apellido && - (this.pacienteEdited.nombre.toUpperCase() !== this.paciente.nombre || - this.pacienteEdited.apellido.toUpperCase() !== this.paciente.apellido)); - return res; + if ( + !this.pacienteEdited?.nombre || + !this.pacienteEdited?.apellido || + !this.pacienteEdited?.fechaNacimiento + ) { + return false; + } + + const nombreDiff = + this.pacienteEdited.nombre.trim().toUpperCase() !== this.paciente.nombre; + + const apellidoDiff = + this.pacienteEdited.apellido.trim().toUpperCase() !== this.paciente.apellido; + + const fechaOriginal = moment(this.paciente.fechaNacimiento).format('YYYY-MM-DD'); + const fechaEditada = moment(this.pacienteEdited.fechaNacimiento).format('YYYY-MM-DD'); + + const fechaDiff = fechaEditada !== fechaOriginal; + + return nombreDiff || apellidoDiff || fechaDiff; + } + + formatFecha(fecha: Date): string { + return fecha + ? new Date(fecha).toISOString().split('T')[0] + : ''; } show() { @@ -33,12 +55,14 @@ export class ModalCorreccionPacienteComponent { this.modal.show(); this.pacienteEdited.nombre = this.paciente.nombre; this.pacienteEdited.apellido = this.paciente.apellido; + this.pacienteEdited.fechaNacimiento = this.paciente.fechaNacimiento; } notificarAccion(flag: boolean) { if (flag && this.pacienteEdit) { this.paciente.nombre = this.pacienteEdited.nombre; this.paciente.apellido = this.pacienteEdited.apellido; + this.paciente.fechaNacimiento = this.pacienteEdited.fechaNacimiento; this.patientCorrected.emit(this.paciente); } this.modal.close(); diff --git a/src/app/modules/auditoria/component/modal-correccion-paciente.html b/src/app/modules/auditoria/component/modal-correccion-paciente.html index 472327ccd2..b5438b8d4c 100644 --- a/src/app/modules/auditoria/component/modal-correccion-paciente.html +++ b/src/app/modules/auditoria/component/modal-correccion-paciente.html @@ -45,6 +45,10 @@ + + diff --git a/src/app/modules/auditoria/component/reporte-errores.component.ts b/src/app/modules/auditoria/component/reporte-errores.component.ts index 6efac7c5b3..ce910310cb 100644 --- a/src/app/modules/auditoria/component/reporte-errores.component.ts +++ b/src/app/modules/auditoria/component/reporte-errores.component.ts @@ -134,6 +134,10 @@ export class ReporteErroresComponent implements OnInit { this.cargar(true); } + onResetReport(paciente: IPaciente) { + this.savePatient(paciente); + } + savePatient(paciente: IPaciente) { // si el paciente no debe ser modificado (cancelar) entonces es paciente=null if (paciente) { diff --git a/src/app/modules/auditoria/component/reporte-errores.html b/src/app/modules/auditoria/component/reporte-errores.html index 5a6f320d1a..44795570b9 100644 --- a/src/app/modules/auditoria/component/reporte-errores.html +++ b/src/app/modules/auditoria/component/reporte-errores.html @@ -2,7 +2,7 @@
+ (selected)="onSelect($event)" (scrolled)="onScroll()" (resetReport)="onResetReport($event)">
From 085ccaa5a2ebab8906a8345bb718a2dc09272f69 Mon Sep 17 00:00:00 2001 From: Fabio-Ramirez Date: Tue, 28 Apr 2026 12:57:18 -0300 Subject: [PATCH 2/3] Agregar observaciones a tarea de MPI --- .../auditoria/component/auditoria-listado.component.ts | 8 ++++++-- src/app/modules/auditoria/component/auditoria.html | 2 +- .../auditoria/component/reporte-errores.component.ts | 2 ++ src/app/modules/auditoria/component/reporte-errores.html | 7 +++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/app/modules/auditoria/component/auditoria-listado.component.ts b/src/app/modules/auditoria/component/auditoria-listado.component.ts index 60d74d64d3..5a080afa09 100644 --- a/src/app/modules/auditoria/component/auditoria-listado.component.ts +++ b/src/app/modules/auditoria/component/auditoria-listado.component.ts @@ -138,8 +138,12 @@ export class ListadoAuditoriaComponent { } pacienteCorregido(paciente: IPaciente) { - paciente.reportarError = false; - this.resetReport.emit(paciente); + this.plex.confirm('¿Desea marcar como corregido?', 'Confirmación').then(confirmar => { + if (confirmar) { + paciente.reportarError = false; + this.resetReport.emit(paciente); + } + }); } tieneDatosReportados(paciente: IPaciente) { diff --git a/src/app/modules/auditoria/component/auditoria.html b/src/app/modules/auditoria/component/auditoria.html index 938343bfec..8167d5659a 100644 --- a/src/app/modules/auditoria/component/auditoria.html +++ b/src/app/modules/auditoria/component/auditoria.html @@ -23,7 +23,7 @@ - + diff --git a/src/app/modules/auditoria/component/reporte-errores.component.ts b/src/app/modules/auditoria/component/reporte-errores.component.ts index ce910310cb..ee1d58aa63 100644 --- a/src/app/modules/auditoria/component/reporte-errores.component.ts +++ b/src/app/modules/auditoria/component/reporte-errores.component.ts @@ -16,6 +16,7 @@ export class ReporteErroresComponent implements OnInit { @ViewChild('modalCorreccion') modalCorreccion: ModalCorreccionPacienteComponent; @Output() selected = new EventEmitter(); + @Output() reset = new EventEmitter(); showSidebar = false; filtroPaciente: string; @@ -157,6 +158,7 @@ export class ReporteErroresComponent implements OnInit { this.plex.toast('success', 'Los datos se actualizaron correctamente!'); // recargamos la lista para reflejar el cambio this.cargar(); + this.reset.emit(); } } else { diff --git a/src/app/modules/auditoria/component/reporte-errores.html b/src/app/modules/auditoria/component/reporte-errores.html index 44795570b9..45d4cecb2e 100644 --- a/src/app/modules/auditoria/component/reporte-errores.html +++ b/src/app/modules/auditoria/component/reporte-errores.html @@ -1,8 +1,11 @@ - + + +
+ (selected)="onSelect($event)" (scrolled)="onScroll()" (resetReport)="onResetReport($event)">
From cef47bc7a52c01617b6fa96648b991c638c53077 Mon Sep 17 00:00:00 2001 From: laucharin Date: Thu, 21 May 2026 14:32:11 -0300 Subject: [PATCH 3/3] Corrige scroll infinito --- .../auditoria/component/auditoria-listado.html | 2 +- src/app/modules/auditoria/component/auditoria.scss | 6 +----- .../modules/auditoria/component/reporte-errores.scss | 11 ++--------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/app/modules/auditoria/component/auditoria-listado.html b/src/app/modules/auditoria/component/auditoria-listado.html index 4c0c243799..138d30db1d 100644 --- a/src/app/modules/auditoria/component/auditoria-listado.html +++ b/src/app/modules/auditoria/component/auditoria-listado.html @@ -1,4 +1,4 @@ - + Paciente Edad diff --git a/src/app/modules/auditoria/component/auditoria.scss b/src/app/modules/auditoria/component/auditoria.scss index 81ec8e610a..1c86be91b4 100644 --- a/src/app/modules/auditoria/component/auditoria.scss +++ b/src/app/modules/auditoria/component/auditoria.scss @@ -2,14 +2,10 @@ img { height: 60px; } -.img-fallecido { - filter: grayscale(100%); -} - span.error-paciente { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 100px !important; display: inline-block; -} +} \ No newline at end of file diff --git a/src/app/modules/auditoria/component/reporte-errores.scss b/src/app/modules/auditoria/component/reporte-errores.scss index eb363b1199..72b0605a6b 100644 --- a/src/app/modules/auditoria/component/reporte-errores.scss +++ b/src/app/modules/auditoria/component/reporte-errores.scss @@ -1,16 +1,9 @@ -:host { - display: flex; - flex-direction: column; - height: 100%; - overflow: hidden; -} - .flex-grow-1 { display: flex; flex-direction: column; flex: 1; min-height: 0; - overflow: hidden; + // overflow: hidden; position: relative; } @@ -30,7 +23,7 @@ auditoria-listado { } .striped.md.size-lg { - flex: 1; + flex: 1; min-height: 0; overflow-y: auto !important; }