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
4 changes: 3 additions & 1 deletion src/app/apps/rup/mapa-camas/mapa-camas.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import { IngresoPacienteService } from './sidebar/ingreso/ingreso-paciente-workf
import { PeriodosCensablesComponent } from './sidebar/periodos-censables/periodos-censables.component';
import { ListadoMedicamentosCapasComponent } from './views/listado-internacion-capas/listado-medicamentos-capas.component';
import { CITASLibModule } from '../../../components/turnos/citas.module';
import { MapaCamasResumenComponent } from './views/mapa-camas-capa/mapa-camas-resumen.component';

export const INTERNACION_COMPONENTS = [
MapaCamasMainComponent,
Expand Down Expand Up @@ -116,7 +117,8 @@ export const INTERNACION_COMPONENTS = [
RecursosListadoComponent,
ResumenInternacionComponent,
TimelineMapaCamasComponent,
PeriodosCensablesComponent
PeriodosCensablesComponent,
MapaCamasResumenComponent
];

export const INTERNACION_PROVIDERS = [
Expand Down
6 changes: 4 additions & 2 deletions src/app/apps/rup/mapa-camas/mapa-camas.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { MapaCamasCapaComponent } from './views/mapa-camas-capa/mapa-camas-capa.
import { ResumenInternacionComponent } from './views/resumen-internacion/resumen-internacion.component';
import { SalaComunComponent } from './views/sala-comun/sala-comun.component';
import { TimelineMapaCamasComponent } from './views/timelinea-mapa-camas/timeline-mapa-camas.component';
import { MapaCamasResumenComponent } from './views/mapa-camas-capa/mapa-camas-resumen.component';

export const INTERNACION_ROUTES = [

Expand Down Expand Up @@ -52,8 +53,9 @@ export const INTERNACION_ROUTES = [
},

{ path: ':ambito/:capa', component: MapaCamasCapaComponent, pathMatch: 'full' },

{ path: '', redirectTo: 'internacion', pathMatch: 'full' }
{ path: ':ambito/:capa/:idOrganizacion', component: MapaCamasCapaComponent, pathMatch: 'full' },
{ path: ':ambito/resumen/:capa/:idOrganizacion', component: MapaCamasResumenComponent, pathMatch: 'full' },
{ path: '', component: MapaCamasMainComponent }

];

Expand Down
5 changes: 3 additions & 2 deletions src/app/apps/rup/mapa-camas/services/mapa-camas.http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ export class MapaCamasHTTP {
private server: Server
) { }

snapshot(ambito: string, capa: string, fecha: Date, idInternacion: string = null, estado: string = null, idCama: string = null): Observable<ISnapshot[]> {
snapshot(ambito: string, capa: string, fecha: Date, idInternacion: string = null, estado: string = null, idCama: string = null, idOrganizacion: string = null): Observable<ISnapshot[]> {
return this.server.get(`${this.url}/camas`, {
params: {
ambito,
capa,
fecha,
internacion: idInternacion,
estado,
cama: idCama
cama: idCama,
organizacion: idOrganizacion
}
});
}
Expand Down
10 changes: 5 additions & 5 deletions src/app/apps/rup/mapa-camas/services/mapa-camas.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class MapaCamasService {
this.fecha2
]).pipe(
switchMap(([ambito, capa, fecha]) => {
return this.camasHTTP.snapshot(ambito, capa, fecha).pipe(
return this.camasHTTP.snapshot(ambito, capa, fecha, null, null, null, this.organizacion2.getValue()).pipe(
map(snapshot => [snapshot, fecha])
);
}),
Expand Down Expand Up @@ -396,11 +396,11 @@ export class MapaCamasService {
camasFiltradas = camasFiltradas.filter((snap: ISnapshot) =>
snap.paciente.documento.includes(paciente) || snap.paciente.numeroIdentificacion?.includes(paciente));
} else {
camasFiltradas = camasFiltradas.filter((snap: ISnapshot) =>
(snap.paciente.nombre.toLowerCase().includes(paciente.toLowerCase()) ||
camasFiltradas = camasFiltradas.filter((snap: ISnapshot) => (
snap.paciente.nombre.toLowerCase().includes(paciente.toLowerCase()) ||
snap.paciente.alias?.toLowerCase().includes(paciente.toLowerCase()) ||
snap.paciente.apellido.toLowerCase().includes(paciente.toLowerCase()))
);
snap.paciente.apellido.toLowerCase().includes(paciente.toLowerCase())
));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
[data]="estadoList$ | async" (change)="filtrar()">
</plex-select>

<plex-button class="collapse-button" type="primary" size="sm" icon="{{ collapse ? 'chevron-down' : 'chevron-up'}}"
<plex-button *ngIf="filtroCompleto" class="collapse-button" type="primary" size="sm"
icon="{{ collapse ? 'chevron-down' : 'chevron-up'}}"
title="{{ collapse ? 'Expandir' : 'Colapsar'}}" titlePosition="left" (click)="colapsar()">
</plex-button>

<div [hidden]="collapse" class="w-100">
<div *ngIf="filtroCompleto" [hidden]="collapse" class="w-100">
<div class="d-flex">
<plex-select name="tipo-cama" label="Tipo de Cama" [(ngModel)]="filtro.tipoCama" idField="conceptId"
labelField="term" (change)="filtrar()" [data]="tipoCamaList$ | async">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { arrayToSet } from '@andes/shared';
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { Observable, combineLatest } from 'rxjs';
import { filter, map, tap } from 'rxjs/operators';
import { MapaCamasService } from '../../../services/mapa-camas.service';
Expand All @@ -22,6 +22,8 @@ export class FiltrosCamasComponent implements OnInit {
public paciente = '';
public collapse = true;

@Input() filtroCompleto = true;

filtro: any = {};
censables = [
{ id: 0, nombre: 'No censable' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ export class MapaCamasCapaComponent implements OnInit, OnDestroy {
this.ws.connect();
this.mapaCamasService.resetView();
const ambito = this.route.snapshot.paramMap.get('ambito');
const idOrganizacion = this.route.snapshot.paramMap.get('idOrganizacion') ? this.route.snapshot.paramMap.get('idOrganizacion') : this.auth.organizacion.id;
this.mapaCamasService.setAmbito(ambito);
this.mapaCamasService.setOrganizacion(idOrganizacion);
this.permisosMapaCamasService.setAmbito(ambito);
this.mainView$.subscribe(mainView => {
this.registro = {
Expand Down Expand Up @@ -169,11 +171,11 @@ export class MapaCamasCapaComponent implements OnInit, OnDestroy {
);

this.mapaCamasService.setFecha(new Date());
this.mapaCamasService.setOrganizacion(this.auth.organizacion.id);
// this.mapaCamasService.setOrganizacion(this.auth.organizacion.id);
this.mapaCamasService.select(null);

this.columns = this.mapaCamasService.columnsMapa.getValue();
this.organizacionService.usaCapasUnificadas(this.auth.organizacion.id).pipe(
this.organizacionService.usaCapasUnificadas(idOrganizacion).pipe(
take(1),
tap(resp => this.organizacionv2 = resp)
).subscribe();
Expand All @@ -189,6 +191,7 @@ export class MapaCamasCapaComponent implements OnInit, OnDestroy {
this.fechaSelector = moment();
this.fechaInput = moment().format('DD/MM/YYYY HH:mm');
}

buscarArea(viewProtocolo) {
this.laboratorioService.getProtocoloById(viewProtocolo.idProtocolo).subscribe((resultados) => {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import { Auth } from '@andes/auth';
import { Plex } from '@andes/plex';
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { ElementosRUPService } from 'src/app/modules/rup/services/elementosRUP.service';
import { OrganizacionService } from 'src/app/services/organizacion.service';
import { WebSocketService } from 'src/app/services/websocket.service';
import { IMaquinaEstados } from '../../interfaces/IMaquinaEstados';
import { ISnapshot } from '../../interfaces/ISnapshot';
import { MapaCamasService } from '../../services/mapa-camas.service';
import { PermisosMapaCamasService } from '../../services/permisos-mapa-camas.service';
import { Location } from '@angular/common';

@Component({
selector: 'app-mapa-camas-resumen',
templateUrl: 'mapa-camas-resumen.html',
styleUrls: ['./mapa-camas-capa.component.scss']

})

export class MapaCamasResumenComponent implements OnInit {

@ViewChild(CdkVirtualScrollViewport, { static: false })
public viewPort: CdkVirtualScrollViewport;

@ViewChild('helpFecha', { read: ElementRef }) helpFechaRef: ElementRef;

selectedCama$: Observable<ISnapshot>;
organizacion: string;
fecha = moment().toDate();
camas$: Observable<any[]>;
snapshot: ISnapshot[];
itemsCensoDropdown = [];
estadoRelacion: any;
estadosCama: any;
maquinaEstados: IMaquinaEstados;
opcionesCamas = [];
accion = null;
cambiarUO;
listadoRecursos = false;
camasDisponibles;
fecha$: Observable<Date>;
organizacionv2; // true si la organizacion usa capas unificadas
estado$: Observable<IMaquinaEstados>;
capaActual: string;
fechaBusqueda: Date;

public sortBy: string;
public sortOrder = 'desc';
public fechaSelector;
public fechaInput;
public isValidDate = true;
public dataOrganizacion;

public columns = {
fechaMovimiento: false,
fechaIngreso: false,
documento: false,
sexo: false,
sector: false,
usuarioMovimiento: false,
diasEstada: false
};

public equipos = {
aporteOxigeno: false,
respirador: false,
monitorParamedico: false,
usaRespirador: false
};

public estadoCama = {
ocupada: { label: 'OCUPADA', type: 'warning' },
bloqueada: { label: 'BLOQUEADA', type: 'default' },
disponible: { label: 'DISPONIBLE', type: 'success' }
};

constructor(
public auth: Auth,
private plex: Plex,
private router: Router,
private route: ActivatedRoute,
public mapaCamasService: MapaCamasService,
public permisosMapaCamasService: PermisosMapaCamasService,
public elementoRUPService: ElementosRUPService,
public ws: WebSocketService,
public organizacionService: OrganizacionService

) { }

ngOnInit() {
this.mapaCamasService.resetView();
const ambito = this.route.snapshot.paramMap.get('ambito');
const idOrganizacion = this.route.snapshot.paramMap.get('idOrganizacion') ? this.route.snapshot.paramMap.get('idOrganizacion') : this.auth.organizacion.id;
const capa = this.route.snapshot.paramMap.get('capa');
this.mapaCamasService.setAmbito(ambito);
this.mapaCamasService.setOrganizacion(idOrganizacion);
this.permisosMapaCamasService.setAmbito(ambito);
this.mapaCamasService.setCapa(capa);
this.capaActual = capa;
this.fechaBusqueda = new Date();


this.plex.updateTitle([{
route: '/inicio',
name: 'Andes'
}, {
name: 'Mapa de Camas'
}, {
name: ambito
}]);

this.mapaCamasService.setView('mapa-camas');
this.mapaCamasService.setFecha(new Date());
this.mapaCamasService.select(null);

this.columns = this.mapaCamasService.columnsMapa.getValue();
this.estado$ = this.mapaCamasService.maquinaDeEstado$.pipe(
map(estado => estado)
);

this.organizacionService.getById(idOrganizacion).subscribe(organizacion => {
this.dataOrganizacion = organizacion;
});

this.getSnapshot();

}

getSnapshot(fecha = null) {
if (!fecha) {
fecha = this.fecha;
}
this.camas$ = this.mapaCamasService.snapshotOrdenado$.pipe(
map(snapshots => {
return snapshots.filter(snap => snap.estado !== 'inactiva' && snap.esCensable);
})
);
}

sortTable(event: string) {
if (this.sortBy === event) {
this.sortOrder = (this.sortOrder === 'asc') ? 'desc' : 'asc';
this.mapaCamasService.sortOrder.next(this.sortOrder);
} else {
this.sortBy = event;
this.mapaCamasService.sortBy.next(event);
this.mapaCamasService.sortOrder.next('desc');
}
}

volver() {
this.router.navigate([
'com',
'estados-cama-provincial'
]);
}

}
Loading