-
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
73 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 ? new Date(a.horaInicio) : null; | ||
const inib = b.horaInicio ? new Date(b.horaInicio) : null; | ||
return ((inia && inib) ? (inib.getTime() - inia.getTime()) : 0); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
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,31 @@ | ||
<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> | ||
</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