Trazabilidad, Datos y definiciones and the risk lists as the old app: declared panels, old labels and order; page tests against the capture
This commit is contained in:
@@ -8,7 +8,8 @@ import { MatSelectModule } from '@angular/material/select';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import type { Bundle } from 'fhir/r4';
|
||||
import { Fhir } from '../fhir';
|
||||
import { rows, windowStart } from './follow-up';
|
||||
import { Row, rows, windowStart } from './follow-up';
|
||||
import { Loading } from '../loading';
|
||||
import { name } from './measures';
|
||||
|
||||
const STATUSES = ['case', 'pre_colposcopy', 'post_colposcopy', 'post_treatment'];
|
||||
@@ -20,6 +21,7 @@ const STATUSES = ['case', 'pre_colposcopy', 'post_colposcopy', 'post_treatment']
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
FormsModule,
|
||||
Loading,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
@@ -65,7 +67,9 @@ export class TabRiesgos {
|
||||
},
|
||||
});
|
||||
protected readonly loading = signal(false);
|
||||
protected readonly page = computed(() => this.moved() ?? this.first.value());
|
||||
protected readonly page = computed(
|
||||
() => this.moved() ?? (this.first.hasValue() ? this.first.value() : undefined),
|
||||
);
|
||||
/** The cut-off as applied (the server's default when none is given). */
|
||||
protected readonly applied = computed(() => {
|
||||
const self = this.page()?.link?.find((l) => l.relation === 'self')?.url;
|
||||
@@ -84,6 +88,26 @@ export class TabRiesgos {
|
||||
});
|
||||
protected readonly error = computed(() => this.first.error());
|
||||
|
||||
/** "Ventana consultada": the window's first day for the applied cut-off. */
|
||||
protected readonly start = computed(() =>
|
||||
this.applied() ? windowStart(this.applied(), this.window()) : '',
|
||||
);
|
||||
protected readonly pageNumber = computed(() => Math.floor(this.offset() / this.size()) + 1);
|
||||
protected readonly pageCount = computed(() =>
|
||||
Math.max(1, Math.ceil((this.page()?.total ?? 0) / this.size())),
|
||||
);
|
||||
/** "Estudio más reciente": her latest cytology or HPV sample. */
|
||||
protected latest(row: Row): string | undefined {
|
||||
return [row.cytology?.date, row.hpv?.date]
|
||||
.filter((d) => !!d)
|
||||
.sort()
|
||||
.at(-1)
|
||||
?.slice(0, 10);
|
||||
}
|
||||
protected retry(): void {
|
||||
this.first.reload();
|
||||
}
|
||||
|
||||
protected has(relation: 'next' | 'previous'): boolean {
|
||||
return !!this.page()?.link?.some((l) => l.relation === relation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user