Skip to content

Commit

Permalink
fix(mapa-camas): ajuste control fecha maximo de egreso (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
liquid36 authored Apr 28, 2021
1 parent 43f16be commit f96b594
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/apps/rup/mapa-camas/services/mapa-camas.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ export class MapaCamasService {
return this.camasHTTP.snapshot(ambito, capa, fecha, idInternacion, estado) as any;
}

historial(type: 'cama' | 'internacion', desde: Date, hasta: Date = null): Observable<ISnapshot[]> {
historial(type: 'cama' | 'internacion', desde: Date, hasta: Date = null, cama: ISnapshot = null): Observable<ISnapshot[]> {
return combineLatest(
this.ambito2,
this.capa2,
Expand All @@ -461,7 +461,7 @@ export class MapaCamasService {
switchMap(([ambito, capa, selectedCama, selectedPrestacion, view]) => {
hasta = hasta || new Date();
if (type === 'cama') {
return this.camasHTTP.historial(ambito, capa, desde, hasta, { idCama: selectedCama.idCama });
return this.camasHTTP.historial(ambito, capa, desde, hasta, { idCama: cama ? cama.idCama : selectedCama.idCama });
} else if (type === 'internacion') {
if (view === 'mapa-camas' && selectedCama.idInternacion) {
return this.camasHTTP.historialInternacion(ambito, capa, desde, hasta, selectedCama.idInternacion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ export class EgresarPacienteComponent implements OnInit, OnDestroy {
if (this.subscription4) {
this.subscription4.unsubscribe();
}
this.subscription4 = this.mapaCamasService.historial('cama', this.cama.fecha, moment().toDate()).subscribe(
this.subscription4 = this.mapaCamasService.historial('cama', this.cama.fecha, moment().toDate(), this.cama).subscribe(
(historialCama) => {
this.fechaMax = null;
for (const historial of historialCama) {
Expand Down

0 comments on commit f96b594

Please sign in to comment.