-
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(HUDS): agrega historial de turnos de paciente
- Loading branch information
Showing
4 changed files
with
79 additions
and
1 deletion.
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
36 changes: 36 additions & 0 deletions
36
src/app/modules/rup/components/huds/vistaHistorialTurnos.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,36 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { TurnoService } from 'src/app/services/turnos/turno.service'; | ||
import { IPaciente } from '../../../../core/mpi/interfaces/IPaciente'; | ||
|
||
@Component({ | ||
selector: 'historial-turnos', | ||
templateUrl: 'vistaHistorialTurnos.html', | ||
}) | ||
|
||
export class VistaHistorialTurnosComponent implements OnInit { | ||
@Input() paciente: IPaciente; | ||
|
||
historial; | ||
|
||
constructor( | ||
public serviceTurno: TurnoService, | ||
) { } | ||
|
||
ngOnInit() { | ||
this.getHistorial(); | ||
} | ||
|
||
private getHistorial() { | ||
this.serviceTurno.getHistorial({ pacienteId: this.paciente.id }).subscribe( | ||
turnos => this.historial = this.sortByHoraInicio(turnos) | ||
); | ||
} | ||
|
||
private sortByHoraInicio(turnos: any[]) { | ||
return turnos.sort((a, b) => { | ||
const inia = a.horaInicio ? moment(a.horaInicio).toDate() : null; | ||
const inib = b.horaInicio ? moment(b.horaInicio).toDate() : null; | ||
return ((inia && inib) ? (inib.getTime() - inia.getTime()) : 0); | ||
}); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/app/modules/rup/components/huds/vistaHistorialTurnos.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,37 @@ | ||
<fieldset *plTab> | ||
<ul class="list-group"> | ||
<li *ngFor="let turno of historial" class="list-group-item" [appHover]="'active'"> | ||
<div class="list-group-item-text"> | ||
<div> | ||
<plex-badge *ngIf="turno.asistencia === 'noAsistio' && turno.estado !== 'suspendido'" | ||
type="danger">NO ASISTIÓ</plex-badge> | ||
<plex-badge *ngIf="turno.estado === 'fuera-agenda'" type="warning"> | ||
FUERA DE AGENDA</plex-badge> | ||
<plex-badge *ngIf="turno.asistencia !== 'noAsistio' && (turno.estado === 'asignado' || turno.estado === 'turnoDoble')" | ||
type="success"> | ||
ASIGNADO</plex-badge> | ||
<plex-badge *ngIf="turno.estado === 'liberado' || turno.estado === 'suspendido' " type="danger"> | ||
{{turno.estado | uppercase}}</plex-badge> | ||
|
||
| {{turno.horaInicio | date:'dd/MM/yyyy HH:mm'}} | ||
</div> | ||
<div *ngIf="turno.estado === 'liberado'">Por {{turno.updatedBy.nombreCompleto}} el | ||
{{turno.updatedAt | ||
| fecha}} a las {{turno.updatedAt | date: 'HH:mm'}}</div> | ||
<div *ngIf="turno.tipoPrestacion?.term">{{turno.tipoPrestacion.term}}</div> | ||
<div *ngFor="let profesional of turno.profesionales"> | ||
{{profesional | nombre}} | ||
</div> | ||
<div> | ||
<em class="small">{{turno.organizacion.nombre}}</em> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
<div *ngIf="!historial.length" justify="center" class="pt-4"> | ||
<plex-label class="flex-column" icon="magnify" type="info" size="xl" direction="column" | ||
[titulo]="'No hay resultados'" subtitulo="No se ha registrado ningún turno para el paciente"> | ||
</plex-label> | ||
</div> | ||
</fieldset> |
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