Skip to content

Commit

Permalink
feat(IN): muestra deshacerInternacion en capa medica
Browse files Browse the repository at this point in the history
  • Loading branch information
ma7payne committed Mar 23, 2023
1 parent 7ba095c commit 87d3ee2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<!-- ESTADISTICA-V2 -->
<app-informe-ingreso-estadistica-v2 *ngIf="capa !== 'estadistica'" (accion)="onAccion($event)"
(cancel)="activateOption('ingreso')" (toggleEditar)="toggleEdit()">
<ng-container *ngIf="anular$ | async">
<plex-button size="sm" icon="account-off" type="danger" tooltip="Deshacer Internacion"
tooltipPosition="left" (click)="onAnularInternacion()">
<ng-container *ngIf="hayMovimientosSinEgresoAt$ | async">
<plex-button *ngIf="capa !== 'interconsultores'" size="sm" icon="account-off" type="danger"
tooltip="Deshacer Internacion" tooltipPosition="left" (click)="onAnularInternacion()">
</plex-button>
</ng-container>
</app-informe-ingreso-estadistica-v2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class InternacionDetalleComponent implements OnInit, OnDestroy, AfterView

public mostrar;
public hayMovimientosAt$: Observable<Boolean>;
public hayMovimientosSinEgresoAt$: Observable<Boolean>;
public anular$: Observable<Boolean>;
public capa;

Expand Down Expand Up @@ -114,6 +115,16 @@ export class InternacionDetalleComponent implements OnInit, OnDestroy, AfterView
})
);

this.hayMovimientosSinEgresoAt$ = this.mapaCamasService.historialInternacion$.pipe(
map((historial) => {
const egreso = historial.some(mov => mov.extras?.egreso);
const tieneIDMov = historial.every(
mov => mov.extras?.ingreso || mov.extras?.idMovimiento
);
return historial.length > 0 && tieneIDMov && !egreso;
})
);

this.anular$ = combineLatest([
this.mapaCamasService.selectedPrestacion,
this.hayMovimientosAt$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
tooltip="Editar ingreso" tooltipPosition="left" icon="pencil" type="warning" size="sm"
(click)="toggleEdit()" class="mr-1">
</plex-button>
<ng-content></ng-content>
</plex-title>
<paciente-detalle *ngIf="paciente$ | async as paciente" [paciente]="paciente" orientacion="horizontal"
[fields]="pacienteFields">
Expand Down

0 comments on commit 87d3ee2

Please sign in to comment.