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 30, 2024
1 parent c595945 commit 9318b35
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
10 changes: 6 additions & 4 deletions src/app/components/top/solicitudes/solicitudes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,20 +656,22 @@ export class SolicitudesComponent implements OnInit {
}

preAccesoHuds(motivoAccesoHuds) {
if (motivoAccesoHuds) {
if (motivoAccesoHuds[0]) {
if (!this.accesoHudsPaciente && !this.accesoHudsPrestacion && this.routeToParams && this.routeToParams[0] === 'huds') {
// Se esta accediendo a 'HUDS DE UN PACIENTE'
window.sessionStorage.setItem('motivoAccesoHuds', motivoAccesoHuds);
window.sessionStorage.setItem('motivoAccesoHuds', motivoAccesoHuds[0]);
} else {
if (this.accesoHudsPaciente) {
const paramsToken = {
usuario: this.auth.usuario,
organizacion: this.auth.organizacion,
paciente: this.accesoHudsPaciente,
motivo: motivoAccesoHuds,
motivo: motivoAccesoHuds[0],
profesional: this.auth.profesional,
idTurno: this.accesoHudsTurno,
idPrestacion: this.accesoHudsPrestacion
idPrestacion: this.accesoHudsPrestacion,
detalleMotivo: motivoAccesoHuds[1]

};
this.hudsService.generateHudsToken(paramsToken).subscribe(hudsToken => {
// se obtiene token y loguea el acceso a la huds del paciente
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,19 @@ export class HudsBusquedaPacienteComponent implements OnInit {
}

onConfirmSelect(motivoAccesoHuds) {
if (motivoAccesoHuds) {
if (motivoAccesoHuds[0]) {
// se obtiene token y loguea el acceso a la huds del paciente
const paramsToken = {
usuario: this.auth.usuario,
organizacion: this.auth.organizacion,
paciente: this.pacienteSelected,
motivo: motivoAccesoHuds,
motivo: motivoAccesoHuds[0],
profesional: this.auth.profesional ? this.auth.profesional : null,
idTurno: null,
idPrestacion: null
idPrestacion: null,
detalleMotivo: motivoAccesoHuds[1]
};
this.hudsService.generateHudsToken( paramsToken).subscribe(hudsToken => {
this.hudsService.generateHudsToken(paramsToken).subscribe(hudsToken => {
window.sessionStorage.setItem('huds-token', hudsToken.token);
window.sessionStorage.removeItem('motivoAccesoHuds');
this.router.navigate(['/huds/paciente/' + this.pacienteSelected.id]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,23 +839,25 @@ export class PuntoInicioComponent implements OnInit, OnDestroy {

preAccesoHuds(motivoAccesoHuds) {
const doRoute = () => this.routeTo(this.routeToParams[0], (this.routeToParams[1]) ? this.routeToParams[1] : null);
if ((this.tieneAccesoHUDS || this.motivoVerContinuarPrestacion === motivoAccesoHuds) && motivoAccesoHuds) {
if ((this.tieneAccesoHUDS || this.motivoVerContinuarPrestacion === motivoAccesoHuds[0]) && motivoAccesoHuds[0]) {
if (this.prestacionNominalizada) {
this.accesoHudsPaciente = null;
}
if (!this.accesoHudsPaciente && !this.accesoHudsPrestacion && this.routeToParams && this.routeToParams[0] === 'huds') {
// Se esta accediendo a 'HUDS DE UN PACIENTE'
window.sessionStorage.setItem('motivoAccesoHuds', motivoAccesoHuds);
window.sessionStorage.setItem('motivoAccesoHuds', motivoAccesoHuds[0]);
doRoute();
} else if (this.accesoHudsPaciente) {
const paramsToken = {
usuario: this.auth.usuario,
organizacion: this.auth.organizacion,
paciente: this.accesoHudsPaciente,
motivo: motivoAccesoHuds,
motivo: motivoAccesoHuds[0],
profesional: this.auth.profesional,
idTurno: this.accesoHudsTurno,
idPrestacion: this.accesoHudsPrestacion
idPrestacion: this.accesoHudsPrestacion,
detalleMotivo: motivoAccesoHuds[1]

};
this.hudsService.generateHudsToken(paramsToken).subscribe(hudsToken => {
// se obtiene token y loguea el acceso a la huds del paciente
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, Output, ViewChild, Input, EventEmitter } from '@angular/core';
import { PlexModalComponent } from '@andes/plex/src/lib/modal/modal.component';

@Component({
selector: 'modal-motivo-acceso-huds',
templateUrl: 'modal-motivo-acceso-huds.html'
Expand All @@ -17,17 +16,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 +34,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 9318b35

Please sign in to comment.