diff --git a/src/app/modules/rup/components/ejecucion/hudsBusqueda.component.ts b/src/app/modules/rup/components/ejecucion/hudsBusqueda.component.ts index aca4b11606..312aacfcb6 100644 --- a/src/app/modules/rup/components/ejecucion/hudsBusqueda.component.ts +++ b/src/app/modules/rup/components/ejecucion/hudsBusqueda.component.ts @@ -42,6 +42,14 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro hallazgosNoActivosAux: any; filtroActual; filtroTrastornos = true; + public tabIndexLaboratorio = 0; + public filtrosLaboratorio = [ + { key: 0, label: 'Laboratorio' }, + { key: 1, label: 'Microbiología' }, + { key: 2, label: 'CDA' } + ]; + public filtroTipoMuestra = ''; + public filtroPracticaSolicitada = ''; public disabledBtnCDA = false; public token: string; public secondsToUpdate = 0; @@ -82,6 +90,70 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro return this._prestaciones; } + get laboratoriosFiltrados() { + if (!this.laboratorios) { return []; } + + let filtrados = this.laboratorios.filter(lab => { + if (this.tabIndexLaboratorio === 0) { + return lab.TipoServicio === 'LABORATORIO'; + } else if (this.tabIndexLaboratorio === 1) { + return lab.TipoServicio === 'MICROBIOLOGIA'; + } else if (this.tabIndexLaboratorio === 2) { + return lab.tipo === 'cda'; + } + return true; + }); + + if (this.tabIndexLaboratorio !== 2) { + if (this.tabIndexLaboratorio === 1 && this.filtroTipoMuestra && this.filtroTipoMuestra.length >= 5) { + filtrados = filtrados.filter(lab => lab.tipoMuestra && lab.tipoMuestra.toLowerCase().includes(this.filtroTipoMuestra.toLowerCase())); + } + if (this.filtroPracticaSolicitada && this.filtroPracticaSolicitada.length >= 5) { + filtrados = filtrados.filter(lab => lab.practicasSolicitadas && lab.practicasSolicitadas.toLowerCase().includes(this.filtroPracticaSolicitada.toLowerCase())); + } + } + + return filtrados; + } + + getMedicoSolicitante(laboratorio: any) { + if (laboratorio?.medicoSolicitante) { + return laboratorio.medicoSolicitante; + } + + const prof = laboratorio?.data?.profesional || laboratorio?.profesional; + if (!prof) { + return null; + } + + if (typeof prof === 'string') { + if (prof.includes('NO INFORMADO') || prof === '-, ') { + return 'NO INFORMADO'; + } + return prof; + } + + if (prof.nombre === 'NO INFORMADO' || prof.apellido === 'NO INFORMADO') { + return 'NO INFORMADO'; + } + + const nombre = prof.nombre || ''; + const apellido = prof.apellido || ''; + if (nombre && apellido && apellido !== '-') { + return `${apellido}, ${nombre}`; + } else if (nombre) { + return nombre; + } else if (apellido && apellido !== '-') { + return apellido; + } + + return null; + } + + onChangeTabLaboratorio(index) { + this.tabIndexLaboratorio = index; + } + set prestaciones(value) { this._prestaciones = value.sort((a, b) => { return moment(b.fecha).diff(a.fecha); @@ -312,6 +384,8 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro this.fechaInicio = this.fechaFin = this.prestacionSeleccionada = null; this.fechaInicioRecetas = this.fechaFinRecetas = null; this.tipoPrescripcionSeleccionado = this.tiposPrescripcion[0]; + this.filtroTipoMuestra = ''; + this.filtroPracticaSolicitada = ''; this.filtrar(); if (this.filtroActual === 'recetas') { this.filtrarRecetas(); diff --git a/src/app/modules/rup/components/ejecucion/hudsBusqueda.html b/src/app/modules/rup/components/ejecucion/hudsBusqueda.html index 527905031d..738c06ddea 100644 --- a/src/app/modules/rup/components/ejecucion/hudsBusqueda.html +++ b/src/app/modules/rup/components/ejecucion/hudsBusqueda.html @@ -25,13 +25,19 @@
{{ getTitulo(filtroActual) | uppercase }}
-
+
+ +
@@ -772,78 +778,123 @@
{{ getTitulo(filtroActual) | uppercas -
+ +
+ + -
    - -
  • -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - - {{ - laboratorio?.prestacion?.term}} - Informe de - laboratorio: - {{laboratorio?.TipoServicio}} - - -
    -
    -
    -
    - Protocolo: - {{laboratorio?.numero}} -
    -
    - Paciente: {{ laboratorio?.apellido - }}, {{ - laboratorio?.nombre }} -
    -
    - Organización: {{ - laboratorio?.data?.organizacion?.nombre || - laboratorio?.efectorSolicitante - }} -
    -
    - Fecha: {{laboratorio?.fecha - | date: - 'dd/MM/yyyy HH:mm' - }} -
    + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
      + +
    • +
      +
      +
      +
      +
      +
      + +
      + +
      +
      +
      -
      - Médico solicitante: {{ - laboratorio?.medicoSolicitante || - laboratorio?.profesional }} +
      +
      +
      + Protocolo: + {{laboratorio?.numero}} +
      +
      + Organización: {{ + laboratorio?.data?.organizacion?.nombre + || + laboratorio?.Laboratorio + }} +
      +
      + Tipo de Muestra: {{ + laboratorio?.tipoMuestra + }} +
      +
      + Práctica solicitada: {{ + laboratorio?.practicasSolicitadas + }} +
      +
      + Fecha: {{laboratorio?.fecha + | date: + 'dd/MM/yyyy HH:mm' + }} +
      +
      + Médico solicitante: {{ + getMedicoSolicitante(laboratorio) + }} +
      +
      +
      + + {{ (laboratorio.estado || laboratorio.Estado) === + 'EnProceso' ? 'En Proceso' : 'Con resultados' }} + + + {{ laboratorio.estado || laboratorio.Estado }} + +
      +
      -
      -
    • -
      -
    -
    +
  • +
    +
+
+
+
+
+ + +
+
+

diff --git a/src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.html b/src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.html index 8721098751..17c6c6ee38 100644 --- a/src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.html +++ b/src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.html @@ -22,11 +22,13 @@
Laboratorio{{protocolo.data.Laboratorio || protocolo.data.laboratorio}}
-
Tipo Muestra: - {{protocolo.data.tipoMuestra}}
+
+ Tipo Muestra: + {{protocolo.data.tipoMuestra}} +
Prácticas solicitadas: {{protocolo.data.practicasSolicitadas}} + *ngIf="protocolo.data.practicasSolicitadas">{{protocolo.data.practicasSolicitadas}}
@@ -35,7 +37,7 @@
+ tooltip="Descargar" (click)="descargarLab()">