Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,14 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro

}

private ordenarGuardias(guardias) {
return guardias.sort((a, b) => {
const fechaA = moment(a.fecha);
const fechaB = moment(b.fecha);
return fechaB.diff(fechaA);
});
}

// Trae los cdas registrados para el paciente
buscarCDAPacientes(token) {
forkJoin({
Expand All @@ -679,10 +687,10 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro
this.prestaciones = this.prestacionesCopia;
// filtramos las vacunas y laboratorios por ahora para que se listan por separado
this.vacunas = this.cdas.filter(cda => cda.prestacion.conceptId === ConceptosTurneablesService.Vacunas_CDA_ID);
this.guardias = [
this.guardias = this.ordenarGuardias([
...this.rupGuardias,
...this.cdas.filter(cda => cda.prestacion.conceptId === ConceptosTurneablesService.Guardia_CDA_ID)
];
]);
this.laboratorios = this.cdas.filter(cda => cda.prestacion.conceptId === ConceptosTurneablesService.Laboratorio_CDA_ID
|| cda.prestacion.conceptId === ConceptosTurneablesService.Laboratorio_SISA_CDA_ID);

Expand Down Expand Up @@ -764,12 +772,12 @@ export class HudsBusquedaComponent implements AfterContentInit, OnInit, OnDestro
);

// 🔹 GUARDIAS
this.guardias = [
this.guardias = this.ordenarGuardias([
...this.rupGuardias,
...cdasMapeados.filter(cda =>
cda.prestacion.conceptId === ConceptosTurneablesService.Guardia_CDA_ID
)
];
]);

// 🔹 Orden especial de laboratorios
this.laboratorios = this.ordenarLaboratorios(this.laboratorios, protocolos);
Expand Down
Loading