Comparar series de riesgo seleccionables en la ficha CaCu

This commit is contained in:
2026-12-02 18:24:33 -06:00
parent 1260e0ff2a
commit f7fdab950a
4 changed files with 267 additions and 0 deletions
+29
View File
@@ -27,6 +27,7 @@ import { firstValueFrom } from 'rxjs';
import { ApiConfiguration } from '../api/api-configuration';
import { ANTECEDENTS, Fact, group, split } from './record-groups';
import { referenceView, ReferenceRisk, ReferenceView } from './reference-risk';
import { parseSeries, RiskSeries, Series } from './risk-series';
import { curveFigure, curveText } from './risk-curve';
import { isRiskModel, riskGroups, riskScales, RiskScales } from './risk-scales';
import { route, Stages } from './stages';
@@ -88,6 +89,7 @@ function methods(figures: { figure: { data: unknown[] } }[]): string[] {
Plot,
RiskScales,
ReferenceRisk,
RiskSeries,
Stages,
],
templateUrl: './paciente.html',
@@ -181,6 +183,33 @@ export class Paciente {
protected readonly groups = computed(() =>
this.domain() === 'cacu' ? riskGroups(this.riskModels()) : [],
);
/** CaCu, experimental: the series her record can compare; none while the API has it off. */
protected readonly riskSeries = resource({
params: () =>
this.domain() === 'cacu'
? { id: this.id(), cutoff: this.corte(), sample: this.citologia() }
: undefined,
loader: async ({ params }): Promise<Series[] | undefined> => {
try {
const answer = await firstValueFrom(
this.http.get<FhirParameters>(
`${this.root}/cacu/fhir/Patient/${params.id}/$risk-series`,
{
params: Object.fromEntries(
Object.entries({
cutoff: params.cutoff,
sample: params.sample?.slice(0, 10),
}).filter((e): e is [string, string] => !!e[1]),
),
},
),
);
return parseSeries(answer);
} catch {
return undefined;
}
},
});
/** CaCu, experimental: the NCI reference comparison of the cytology she was opened at. The API
* answers 404 while the feature is off: then nothing is shown. */
protected readonly reference = resource({