Mostrar factores usados en cada estimación

This commit is contained in:
2026-12-02 23:13:59 -06:00
parent 5f92c49ed4
commit a92515eb4d
4 changed files with 59 additions and 3 deletions
+12
View File
@@ -79,6 +79,17 @@ function methods(figures: { figure: { data: unknown[] } }[]): string[] {
return [...new Set(names.filter((n): n is string => !!n))];
}
function modelInputs(value: string | undefined): Record<string, unknown> | undefined {
if (!value) return undefined;
try {
const parsed: unknown = JSON.parse(value);
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
? parsed as Record<string, unknown> : undefined;
} catch {
return undefined;
}
}
@Component({
selector: 'app-paciente',
imports: [
@@ -348,6 +359,7 @@ export class Paciente {
version: Number(/v(\d+)$/.exec(r.method?.text ?? '')?.[1] ?? 0),
index: r.occurrenceDateTime ?? '',
measure: ext(r, 'prediction-measure')?.valueCode,
inputs: modelInputs(ext(r, 'model-inputs')?.valueString),
// the clinical scenarios of the model's report she falls in
scenarios: (r.extension ?? [])
.filter((e) => e.url === EXT + 'escenario-clinico')