-
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
179 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
94 changes: 94 additions & 0 deletions
94
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,94 @@ | ||
|
||
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 listaEspera = []; | ||
public itemSelected = 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({ estado: 'pendiente' }); | ||
} | ||
|
||
private getDemandas(filtros) { | ||
this.listaEsperaService.get(filtros).subscribe((listaEspera: any[]) => { | ||
this.listaEspera = listaEspera; | ||
|
||
this.listaEspera.forEach(item => { | ||
item.motivos = item.demandas.map(({ motivo }) => motivo); | ||
}); | ||
}); | ||
} | ||
|
||
public seleccionarDemanda(demanda) { this.itemSelected = demanda; } | ||
|
||
public refreshSelection({ value }, tipo) { | ||
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() { this.itemSelected = null; } | ||
|
||
public cambiarTab(index) { } | ||
} |
77 changes: 77 additions & 0 deletions
77
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,77 @@ | ||
<plex-layout main="{{itemSelected ? '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="!listaEspera.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="listaEspera.length" [columns]="columns" #table="plTable" [offset]="102"> | ||
<plex-title titulo="Listado de pacientes" size="sm"></plex-title> | ||
<tr *ngFor="let item of listaEspera" (click)="seleccionarDemanda(item)" | ||
[class.selected]="item.id === itemSelected?.id" [class.selectable]="selectable"> | ||
<td>{{item.paciente.nombreCompleto}}</td> | ||
<td>{{item.tipoPrestacion.nombre}}</td> | ||
<td>{{item.fecha | fecha}}</td> | ||
<td>{{item.motivos}}</td> | ||
<td class="align-center" justify="center"> | ||
<plex-badge class="ml-1" size="sm" type="info"> | ||
{{item.estado}} | ||
</plex-badge> | ||
</td> | ||
</tr> | ||
</plex-table> | ||
</ng-container> | ||
</plex-layout-main> | ||
<plex-layout-sidebar *ngIf="itemSelected" 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]="itemSelected.paciente" orientacion="horizontal" | ||
[fields]="pacienteFields"> | ||
</paciente-detalle> | ||
</ng-container> | ||
<ng-container> | ||
<plex-title titulo="Listado" size="md"> | ||
</plex-title> | ||
<plex-list> | ||
<ng-container> | ||
<plex-item *ngFor="let demanda of itemSelected.demandas"> | ||
<plex-label size="md" titulo="Prestacion" | ||
subtitulo="{{ itemSelected.tipoPrestacion.nombre }}"> | ||
</plex-label> | ||
<plex-label size="md" titulo="Efector" subtitulo="{{ demanda.organizacion.nombre }}"> | ||
</plex-label> | ||
</plex-item> | ||
</ng-container> | ||
</plex-list> | ||
</ng-container> | ||
</plex-tab> | ||
</plex-tabs> | ||
</plex-layout-sidebar> | ||
</plex-layout> |