CaMa record as the old card: summary, mammography, histopathology, prognosis, risk of death and its scenarios' risk factors
This commit is contained in:
@@ -134,3 +134,11 @@ export function byDeviation(zones: Site[]): Site[] {
|
||||
scored ? Math.abs(b.z ?? 0) - Math.abs(a.z ?? 0) : b.value - a.value,
|
||||
);
|
||||
}
|
||||
|
||||
/** An EEG's quality level (models.tea.eeg.checks): how much of it the analysis could use. */
|
||||
export const LEVEL_NAMES: Record<string, string> = {
|
||||
complete: 'registro completo',
|
||||
partial: 'registro parcial: menos de la mitad limpio',
|
||||
no_ear_reference: 'sin referencia auricular',
|
||||
not_analyzable: 'no analizable',
|
||||
};
|
||||
|
||||
@@ -146,11 +146,12 @@ export interface CamaRow {
|
||||
status: string;
|
||||
priority: string;
|
||||
ageGroup: string;
|
||||
mammogram: { date: string; birads?: string };
|
||||
/** `days`: from the mammogram to its diagnosis, when known by the cut-off. */
|
||||
mammogram: { date: string; birads?: string; days?: number };
|
||||
biopsy?: { date: string; histology?: string };
|
||||
}
|
||||
|
||||
const CAMA_AGE_GROUPS: [number, number][] = [
|
||||
export const CAMA_AGE_GROUPS: [number, number][] = [
|
||||
[40, 49],
|
||||
[50, 59],
|
||||
[60, 69],
|
||||
@@ -196,6 +197,7 @@ export function camaRows(page: Bundle, cutoff: string): CamaRow[] {
|
||||
birads: mammogram
|
||||
? code(results(mammogram).get('mammography.birads')?.valueCodeableConcept)
|
||||
: undefined,
|
||||
days: mammogram ? ext(mammogram, 'days-to-diagnosis')?.valueInteger : undefined,
|
||||
},
|
||||
biopsy: biopsy && {
|
||||
date: reported(biopsy)!,
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
import { Component, computed, input, signal } from '@angular/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
|
||||
/** One scenario's row of a model's scenario summary (models.factors.scenario_row). */
|
||||
export interface ScenarioFactors {
|
||||
escenario: string;
|
||||
n_escenario: number;
|
||||
horizonte_meses?: number;
|
||||
riesgo_definitorios: string;
|
||||
riesgo_mayoritarios: string;
|
||||
incluye_factor_riesgo: boolean;
|
||||
}
|
||||
|
||||
interface Entry {
|
||||
text: string;
|
||||
robust: boolean;
|
||||
}
|
||||
|
||||
/** A listing cell, `variable=category (robusto|sugerente, share)` separated by `;`. */
|
||||
export function entries(cell: string | null | undefined): Entry[] {
|
||||
return (cell ?? '')
|
||||
.split(';')
|
||||
.map((e) => e.trim())
|
||||
.filter(Boolean)
|
||||
.map((text) => ({ text, robust: /\(\s*robusto\b/i.test(text) }));
|
||||
}
|
||||
|
||||
/** "Factores de riesgo de este escenario", as the old record: per scenario of hers, the risk
|
||||
* factors present in at least 95 % of it and those in 50 to 95 %, a robust one solid and a
|
||||
* suggestive one outlined; with a horizon to choose when the model has several. */
|
||||
@Component({
|
||||
selector: 'app-factores',
|
||||
imports: [MatFormFieldModule, MatSelectModule],
|
||||
template: `
|
||||
<h3>Factores de riesgo</h3>
|
||||
@if (horizons().length > 1) {
|
||||
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="horizon">
|
||||
<mat-label>Horizonte</mat-label>
|
||||
<mat-select [value]="horizon()" (selectionChange)="chosen.set($event.value)">
|
||||
@for (h of horizons(); track h) {
|
||||
<mat-option [value]="h">{{ h }} meses</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
@for (s of shown(); track s.escenario) {
|
||||
<h4>
|
||||
{{ s.escenario }} <span class="muted">(n = {{ s.n }})</span>
|
||||
</h4>
|
||||
@if (s.defining.length || s.majority.length) {
|
||||
@if (s.defining.length) {
|
||||
<p class="level">Presentes en al menos 95 % del escenario</p>
|
||||
<ul class="factors">
|
||||
@for (e of s.defining; track e.text) {
|
||||
<li [class.robust]="e.robust">{{ e.text }}</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@if (s.majority.length) {
|
||||
<p class="level">Presentes en 50 a 95 % del escenario</p>
|
||||
<ul class="factors">
|
||||
@for (e of s.majority; track e.text) {
|
||||
<li [class.robust]="e.robust">{{ e.text }}</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
} @else {
|
||||
<p class="muted">Sin factores de riesgo identificados en este escenario.</p>
|
||||
}
|
||||
} @empty {
|
||||
<p class="muted">El informe del modelo no describe factores de sus escenarios.</p>
|
||||
}
|
||||
`,
|
||||
styles: `
|
||||
.horizon {
|
||||
margin: 4px 0 8px;
|
||||
}
|
||||
.level {
|
||||
margin: 6px 0 2px;
|
||||
font-size: 0.85rem;
|
||||
color: var(--mat-sys-on-surface-variant);
|
||||
}
|
||||
.factors {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 6px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
.factors li {
|
||||
padding: 2px 10px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--mat-sys-primary);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.factors li.robust {
|
||||
background: var(--mat-sys-primary);
|
||||
color: var(--mat-sys-on-primary);
|
||||
}
|
||||
`,
|
||||
})
|
||||
export class Factores {
|
||||
/** Her scenarios' rows (every horizon when the model has several). */
|
||||
readonly rows = input.required<ScenarioFactors[]>();
|
||||
protected readonly chosen = signal<number | undefined>(undefined);
|
||||
protected readonly horizons = computed(() =>
|
||||
[
|
||||
...new Set(
|
||||
this.rows()
|
||||
.map((r) => r.horizonte_meses)
|
||||
.filter((h) => h !== undefined),
|
||||
),
|
||||
].sort((a, b) => a! - b!),
|
||||
);
|
||||
protected readonly horizon = computed(() => this.chosen() ?? this.horizons().at(-1));
|
||||
protected readonly shown = computed(() =>
|
||||
this.rows()
|
||||
.filter((r) => r.horizonte_meses === undefined || r.horizonte_meses === this.horizon())
|
||||
.map((r) => ({
|
||||
escenario: r.escenario,
|
||||
n: r.n_escenario,
|
||||
defining: entries(r.riesgo_definitorios),
|
||||
majority: entries(r.riesgo_mayoritarios),
|
||||
})),
|
||||
);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<p class="muted" role="alert">No se encontró la paciente.</p>
|
||||
} @else if (patient(); as p) {
|
||||
<h1>
|
||||
{{ identity().name ?? 'Paciente' }} <code class="muted">{{ p.id!.slice(0, 10) }}</code>
|
||||
{{ identity().name ?? 'Paciente' }} <code class="muted id">{{ p.id!.slice(0, 10) }}</code>
|
||||
</h1>
|
||||
<dl class="summary">
|
||||
<div>
|
||||
@@ -27,10 +27,37 @@
|
||||
{{ p.gender === 'female' ? 'Femenino' : p.gender === 'male' ? 'Masculino' : 'Sin dato' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Estatus de seguimiento</dt>
|
||||
<dd>{{ status() }}</dd>
|
||||
</div>
|
||||
@if (cama(); as c) {
|
||||
<div>
|
||||
<dt>Grupo de edad</dt>
|
||||
<dd>{{ c.ageGroup || 'No disponible' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Escenario clínico</dt>
|
||||
<dd>{{ c.scenario }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Estatus de seguimiento</dt>
|
||||
<dd>
|
||||
{{ c.status ?? 'Fuera de la lista (' + c.window + ' meses al ' + c.cutoff + ')' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Prioridad</dt>
|
||||
<dd>{{ c.priority ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Días de mastografía a diagnóstico</dt>
|
||||
<dd>{{ c.days ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
} @else {
|
||||
@if (status()) {
|
||||
<div>
|
||||
<dt>Estatus de seguimiento</dt>
|
||||
<dd>{{ status() }}</dd>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if (p.deceasedDateTime) {
|
||||
<div>
|
||||
<dt>Defunción</dt>
|
||||
@@ -40,6 +67,40 @@
|
||||
</dl>
|
||||
|
||||
<div class="cards">
|
||||
@if (cama(); as c) {
|
||||
<mat-card appearance="outlined" data-section="mastografia">
|
||||
<mat-card-header><mat-card-title>Mastografía</mat-card-title></mat-card-header>
|
||||
<mat-card-content>
|
||||
<h3>Última mastografía</h3>
|
||||
<dl class="facts">
|
||||
<div>
|
||||
<dt>Categoría BI-RADS</dt>
|
||||
<dd>{{ c.birads ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Fecha</dt>
|
||||
<dd>{{ c.mammogram ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<mat-card appearance="outlined" data-section="histopatologia">
|
||||
<mat-card-header><mat-card-title>Histopatología</mat-card-title></mat-card-header>
|
||||
<mat-card-content>
|
||||
<h3>Resultado histopatológico</h3>
|
||||
<dl class="facts">
|
||||
<div>
|
||||
<dt>Resultado</dt>
|
||||
<dd>{{ c.histology ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Fecha de reporte de la biopsia</dt>
|
||||
<dd>{{ c.biopsy ?? 'No disponible' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-header><mat-card-title>Historial médico</mat-card-title></mat-card-header>
|
||||
<mat-card-content>
|
||||
@@ -178,7 +239,7 @@
|
||||
Estudio del {{ st.study_date }}:
|
||||
<strong>{{ st.valid ? 'aceptable para el análisis' : 'no aceptable' }}</strong>
|
||||
@if (st.level) {
|
||||
({{ st.level }})
|
||||
({{ levelNames[st.level] ?? st.level }})
|
||||
}
|
||||
</p>
|
||||
<h3>Alteraciones del EEG</h3>
|
||||
@@ -352,41 +413,13 @@
|
||||
</mat-card>
|
||||
}
|
||||
|
||||
@if (models().some((m) => m.model.endsWith('.survival') && m.scenarios.length)) {
|
||||
<mat-card appearance="outlined" class="wide" data-section="supervivencia">
|
||||
<mat-card-header
|
||||
><mat-card-title>Análisis de supervivencia</mat-card-title></mat-card-header
|
||||
>
|
||||
<mat-card-content>
|
||||
@if (survival.isLoading()) {
|
||||
<app-loading what="las curvas de supervivencia" [figure]="true" />
|
||||
} @else if (survival.value(); as s) {
|
||||
<h3>Escenario clínico de la paciente</h3>
|
||||
<ul class="scenarios">
|
||||
@for (name of s.scenarios; track name) {
|
||||
<li>{{ name }}</li>
|
||||
}
|
||||
</ul>
|
||||
@for (f of s.figures; track f.title) {
|
||||
<h4>{{ f.title }}</h4>
|
||||
<app-plot [figure]="f.figure" [height]="340" />
|
||||
} @empty {
|
||||
<p class="muted">
|
||||
Sus escenarios tienen menos fallecimientos de los necesarios para trazar curvas.
|
||||
</p>
|
||||
}
|
||||
} @else if (survival.error()) {
|
||||
<p class="muted" role="alert">No se pudo leer el informe del modelo.</p>
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
@if (recurrenceModel(); as rm) {
|
||||
<mat-card appearance="outlined" class="wide" data-section="recurrencia">
|
||||
<mat-card-header
|
||||
><mat-card-title>Análisis de recurrencia</mat-card-title></mat-card-header
|
||||
><mat-card-title>Pronóstico y recomendaciones</mat-card-title></mat-card-header
|
||||
>
|
||||
<mat-card-content>
|
||||
<h3>Análisis de recurrencia</h3>
|
||||
<table class="plain">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -420,12 +453,42 @@
|
||||
Sus escenarios tienen menos recaídas de las necesarias para trazar curvas.
|
||||
</p>
|
||||
}
|
||||
<app-factores [rows]="s.factors" />
|
||||
} @else if (recurrence.error()) {
|
||||
<p class="muted" role="alert">No se pudo leer el informe del modelo.</p>
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
@if (models().some((m) => m.model.endsWith('.survival') && m.scenarios.length)) {
|
||||
<mat-card appearance="outlined" class="wide" data-section="supervivencia">
|
||||
<mat-card-header><mat-card-title>Riesgo de muerte</mat-card-title></mat-card-header>
|
||||
<mat-card-content>
|
||||
<h3>Análisis de supervivencia</h3>
|
||||
@if (survival.isLoading()) {
|
||||
<app-loading what="las curvas de supervivencia" [figure]="true" />
|
||||
} @else if (survival.value(); as s) {
|
||||
<h3>Escenario clínico de la paciente</h3>
|
||||
<ul class="scenarios">
|
||||
@for (name of s.scenarios; track name) {
|
||||
<li>{{ name }}</li>
|
||||
}
|
||||
</ul>
|
||||
@for (f of s.figures; track f.title) {
|
||||
<h4>{{ f.title }}</h4>
|
||||
<app-plot [figure]="f.figure" [height]="340" />
|
||||
} @empty {
|
||||
<p class="muted">
|
||||
Sus escenarios tienen menos fallecimientos de los necesarios para trazar curvas.
|
||||
</p>
|
||||
}
|
||||
<app-factores [rows]="s.factors" />
|
||||
} @else if (survival.error()) {
|
||||
<p class="muted" role="alert">No se pudo leer el informe del modelo.</p>
|
||||
}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
} @else if (loading()) {
|
||||
<app-loading what="el expediente" />
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
.summary {
|
||||
.summary,
|
||||
.facts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-6);
|
||||
margin: var(--space-3) 0 var(--space-4);
|
||||
}
|
||||
|
||||
.summary dt {
|
||||
.summary dt,
|
||||
.facts dt {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.summary dd {
|
||||
.summary dd,
|
||||
.facts dd {
|
||||
font-weight: 500;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -88,3 +91,10 @@ tr.chosen td {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
|
||||
h1 .id {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-left: var(--space-2);
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import { readReport$Json } from '../api/fn/models/read-report-json';
|
||||
import type { Domain } from '../api/models/domain';
|
||||
import { code, EXT, ext, Fhir, label, resources } from '../fhir';
|
||||
import { scenarioFigure } from '../gobernanza/figures';
|
||||
import { CURP } from '../indicadores/follow-up';
|
||||
import { LABELS, name } from '../indicadores/measures';
|
||||
import { ageGroup, CAMA_AGE_GROUPS, camaRows, CURP } from '../indicadores/follow-up';
|
||||
import { LABELS, name, PRIORITY } from '../indicadores/measures';
|
||||
import {
|
||||
BIOMARKER_NAMES,
|
||||
byDeviation,
|
||||
@@ -28,10 +28,12 @@ import {
|
||||
METRIC_NAMES,
|
||||
OUTCOME_NAMES,
|
||||
ZONE_NAMES,
|
||||
LEVEL_NAMES,
|
||||
} from '../eeg-labels';
|
||||
import type { Relation } from '../api/models/relation';
|
||||
import { Figure, PALETTE, Plot } from '../plot';
|
||||
import { Loading } from '../loading';
|
||||
import { Factores, ScenarioFactors } from './factores';
|
||||
|
||||
/** An Observation's value as the screens say it, whatever its type. */
|
||||
function shown(o: Observation): string {
|
||||
@@ -49,7 +51,16 @@ function shown(o: Observation): string {
|
||||
* champion models' risks with their curves. Everything read from the FHIR API. */
|
||||
@Component({
|
||||
selector: 'app-paciente',
|
||||
imports: [Loading, DecimalPipe, MatButtonModule, MatCardModule, MatIconModule, RouterLink, Plot],
|
||||
imports: [
|
||||
Factores,
|
||||
Loading,
|
||||
DecimalPipe,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
RouterLink,
|
||||
Plot,
|
||||
],
|
||||
templateUrl: './paciente.html',
|
||||
styleUrl: './paciente.scss',
|
||||
})
|
||||
@@ -58,6 +69,9 @@ export class Paciente {
|
||||
private readonly api = inject(Api);
|
||||
readonly domain = input.required<string>();
|
||||
readonly id = input.required<string>();
|
||||
/** The follow-up list she was opened from: its window (months) and cut-off. */
|
||||
readonly ventana = input<string>();
|
||||
readonly corte = input<string>();
|
||||
|
||||
private readonly data = resource({
|
||||
params: () => ({ domain: this.domain(), id: this.id() }),
|
||||
@@ -117,7 +131,11 @@ export class Paciente {
|
||||
reported: ext(r, 'report-date')?.valueDate,
|
||||
kind: label(r.code),
|
||||
status: r.status,
|
||||
results: [...results.map((o) => `${label(o.code)}: ${shown(o)}`)],
|
||||
// "BI-RADS 4C", not "BI-RADS: BI-RADS 4C"
|
||||
results: results.map((o) => {
|
||||
const [name, value] = [label(o.code), shown(o)];
|
||||
return value.startsWith(name) ? value : `${name}: ${value}`;
|
||||
}),
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -175,7 +193,16 @@ export class Paciente {
|
||||
const mine = (all: any[]) => all.filter((e) => m.scenarios.includes(e.escenario));
|
||||
if (name === 'recurrence') {
|
||||
const r = (report?.['recurrencia'] ?? {}) as any;
|
||||
// The risk factors of her scenarios, by horizon (the development tables).
|
||||
const technical = (await this.api.invoke(readReport$Json, {
|
||||
domain: domain as Domain,
|
||||
name,
|
||||
version: m.version,
|
||||
report: 'technical_validation',
|
||||
})) as any;
|
||||
const summary = technical?.['recurrencia_desarrollo']?.['tablas']?.['escenarios_resumen'];
|
||||
return {
|
||||
factors: mine(summary?.['filas'] ?? []) as ScenarioFactors[],
|
||||
scenarios: m.scenarios,
|
||||
figures: mine(r['escenarios'] ?? []).map((e) =>
|
||||
scenarioFigure(
|
||||
@@ -188,6 +215,7 @@ export class Paciente {
|
||||
};
|
||||
}
|
||||
return {
|
||||
factors: mine((report?.['factores_escenarios'] ?? []) as any[]) as ScenarioFactors[],
|
||||
scenarios: m.scenarios,
|
||||
figures: mine((report?.['escenarios'] ?? []) as any[]).map((e) =>
|
||||
scenarioFigure(
|
||||
@@ -338,7 +366,7 @@ export class Paciente {
|
||||
x,
|
||||
y: m.predictions.map((p) => p.p * 100),
|
||||
mode: 'lines+markers',
|
||||
name: m.model.replace('cacu.', ''),
|
||||
name: m.text.replace(/ v\d+$/, ''),
|
||||
line: { color },
|
||||
},
|
||||
];
|
||||
@@ -358,12 +386,78 @@ export class Paciente {
|
||||
return Math.max(0, ...this.models().flatMap((m) => m.predictions.map((p) => p.high ?? p.p)));
|
||||
}
|
||||
protected readonly name = name;
|
||||
protected readonly levelNames = LEVEL_NAMES;
|
||||
protected readonly identity = computed(() => {
|
||||
const p = this.patient();
|
||||
return {
|
||||
name: p?.name?.[0]?.text,
|
||||
curp: p?.identifier?.find((i) => i.system === CURP)?.value,
|
||||
numbers: (p?.identifier ?? []).filter((i) => i.system !== CURP).map((i) => i.value),
|
||||
// each record number once (several sources may carry the same one)
|
||||
numbers: [
|
||||
...new Set(
|
||||
(p?.identifier ?? []).filter((i) => i.system !== CURP).map((i) => i.value ?? ''),
|
||||
),
|
||||
].filter(Boolean),
|
||||
};
|
||||
});
|
||||
/** CaMa: her row on the follow-up list (window and cut-off as opened, else the widest
|
||||
* window up to the last day with data), as the list shows it: the old record's card. */
|
||||
private readonly listed = resource({
|
||||
params: () =>
|
||||
this.domain() === 'cama'
|
||||
? {
|
||||
domain: this.domain(),
|
||||
id: this.id(),
|
||||
window: Number(this.ventana()) || 12,
|
||||
cutoff: this.corte() || undefined,
|
||||
}
|
||||
: undefined,
|
||||
loader: async ({ params: { domain, id, window, cutoff } }) => {
|
||||
const page = await this.fhir.search(domain, 'Patient', {
|
||||
_id: id,
|
||||
'follow-up-window': window,
|
||||
'follow-up-cutoff': cutoff,
|
||||
_revinclude: ['DiagnosticReport:subject'],
|
||||
'_include:iterate': 'DiagnosticReport:result',
|
||||
});
|
||||
const self = page.link?.find((l) => l.relation === 'self')?.url;
|
||||
const applied = self ? (new URL(self).searchParams.get('follow-up-cutoff') ?? '') : '';
|
||||
return { window, cutoff: applied, row: camaRows(page, applied)[0] };
|
||||
},
|
||||
});
|
||||
protected readonly cama = computed(() => {
|
||||
const found = this.listed.value();
|
||||
const d = this.data.value();
|
||||
if (!found || !d) return undefined;
|
||||
// Her own latest mammogram and biopsy, on the list or not.
|
||||
const latest = (study: string) =>
|
||||
d.reports
|
||||
.filter((r) => code(r.code) === study)
|
||||
.sort((a, b) => (a.effectiveDateTime ?? '').localeCompare(b.effectiveDateTime ?? ''))
|
||||
.at(-1);
|
||||
const value = (r: DiagnosticReport | undefined, field: string) => {
|
||||
const o = (r?.result ?? [])
|
||||
.map((x) => d.observations.get(x.reference?.split('/')[1]))
|
||||
.find((x) => code(x?.code) === field);
|
||||
return o ? shown(o) : undefined;
|
||||
};
|
||||
const mammogram = latest('mammography');
|
||||
const biopsy = latest('breast_biopsy');
|
||||
const treated = d.procedures.some((p) => (p.performedDateTime ?? '') <= found.cutoff);
|
||||
const r = found.row;
|
||||
return {
|
||||
...found,
|
||||
ageGroup: r?.ageGroup ?? ageGroup(d.patient.birthDate, found.cutoff, CAMA_AGE_GROUPS),
|
||||
scenario: treated ? 'Post-tratamiento' : 'En observación',
|
||||
status: r ? name(r.status) : undefined,
|
||||
priority: r ? (PRIORITY[r.priority] ?? r.priority) : undefined,
|
||||
birads: value(mammogram, 'mammography.birads'),
|
||||
mammogram: mammogram?.effectiveDateTime?.slice(0, 10),
|
||||
days: mammogram ? ext(mammogram, 'days-to-diagnosis')?.valueInteger : undefined,
|
||||
histology: value(biopsy, 'breast_biopsy.histology'),
|
||||
biopsy: biopsy
|
||||
? (ext(biopsy, 'report-date')?.valueDate ?? biopsy.effectiveDateTime)
|
||||
: undefined,
|
||||
};
|
||||
});
|
||||
protected readonly status = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user