Skip to content

Commit

Permalink
fix(CITAS): visualizacion de turnos agenda dinamica (#2711)
Browse files Browse the repository at this point in the history
  • Loading branch information
palita1991 authored and plammel committed Jul 25, 2022
1 parent a133273 commit 3d2e6bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export class PermisosMapaCamasService {
public censo = false;
public descargarListado = false;
public registros = false;
indicacionesVer;
indicacionesCrear;
indicacionesEjecutar;
indicacionesValidar;

constructor(
private auth: Auth,
) { }
Expand All @@ -43,6 +48,10 @@ export class PermisosMapaCamasService {
this.bloqueo = this.auth.check(`${this.ambito}:bloqueo`);
this.censo = this.auth.check(`${this.ambito}:censo`);
this.descargarListado = this.auth.check(`${this.ambito}:descargarListado`);
this.indicacionesVer = this.auth.check(`${this.ambito}:indicaciones`);
this.indicacionesCrear = this.auth.check(`${this.ambito}:indicaciones:create`);
this.indicacionesEjecutar = this.auth.check(`${this.ambito}:indicaciones:ejecutar`);
this.indicacionesValidar = this.auth.check(`${this.ambito}:indicaciones:validar`);
this.registros = this.auth.check('internacion:registros');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ export class CamaDetalleComponent implements OnInit {
public titleColor;
public tabIndex = 0;
public editar = false;
public permisoIngreso = false;
canUndo = false;
pacienteFields = ['sexo', 'fechaNacimiento', 'edad', 'cuil', 'financiador', 'numeroAfiliado', 'direccion', 'telefono'];
public nota: String;
public editNota = false;
Expand Down Expand Up @@ -103,10 +101,10 @@ export class CamaDetalleComponent implements OnInit {
switchMap(cama => cama.paciente ? this.mapaCamasService.getPaciente(cama.paciente) : of(null))
);

this.turnero$ = combineLatest(
this.turnero$ = combineLatest([
this.cama$,
this.mapaCamasService.maquinaDeEstado$
).pipe(
]).pipe(
map(([cama, estado]) => {
if (cama.idInternacion) {
const turnero = estado.turnero || {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<!-- <plex-icon name=""></plex-icon> -->
</div>
<div class="item__botonera">
<plex-button *ngIf="detener$ | async" type="danger" icon="stop" size="sm"
<plex-button *ngIf="permisosMapaCamasService.indicacionesEjecutar && detener$ | async" type="danger" icon="stop" size="sm"
(click)="onDetenerClick()" tooltip="Suspender" tooltipPosition="bottom">
</plex-button>
<plex-button *ngIf="continuar$ | async" type="success" icon="play" size="sm"
(click)="onContinuarClick()" tooltip="Continuar" tooltipPosition="bottom">
</plex-button>
<plex-button *ngIf="hayDraft" type="warning" size="sm" class="ml-2"
<plex-button *ngIf="hayDraft && permisosMapaCamasService.indicacionesEjecutar" type="warning" size="sm" class="ml-2"
(click)="onValidar()">
Validar Pendientes
</plex-button>
Expand All @@ -52,7 +52,7 @@
<h6 class="item__title">{{ seccion.concepto.term }}</h6>
</div>
<div class="item__botonera">
<plex-button *ngIf="isToday" size="sm" type="info" icon="plus" (click)="onNuevaIndicacion(seccion)"
<plex-button *ngIf="isToday && permisosMapaCamasService.indicacionesCrear" size="sm" type="info" icon="plus" (click)="onNuevaIndicacion(seccion)"
tooltip="Agregar indicación">
</plex-button>
<plex-button type="info" size="sm"
Expand Down Expand Up @@ -117,7 +117,7 @@ <h3>
borrador
</plex-badge>

<div *ngIf="!indicacionEventoSelected && !nuevaIndicacion && !indicacion.readonly"
<div *ngIf="permisosMapaCamasService.indicacionesEjecutar && !indicacionEventoSelected && !nuevaIndicacion && !indicacion.readonly"
in-plan-indicacion-botonera [indicacion]="indicacion"
(refresh)="actualizar()" (cancelIndicacion)="cancelIndicacion($event)">
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject, forkJoin, Observable } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import { PermisosMapaCamasService } from '../../services/permisos-mapa-camas.service';
import { HeaderPacienteComponent } from 'src/app/components/paciente/headerPaciente.component';
import { PacienteService } from 'src/app/core/mpi/services/paciente.service';
import { RupEjecucionService } from 'src/app/modules/rup/services/ejecucion.service';
import { ElementosRUPService } from 'src/app/modules/rup/services/elementosRUP.service';
import { HUDSService } from 'src/app/modules/rup/services/huds.service';
import { PrestacionesService } from '../../../../../modules/rup/services/prestaciones.service';
import { MaquinaEstadosHTTP } from '../../services/maquina-estados.http';
Expand All @@ -29,7 +29,6 @@ export class PlanIndicacionesComponent implements OnInit {
private ambito: string;
private idInternacion: string;
private paciente: any;
private maquinaEsados: any[];
public indicacion;
public fecha = new Date();
public hoy = new Date();
Expand All @@ -40,8 +39,6 @@ export class PlanIndicacionesComponent implements OnInit {
public selectedIndicacion = {};
private selectedBuffer = new BehaviorSubject({});

private seccion = true;

public suspenderIndicacion: Boolean;
public showSecciones = {

Expand Down Expand Up @@ -95,6 +92,7 @@ export class PlanIndicacionesComponent implements OnInit {
seccionesActivas: any[] = [];

constructor(
public permisosMapaCamasService: PermisosMapaCamasService,
private prestacionService: PrestacionesService,
private route: ActivatedRoute,
private resumenInternacionService: InternacionResumenHTTP,
Expand All @@ -105,7 +103,6 @@ export class PlanIndicacionesComponent implements OnInit {
private hudsService: HUDSService,
private auth: Auth,
private maquinaEstadoService: MaquinaEstadosHTTP,
private elementoRUPService: ElementosRUPService,
public ejecucionService: RupEjecucionService
) { }

Expand Down

0 comments on commit 3d2e6bc

Please sign in to comment.