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 @@ -112,6 +112,27 @@ export class PrestacionValidacionComponent implements OnInit, OnDestroy {
return this.prestacion && this.prestacion.estados[this.prestacion.estados.length - 1].tipo === 'validada';
}

get ultimoValidador() {
if (this.prestacion && this.prestacion.estados) {
const estados = [...this.prestacion.estados].reverse();
return estados.find(e => e.tipo === 'validada');
}
return null;
}

get profesionales() {
let profesionales = [...(this.prestacion?.profesionalesRegistrantes || [])];
if (this.ultimoValidador) {
const validador = this.ultimoValidador.createdBy;
const index = profesionales.findIndex(p => (p.id || p._id) === (validador.id || validador._id) || String(p.documento) === String(validador.documento));
if (index > -1) {
const [v] = profesionales.splice(index, 1);
profesionales = [v, ...profesionales];
}
}
return profesionales;
}

ngOnDestroy() {
this.prestacionSubscription.unsubscribe();
}
Expand Down Expand Up @@ -404,6 +425,14 @@ export class PrestacionValidacionComponent implements OnInit, OnDestroy {
this.router.navigate(['rup/ejecucion/', this.prestacion.id]);
}

esValidador(profesional) {
if (!this.ultimoValidador) {
return false;
}
const validador = this.ultimoValidador.createdBy;
return (validador.id === profesional.id || validador.id === profesional._id || String(validador.documento) === String(profesional.documento));
}

volverInicio(ambito = 'ambulatorio', ruta = null) {
let mensaje = ambito === 'ambulatorio' ? 'Punto de Inicio' : 'Mapa de Camas';
let ruteo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,21 @@
</div>
</plex-layout-main>
<plex-layout-sidebar *ngIf="prestacion.solicitud.ambitoOrigen == 'ambulatorio'">
<!-- Mostrar profesionales que registraron datos -->
<plex-box type="default" class="profesionales" *ngIf="profesionales?.length > 0">
<plex-title titulo="Profesional/es que registra/n" size="sm"></plex-title>
<plex-list>
<plex-item *ngFor="let profesional of profesionales">
<plex-label size="sm" icon="account" [titulo]="profesional.nombre + ' ' + profesional.apellido"
[subtitulo]="'DNI: ' + profesional.documento">
</plex-label>
<plex-label *ngIf="esValidador(profesional)" size="sm" type="success"
[titulo]="'Validado el ' + (ultimoValidador.createdAt | fecha)"
[subtitulo]="'a las ' + (ultimoValidador.createdAt | date: 'HH:mm') + ' hs'">
</plex-label>
</plex-item>
</plex-list>
</plex-box>
<rup-relaciones [registros]="prestacion.ejecucion.registros"></rup-relaciones>
</plex-layout-sidebar>
<plex-layout-footer *ngIf="!showDarTurnos">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
background-color: $invert !important;
}

plex-box.profesionales {
background-color: $invert !important;
height: auto !important;
flex: 0 0 auto !important;
display: block !important;

::ng-deep .plex-box {
height: auto !important;
flex: 0 0 auto !important;
min-height: initial !important;
}
}

.btn-orden {
height: 28px;
width: 28px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export class PuntoInicioComponent implements OnInit, OnDestroy {
return (profesional.id === this.auth.profesional);
}));
});

}

// por tipo de prestación
Expand Down
3 changes: 2 additions & 1 deletion src/app/modules/rup/components/huds/relaciones-rup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<ng-container *ngFor="let rama of registrosRelaciones.relacionesOrdenadas;">
<ul class="list-group">
<li [class.ml-0]="!rama.esDiagnosticoPrincipal"
class="list-group-item pl-0 pt-0 pb-0 mb-0 ml-{{ registrosRelaciones.registrosDeep[rama.id] }}">
class="list-group-item pl-0 pt-0 pb-0 mb-0 ml-{{ registrosRelaciones.registrosDeep[rama.id] }}"
title="Cargado por: {{ (rama.createdBy?.nombreCompleto || (rama.createdBy?.nombre + ' ' + rama.createdBy?.apellido)) || 'Desconocido' }}">
<div>
<span
class="type {{ rama.esSolicitud ? 'solicitud' : rama.concepto.semanticTag }} pr-2 mr-1"></span>
Expand Down
9 changes: 9 additions & 0 deletions src/app/modules/rup/interfaces/prestacion.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ export class IPrestacion {
id: string;
};

// Listado de profesionales que han registrado datos en esta prestación
profesionalesRegistrantes?: {
id: string;
nombreCompleto: string;
nombre: string;
apellido: string;
documento: number;
}[];

metadata: { key: string; valor: any }[];

/**
Expand Down