Skip to content

Commit

Permalink
feat(MONIT): quitar eliminacion de concepto turneable
Browse files Browse the repository at this point in the history
  • Loading branch information
ma7payne authored and MCele committed Jul 26, 2023
1 parent c40e984 commit 9d8b249
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Component, Input, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Plex } from '@andes/plex';
import { IConceptoTurneable } from '../Interfaces/IConceptoTurneable';
import { ConceptoTruneableService } from '../services/concepto-turneable.service';
import { Auth } from '@andes/auth';
import { Router } from '@angular/router';
import { PlexModalComponent } from '@andes/plex/src/lib/modal/modal.component';


@Component({
Expand Down Expand Up @@ -121,29 +120,4 @@ export class ConceptosTurneablesComponent implements OnInit, OnDestroy {
this.buscar();
});
}

onEliminarConceptoTurneable(conceptoTurneable) {
if (this.conceptoSeleccionado && this.conceptoSeleccionado.id) {
this.plex.confirm('Eliminar concepto turneable "' + conceptoTurneable.term + '"', '¿Desea eliminar?').then(confirmacion => {
if (confirmacion) {
this.conceptoTurneableService.delete(conceptoTurneable).subscribe(resultado => {
this.plex.info('info', 'El Concepto Turneable fue eliminado');
this.conceptoSeleccionado = null;
let i = 0;
let index;
this.conceptosTurneables.forEach(concepto => {
if (concepto.id === conceptoTurneable.id) {
index = i;
}
i++;
});

this.conceptosTurneables.splice(index, 1);
});
}
});
} else {
this.plex.info('danger', 'No es posible dar de baja este Concepto Turneable');
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Output, EventEmitter, ViewChild } from '@angular/core';
import { Plex } from '@andes/plex';
import { PlexModalComponent } from '@andes/plex/src/lib/modal/modal.component';
import { Component, EventEmitter, Output, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { ISnomedConcept } from 'src/app/shared/ISnomedConcept';
import { SnomedService } from 'src/app/shared/snomed.service';
Expand Down Expand Up @@ -77,7 +77,6 @@ export class NuevoConceptoTurneableComponent {
search: this.term,
semanticTag: ['procedimiento']
};

this.snomedService.get(query).subscribe((resultado: ISnomedConcept[]) => {
this.loading = false;
this.conceptosSnomed = resultado;
Expand All @@ -90,7 +89,9 @@ export class NuevoConceptoTurneableComponent {

seleccionarConcepto(concepto: IConceptoTurneable) {
this.buscarConcepto(concepto).subscribe(existe => {
if (existe) { this.mostrarMensaje(); } else {
if (existe) {
this.mostrarMensaje();
} else {
if (!this.conceptoSnomedSeleccionado || this.conceptoSnomedSeleccionado.id !== concepto.id) {
this.conceptoSnomedSeleccionado = concepto;
this.nuevoConceptoTurneable.conceptId = this.conceptoSnomedSeleccionado.conceptId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ export class ConceptoTruneableService {
patch(id: string, cambios: any, options: any = {}): Observable<IConceptoTurneable> {
return this.server.patch(`${this.conceptoTurneableUrl}/${id}`, cambios);
}

delete(conceptoTurneable: IConceptoTurneable): Observable<any> {
return this.server.delete(`${this.conceptoTurneableUrl}/${conceptoTurneable.id}`);
}
}

0 comments on commit 9d8b249

Please sign in to comment.