Skip to content

Commit

Permalink
feat(COM): remover COM de origen
Browse files Browse the repository at this point in the history
  • Loading branch information
plammel authored and sychus committed Jun 16, 2021
1 parent 5dad656 commit 84b4bae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class NuevaDerivacionComponent implements OnInit, OnDestroy {
obraSocial: null,
historial: []
};
organizacionesOrigen = [];
organizacionesDestino = [];
tipoTraslados = [];
paramsSubscribe: any;
Expand Down Expand Up @@ -93,6 +94,9 @@ export class NuevaDerivacionComponent implements OnInit, OnDestroy {
this.organizacionService.getById(this.auth.organizacion.id).subscribe(org => {
this.esCOM = org.esCOM;
this.modelo.organizacionOrigen = this.esCOM ? null : this.auth.organizacion;
if (this.esCOM) {
this.cargarOrigenes();
}
this.seleccionarPaciente(paciente);
this.seleccionarProfesional(this.auth.profesional);
});
Expand Down Expand Up @@ -134,6 +138,13 @@ export class NuevaDerivacionComponent implements OnInit, OnDestroy {
);
}


cargarOrigenes() {
this.organizacionService.get({ esCOM: false }).subscribe(resultado => {
this.organizacionesOrigen = resultado;
});
}

cargarDestinos() {
this.organizacionService.get({ esCOM: true }).subscribe(resultado => {
this.organizacionesDestino = resultado;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</plex-title>
<form #form="ngForm">
<plex-wrapper>
<plex-select *ngIf="esCOM" [(ngModel)]="modelo.organizacionOrigen" name="organizacionOrigen" tmOrganizaciones
<plex-select *ngIf="esCOM" [(ngModel)]="modelo.organizacionOrigen" name="organizacionOrigen" [data]="organizacionesOrigen"
label="Organización origen" placeholder="Seleccione la organización origen"
labelField="nombre" [required]="true" grow="full">
</plex-select>
Expand Down

0 comments on commit 84b4bae

Please sign in to comment.