-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CIT): Implementa mockups de demanda insatisfecha
- Loading branch information
Showing
4 changed files
with
180 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
src/app/components/demandaInsatisfecha/demanda-insatisfecha.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
import { Component, OnInit } from '@angular/core'; | ||
import { ListaEsperaService } from 'src/app/services/turnos/listaEspera.service'; | ||
|
||
|
||
@Component({ | ||
selector: 'demanda-insatisfecha', | ||
templateUrl: 'demanda-insatisfecha.html' | ||
}) | ||
export class DemandaInsatisfechaComponent implements OnInit { | ||
public listaDemandas = []; | ||
public demandasFiltradas = null; | ||
public demandaSelected = null; | ||
public filtros: any = {}; | ||
public selectorPrestacion; | ||
public selectorMotivo; | ||
public selectedPaciente; | ||
|
||
public motivos = [ | ||
{ id: 1, nombre: 'No existe la oferta en el efector' }, | ||
{ id: 2, nombre: 'No hay turnos disponibles' }, | ||
{ id: 3, nombre: 'Oferta rechazada por el paciente' } | ||
]; | ||
|
||
public columns = [ | ||
{ | ||
key: 'paciente', | ||
label: 'Paciente' | ||
}, | ||
{ | ||
key: 'prestacion', | ||
label: 'Prestación' | ||
}, | ||
{ | ||
key: 'fecha', | ||
label: 'Fecha' | ||
}, | ||
{ | ||
key: 'motivo', | ||
label: 'Motivo' | ||
}, | ||
{ | ||
key: 'estado', | ||
} | ||
]; | ||
|
||
public tabIndex = 0; | ||
public pacienteFields = ['sexo', 'fechaNacimiento', 'cuil', 'financiador', 'numeroAfiliado', 'direccion']; | ||
|
||
constructor(private listaEsperaService: ListaEsperaService) { } | ||
|
||
ngOnInit(): void { | ||
this.getDemandas({}); | ||
} | ||
|
||
private getDemandas(filtros) { | ||
this.listaEsperaService.get(filtros).subscribe((listaEspera: any[]) => { | ||
const demandas = []; | ||
|
||
listaEspera.forEach(item => { | ||
item.demandas.forEach(demanda => { | ||
demandas.push({ | ||
id: demanda.id, | ||
paciente: item.paciente, | ||
prestacion: item.tipoPrestacion.nombre, | ||
fecha: item.fecha, | ||
motivo: demanda.motivo, | ||
estado: item.estado | ||
}); | ||
}); | ||
}); | ||
|
||
this.listaDemandas = demandas; | ||
}); | ||
} | ||
|
||
public seleccionarDemanda(demanda) { this.demandaSelected = demanda; } | ||
|
||
public refreshSelection({ value }, tipo) { | ||
if (value === null) { | ||
this.demandasFiltradas = null; | ||
} | ||
|
||
if (tipo === 'paciente') { | ||
this.filtros = { ...this.filtros, paciente: value }; | ||
} | ||
|
||
if (tipo === 'fechaDesde') { | ||
this.filtros = { ...this.filtros, fechaDesde: value }; | ||
} | ||
|
||
if (tipo === 'fechaHasta') { | ||
this.filtros = { ...this.filtros, fechaHasta: value }; | ||
} | ||
|
||
if (tipo === 'prestacion') { | ||
this.filtros = { ...this.filtros, prestacion: value?.term }; | ||
} | ||
|
||
if (tipo === 'motivo') { | ||
this.filtros = { ...this.filtros, motivo: value?.nombre }; | ||
} | ||
|
||
this.getDemandas(this.filtros); | ||
} | ||
|
||
public cerrar() { } | ||
|
||
public cambiarTab(index) { } | ||
} |
62 changes: 62 additions & 0 deletions
62
src/app/components/demandaInsatisfecha/demanda-insatisfecha.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<plex-layout main="{{demandaSelected ? '8' : '12'}}" [min]="4" [max]="5" [steps]="2"> | ||
<plex-layout-main> | ||
<plex-title main titulo="Demanda insatisfecha"> | ||
<plex-button label="volver" type="danger" size="sm" position="left" routerLink='/inicio'></plex-button> | ||
</plex-title> | ||
<plex-wrapper> | ||
<plex-text [(ngModel)]="filtros.paciente" name="paciente.nombreCompleto" label="Paciente" | ||
(change)="refreshSelection($event,'paciente')"> | ||
</plex-text> | ||
<plex-select [(ngModel)]="selectorPrestacion" (change)="refreshSelection($event,'prestacion')" | ||
label="Prestación" tmPrestaciones preload="true" tipo="nominalizadas"> | ||
</plex-select> | ||
<plex-datetime type="date" [(ngModel)]="filtros.fechaDesde" name="fechaDesde" label="Desde" class="fechas" | ||
[max]="filtros.fechaHasta" [required]="true" | ||
(change)="refreshSelection($event,'fechaDesde')"> | ||
</plex-datetime> | ||
<plex-datetime type="date" [(ngModel)]="filtros.fechaHasta" name="fechaHasta" label="Hasta" class="fechas" | ||
[required]="false" (change)="refreshSelection($event,'fechaHasta')"> | ||
</plex-datetime> | ||
<plex-select [(ngModel)]="selectorMotivo" ambito="ambulatorio" name="motivo" label="Motivo" [data]="motivos" | ||
(change)="refreshSelection($event,'motivo')"> | ||
</plex-select> | ||
</plex-wrapper> | ||
<div *ngIf="!listaDemandas.length" class="mt-5"> | ||
<plex-label class="flex-column" icon="magnify" type="info" justify="center" size="xl" direction="column" | ||
titulo="No hay resultados para esta búsqueda" | ||
subtitulo="Edite algún filtro para realizar una búsqueda"> | ||
</plex-label> | ||
</div> | ||
<ng-container> | ||
<plex-table *ngIf="listaDemandas.length" [columns]="columns" #table="plTable" [offset]="102"> | ||
<plex-title titulo="Listado de pacientes" size="sm"></plex-title> | ||
<tr *ngFor="let demanda of listaDemandas" (click)="seleccionarDemanda(demanda)" | ||
[class.selected]="demanda.id===demandaSelected?.id" [class.selectable]="selectable"> | ||
<td>{{demanda.paciente.nombreCompleto}}</td> | ||
<td>{{demanda.prestacion}}</td> | ||
<td>{{demanda.fecha | fecha}}</td> | ||
<td>{{demanda.motivo}}</td> | ||
<td class="align-center" justify="center"> | ||
<plex-badge class="ml-1" size="sm" type="info"> | ||
{{demanda.estado}} | ||
</plex-badge> | ||
</td> | ||
</tr> | ||
</plex-table> | ||
</ng-container> | ||
</plex-layout-main> | ||
<plex-layout-sidebar *ngIf="demandaSelected" type="invert"> | ||
<plex-tabs [activeIndex]="tabIndex" (change)="cambiarTab($event)"> | ||
<plex-tab label="DATOS"> | ||
<ng-container> | ||
<plex-title titulo="Detalle paciente" size="md"> | ||
<plex-button size="sm" type="danger" [icon]="'close'" (click)="cerrar()"></plex-button> | ||
</plex-title> | ||
<paciente-detalle [paciente]="demandaSelected.paciente" orientacion="horizontal" | ||
[fields]="pacienteFields"> | ||
</paciente-detalle> | ||
</ng-container> | ||
</plex-tab> | ||
</plex-tabs> | ||
</plex-layout-sidebar> | ||
</plex-layout> |