Skip to content

Commit

Permalink
feat(PRIV-70): Agregar campo observación en motivos
Browse files Browse the repository at this point in the history
  • Loading branch information
aldoEMatamala committed May 22, 2024
1 parent f205c57 commit 513c266
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Output, ViewChild, Input, EventEmitter } from '@angular/core';
import { PlexModalComponent } from '@andes/plex/src/lib/modal/modal.component';

import { MotivosHudsService } from 'src/app/services/motivosHuds.service';
@Component({
selector: 'modal-motivo-acceso-huds',
templateUrl: 'modal-motivo-acceso-huds.html'
Expand All @@ -17,17 +17,16 @@ export class ModalMotivoAccesoHudsComponent {
this.motivoSelected = null;
}
}

@Output() motivoAccesoHuds = new EventEmitter<string>();

@Output() motivoAccesoHuds = new EventEmitter<[String, String]>();
public motivosAccesoHuds = [
{ id: 'auditoria', label: 'Procesos de Auditoría' },
{ id: 'urgencia', label: 'Intervención de Urgencia/Emergencia' },
{ id: 'administrativo', label: 'Procesos Administrativos' },
{ id: 'continuidad', label: 'Intervención en el proceso de cuidado del paciente' }
];

public motivoSelected = null;
public detalleMotivo = '';
// eslint-disable-next-line @angular-eslint/use-lifecycle-interface

motivoSelect() {
return this.motivoSelected === null;
Expand All @@ -36,7 +35,7 @@ export class ModalMotivoAccesoHudsComponent {
notificarAccion(flag: boolean) {
if (flag) {
const item = this.motivosAccesoHuds.find((elem) => elem.id === this.motivoSelected);
this.motivoAccesoHuds.emit(item.label);
this.motivoAccesoHuds.emit([item.label, this.detalleMotivo]);
} else {
this.motivoAccesoHuds.emit(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
<plex-modal-subtitle type="">Por favor, indique el motivo de acceso:</plex-modal-subtitle>
<main>
<div class="w-100">
<div class="w-50">
<div class="w-60 ">
<plex-radio [(ngModel)]="motivoSelected" [data]="motivosAccesoHuds">
</plex-radio>
</div>
<div class="mt-4">
<plex-text placeholder="Describa brevemente el motivo de acceso" multiline="true" name="multi"
[(ngModel)]="detalleMotivo">
</plex-text>
</div>

<div class="mt-4">
<small>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ export class ModalMotivoAccesoHudsService {
});
}

private hudsToken(paciente, motivo: string, turno?: string, prestacion?: string) {
private hudsToken(paciente, motivo: string, turno?: string, prestacion?: string, detalle?: string) {
const paramsToken = {
usuario: this.auth.usuario,
organizacion: this.auth.organizacion,
paciente: paciente,
motivo: motivo,
profesional: this.auth.profesional,
idTurno: turno,
idPrestacion: prestacion
idPrestacion: prestacion,
detalleMotivo: detalle
};
return this.hudsService.generateHudsToken(paramsToken).pipe(
tap((hudsToken) => {
Expand Down
12 changes: 7 additions & 5 deletions src/app/modules/rup/components/huds/vista-accesos-huds.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
</div>
</td>
<td *plTableCol="'motivo'">
<div *ngIf="acceso.motivoAcceso">

</div>
<div>
<span *ngIf="acceso.motivoAcceso" class="text-secondary">{{acceso.motivoAcceso}}</span>
</div>
<span *ngIf="acceso.motivoAcceso" class="text-secondary"
style="padding: 10px;">{{acceso.motivoAcceso}}</span>
<plex-help *ngIf="acceso.detalleMotivo" type="help" icon="message" tooltip="Observación"
titulo="Detalle del motivo" size="sm" cardSize="half">
{{ acceso.detalleMotivo }}
</plex-help>

</td>
<td *plTableCol="'organizacion'">
<ng-container *ngIf="acceso.organizacion && acceso.organizacion.nombre">
Expand Down

0 comments on commit 513c266

Please sign in to comment.