Skip to content

Commit

Permalink
feat(in): registro de respiracion asistida para internacion
Browse files Browse the repository at this point in the history
  • Loading branch information
negro89 committed Dec 16, 2021
1 parent a1690e8 commit 53ae7f5
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 30 deletions.
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 @@ -63,6 +63,7 @@ import { ResumenInternacionComponent } from './views/resumen-internacion/resumen
import { SalaComunComponent } from './views/sala-comun/sala-comun.component';
import { SalaComunService } from './views/sala-comun/sala-comun.service';
import { TimelineMapaCamasComponent } from './views/timelinea-mapa-camas/timeline-mapa-camas.component';
import { DispositivoService } from '../../../services/dispositivo/dispositivo.service';



Expand Down Expand Up @@ -117,7 +118,8 @@ export const INTERNACION_PROVIDERS = [
ScrollDispatcher,
IntegridadService,
PermisosMapaCamasService,
PlanIndicacionesEventosServices
PlanIndicacionesEventosServices,
DispositivoService
];

@NgModule({
Expand Down
2 changes: 1 addition & 1 deletion src/app/apps/rup/mapa-camas/services/mapa-camas.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ export class MapaCamasService {
if (unidadOrganizativa.length === 0) {
return true;
}
const isExclude = unidadOrganizativa[0].startsWith('!');
const isExclude = unidadOrganizativa[0]?.startsWith('!');
if (!isExclude) {
return unidadOrganizativa.includes(uo.conceptId);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,34 +72,36 @@
</ng-container>
<ng-container *ngIf="cama.paciente">
<plex-title size="sm" justify titulo="DATOS DE PACIENTE">

<plex-button *ngIf="capa !== 'enfermeria'" label="EXPLORACIÓN VISUAL" size="sm" type="info"
(click)="onVerResumen(cama)" class="mr-1">
</plex-button>

<ng-container *feature="'planIndicaciones'">
<plex-button *ngIf="capa !== 'estadistica'" label="INDICACIONES" size="sm" type="info"
(click)="onVerIndicaciones(cama)" class="mr-1">
</plex-button>
</ng-container>

<ng-container *ngIf="turnero$ | async as pantalla">
<plex-button (click)="llamarTurnero(pantalla, cama)" size="sm" type="info" class="mr-2">
<plex-icon name="bell-ring-outline"></plex-icon>
</plex-button>

<ng-container *ngIf="pacienteResumen$ | async as pacienteResumen">
<plex-badge *ngIf="registraRespirador(pacienteResumen.registros?.valor)" class="pr-1" type="info">
Respirador
<plex-icon name="{{ pacienteResumen.registros.valor.dispositivo?.icono }}"> </plex-icon>
</plex-badge>
</ng-container>

<ng-container *ngIf="(accionesEstado$ | async)?.length > 0 && permisosMapaCamasService.registros">
<plex-button size="sm" type="success" (click)="onNuevoRegistrio()"> NUEVO REGISTRO </plex-button>
</ng-container>
<ng-container *ngIf="!cama.sala && hayMovimientosAt$ | async">
<!-- <plex-button tooltip="Deshacer Internacion" icon="account-off" type="danger" size="sm"
(click)="deshacerInternacion(cama)">
</plex-button> -->
<plex-dropdown right="true" size="sm" icon="account-off" type="danger"
<plex-dropdown class="pr-1" right="true" size="sm" icon="account-off" type="danger"
tooltip="Deshacer Internacion" [items]="items">
</plex-dropdown>
</ng-container>

<plex-dropdown right="true" size="sm" type="primary" icon='chevron-down' tooltip="Opciones">
<div class="text-right">
<plex-button *ngIf="capa !== 'enfermeria'" label="EXPLORACIÓN VISUAL" size="sm" type="info" (click)="onVerResumen(cama)">
</plex-button>

<ng-container *ngIf="turnero$ | async as pantalla">
<plex-button (click)="llamarTurnero(pantalla, cama)" size="sm" type="info">
<plex-icon name="bell-ring-outline"></plex-icon>
</plex-button>
</ng-container>

<ng-container *ngIf="(accionesEstado$ | async)?.length > 0 && permisosMapaCamasService.registros">
<plex-button size="sm" type="success" (click)="onNuevoRegistrio()"> NUEVO REGISTRO </plex-button>
</ng-container>
</div>
</plex-dropdown>
</plex-title>
<fieldset>
<paciente-detalle [paciente]="paciente$ | async" orientacion="horizontal" [fields]="pacienteFields">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class CamaDetalleComponent implements OnInit {
public camaSelectedSegunView$: Observable<ISnapshot> = this.mapaCamasService.camaSelectedSegunView$;

public turnero$: Observable<string>;
public pacienteResumen$: Observable<any>;

items = [
{
Expand Down Expand Up @@ -137,6 +138,8 @@ export class CamaDetalleComponent implements OnInit {
return historial.length > 0 && tieneIDMov && !egreso;
})
);

this.pacienteResumen$ = this.mapaCamasService.resumenInternacion$;
}

sector(cama: ISnapshot) {
Expand Down Expand Up @@ -235,10 +238,12 @@ export class CamaDetalleComponent implements OnInit {
}

onVerIndicaciones(cama: ISnapshot) {
// this.motivoAccesoService.getAccessoHUDS(cama.paciente as IPaciente).subscribe(() => {
const capa = this.mapaCamasService.capa;
const ambito = this.mapaCamasService.ambito;
this.router.navigate([`/mapa-camas/${ambito}/${capa}/plan-indicaciones/${cama.idInternacion}`]);
// });
}

registraRespirador(respirador) {
return respirador?.fechaDesde;
}
}
4 changes: 3 additions & 1 deletion src/app/modules/rup/components/core/rup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { IElementoRUP, IElementoRUPRequeridos } from './../../interfaces/element
import { ConceptObserverService } from './../../services/conceptObserver.service';
import { ElementosRUPService } from './../../services/elementosRUP.service';
import { PrestacionesService } from './../../services/prestaciones.service';
import { DispositivoService } from '../../../../services/dispositivo/dispositivo.service';

@Component({
selector: 'rup',
Expand Down Expand Up @@ -149,7 +150,8 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy {
public driveService: DriveService,
@Optional() public ejecucionService: RupEjecucionService,
public pacienteService: PacienteService,
public plexVisualizador: PlexVisualizadorService
public plexVisualizador: PlexVisualizadorService,
public dispositivoService: DispositivoService
) {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, OnInit } from '@angular/core';
import { RUPComponent } from './../core/rup.component';
import { RupElement } from '.';

@Component({
selector: 'rup-destete-ventilacion-mecanica',
templateUrl: 'desteteVentilacionMecanica.html'
})
@RupElement('DesteteVentilacionMecanicaComponent')
export class DesteteVentilacionMecanicaComponent extends RUPComponent implements OnInit {
public hoy = new Date();
public fechaDestete: Date;

ngOnInit() {
this.fechaDestete = this.registro?.valor?.fecha || null;
}

changeValue() {
this.registro.valor = { fecha : this.fechaDestete };
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<plex-datetime *ngIf="!soloValores" type="datetime" name="fechaHasta" label="Fecha hasta" [(ngModel)]="fechaDestete"
[required]="true" [max]="hoy" (change)="changeValue()">
</plex-datetime>

<ng-container *ngIf="soloValores">
<p class="readonly">
<plex-label><b>Fecha hasta: &nbsp;</b> {{ registro.valor.fecha | date:'dd/MM/yyyy HH:mm' }}</plex-label>
</p>
</ng-container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { RUPComponent } from './../core/rup.component';
import { RupElement } from '.';

@Component({
selector: 'rup-respiracion-asistida',
templateUrl: 'respiracionAsistida.html'
})
@RupElement('RespiracionAsistidaComponent')
export class RespiracionAsistidaComponent extends RUPComponent implements OnInit {
public dispositivos = [];
public hoy = new Date();
public respirador: {
dispositivo: any;
fechaDesde: Date;
};

ngOnInit() {
this.dispositivoService.search().subscribe(disp => this.dispositivos = disp);
this.respirador = this.registro.valor || { dispositivo: null, fechaDesde: null};
}

setValues() {
this.registro.valor = {
dispositivo: this.respirador.dispositivo,
fechaDesde: this.respirador.fechaDesde
};
}
}
17 changes: 17 additions & 0 deletions src/app/modules/rup/components/elementos/respiracionAsistida.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="w-100">
<plex-grid *ngIf="!soloValores" cols="2">
<plex-select name="dispositivo" label="Dispositivo" [(ngModel)]="respirador.dispositivo" idField="_id" labelField="descripcion"
[required]="true" [data]="dispositivos" (change)="setValues()"></plex-select>
<plex-datetime type="datetime" name="fechaDesde" label="Fecha desde" [(ngModel)]="respirador.fechaDesde" [required]="true"
[max]="hoy" (change)="setValues()"></plex-datetime>
</plex-grid>

<ng-container *ngIf="soloValores">
<p class="readonly">
<plex-label><b>Dispositivo: &nbsp;</b> {{ registro.valor.dispositivo.descripcion }}</plex-label>
</p>
<p class="readonly">
<plex-label><b>Fecha desde: &nbsp;</b> {{ registro.valor.fechaDesde | date:'dd/MM/yyyy HH:mm' }}</plex-label>
</p>
</ng-container>
</div>
7 changes: 6 additions & 1 deletion src/app/modules/rup/elementos-rup.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ import { VistaPrestacionComponent } from './components/huds/vistaPrestacion';
import { ElementoRUPByIdPipes } from './pipes/elemento-rup-id.pipes';
import { SemanticClassPipe } from './pipes/semantic-class.pipes';
import { SemanticIconPipe } from './pipes/semantic-icon.pipes';
import { RespiracionAsistidaComponent } from './components/elementos/respiracionAsistida.component';
import { DesteteVentilacionMecanicaComponent } from './components/elementos/desteteVentilacionMecanica.component';


const RUPComponentsArray = [
RUPComponent,
Expand Down Expand Up @@ -124,7 +127,9 @@ const RUPComponentsArray = [
InternacionIngresoComponent,
ChecklistComponent,
VacunasComponent,
SolicitudPrescripcionMedicamentoComponent
SolicitudPrescripcionMedicamentoComponent,
RespiracionAsistidaComponent,
DesteteVentilacionMecanicaComponent
];

@NgModule({
Expand Down
4 changes: 4 additions & 0 deletions src/app/modules/rup/huds.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ElementosRUPModule } from './elementos-rup.module';
import { HUDSLibModule } from './huds-lib.module';
import { RUPLibModule } from './rup-lib.module';
import { HUDSTimelineComponent } from './views/huds-timeline/huds-timeline.component';
import { DispositivoService } from '../../services/dispositivo/dispositivo.service';

@NgModule({
imports: [
Expand All @@ -40,6 +41,9 @@ import { HUDSTimelineComponent } from './views/huds-timeline/huds-timeline.compo
HudsBusquedaPacienteComponent,
VistaHudsComponent,
HUDSTimelineComponent
],
providers: [
DispositivoService
]
})
export class HUDSModule {
Expand Down
7 changes: 5 additions & 2 deletions src/app/modules/rup/rup.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { RUPServicioIntermedioAltaComponent } from './components/servicio-interm
import { ElementosRUPModule } from './elementos-rup.module';
import { HUDSLibModule } from './huds-lib.module';
import { RUPLibModule } from './rup-lib.module';
import { DispositivoService } from '../../services/dispositivo/dispositivo.service';


export const RUP_COMPONENTS = [
PuntoInicioComponent,
Expand All @@ -42,6 +44,7 @@ export const RUP_COMPONENTS = [
];

export const RUP_PROVIDERS = [
DispositivoService
];

@NgModule({
Expand Down Expand Up @@ -75,8 +78,8 @@ export const RUP_PROVIDERS = [
declarations: [
...RUP_COMPONENTS
],
exports: [
],
exports: [],
providers: RUP_PROVIDERS
})
export class RUPModule {

Expand Down

0 comments on commit 53ae7f5

Please sign in to comment.