Mostrar factores usados en cada estimación
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user