Skip to content

Commit

Permalink
feat(in): seleccion obra social prepaga
Browse files Browse the repository at this point in the history
  • Loading branch information
negro89 committed May 20, 2021
1 parent 879ed87 commit 238474c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,23 @@
<ng-container *ngIf="capa === 'estadistica'">
<plex-title size="sm" justify titulo="COBERTURA SOCIAL"></plex-title>
<plex-wrapper>
<plex-select *ngIf="!informeIngreso.obraSocial" [(ngModel)]="informeIngreso.asociado" name="asociado"
[data]="pacienteAsociado" placeholder="Seleccione... " label="Cobertura" idField="nombre"
labelField="nombre">
<plex-select [(ngModel)]="informeIngreso.asociado" name="asociado" [data]="pacienteAsociado"
placeholder="Seleccione... " label="Cobertura" idField="nombre" labelField="nombre"
(change)="changeTipoObraSocial()">
</plex-select>
<plex-text *ngIf="informeIngreso.obraSocial" [(ngModel)]="informeIngreso.obraSocial.nombre"
label="Obra Social" name="obraSocial" [readonly]="true"></plex-text>
<plex-select *ngIf="esPrepaga" [(ngModel)]="paciente.obraSocial" name="prepaga"
placeholder="Seleccione... " label="Seleccione prepaga" idField="nombre"
labelField="nombre" [data]="prepagas$ | async">
</plex-select>

<plex-text *ngIf="paciente.obraSocial && informeIngreso.asociado && !esPrepaga"
[(ngModel)]="paciente.obraSocial.nombre" label="Obra Social" name="obraSocial"
[readonly]="true">
</plex-text>
</plex-wrapper>



<plex-title size="sm" justify titulo="DATOS ESTADISTICOS"></plex-title>
<plex-wrapper>
<ng-container *ngIf="situacionesLaborales">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { InternacionResumenHTTP } from '../../services/resumen-internacion.http'
import { ConceptObserverService } from '../../../../../modules/rup/services/conceptObserver.service';
import { RUPComponent } from '../../../../../modules/rup/components/core/rup.component';
import { IPaciente } from 'src/app/core/mpi/interfaces/IPaciente';
import { ObraSocialService } from 'src/app/services/obraSocial.service';

@Component({
selector: 'app-ingresar-paciente',
Expand Down Expand Up @@ -56,6 +57,8 @@ export class IngresarPacienteComponent implements OnInit, OnDestroy {
public fechaHasta = moment().toDate();
private fechaIngresoOriginal: Date;
public inProgress = false;
public prepagas$: Observable<any[]>;
private backupObraSocial;

public get origenExterno() {
return this.informeIngreso && this.informeIngreso.origen && this.informeIngreso.origen.id === 'traslado';
Expand Down Expand Up @@ -94,7 +97,8 @@ export class IngresarPacienteComponent implements OnInit, OnDestroy {
@Optional() private ingresoPacienteService: IngresoPacienteService,
public elementosRUPService: ElementosRUPService,
public internacionResumenService: InternacionResumenHTTP,
private conceptObserverService: ConceptObserverService
private conceptObserverService: ConceptObserverService,
private obraSocialService: ObraSocialService
) {
}

Expand Down Expand Up @@ -132,6 +136,7 @@ export class IngresarPacienteComponent implements OnInit, OnDestroy {
ngOnInit() {
this.informeIngreso.fechaIngreso = this.mapaCamasService.fecha;
this.fechaHasta = this.listadoInternacionService.fechaIngresoHasta;
this.prepagas$ = this.obraSocialService.getPrepagas();

const pacienteID$ = this.handlerPacienteID();

Expand Down Expand Up @@ -164,6 +169,7 @@ export class IngresarPacienteComponent implements OnInit, OnDestroy {
if (paciente.id) {
if (paciente.financiador && paciente.financiador.length > 0) {
const os = paciente.financiador[0];
this.backupObraSocial = os;
this.paciente.obraSocial = {
nombre: os.financiador,
financiador: os.financiador,
Expand Down Expand Up @@ -249,6 +255,18 @@ export class IngresarPacienteComponent implements OnInit, OnDestroy {
});
}

get esPrepaga() {
return this.informeIngreso.asociado?.id === 'Plan de salud privado o Mutual';
}

changeTipoObraSocial() {
if (this.esPrepaga || this.informeIngreso.asociado?.id === 'Ninguno') {
this.paciente.obraSocial = null;
} else if (this.backupObraSocial) {
this.paciente.obraSocial = this.backupObraSocial;
}
}

selectCama(cama) {
this.mapaCamasService.select(cama);
}
Expand Down

0 comments on commit 238474c

Please sign in to comment.