Integrate CaCu indicators, risk views and exports

Adapted from Angel Capetillo Zavala commits c0e4920 and 31400c7 and Edgar Hinojosas CaCu measures. Includes the existing 6F presentation and external donut labels.

Co-authored-by: edgar <edgar.hinojosas@uanl.edu.mx>
This commit is contained in:
Angel Capetillo Zavala
2026-11-30 16:02:00 -06:00
parent bc621f34f9
commit 44f3dce911
32 changed files with 3725 additions and 152 deletions
+93
View File
@@ -1,4 +1,14 @@
<section class="page">
@if (domain() === 'cacu' && patient()) {
<div class="export-actions">
<button mat-stroked-button type="button" [disabled]="exporting()" (click)="exportPatient()">
Exportar ficha PDF
</button>
</div>
}
@if (exportError()) {
<p class="muted" role="alert">{{ exportError() }}</p>
}
<a mat-button [routerLink]="['/indicadores', domain()]"
><mat-icon>arrow_back</mat-icon> Regresar</a
>
@@ -7,6 +17,9 @@
} @else if (patient(); as p) {
<h1>
{{ identity().name ?? 'Paciente' }} <code class="muted id">{{ p.id!.slice(0, 10) }}</code>
@if (domain() === 'cacu') {
· Edad: {{ age() ?? 'No disponible' }}
}
</h1>
<dl class="summary">
<div>
@@ -104,6 +117,20 @@
<mat-card appearance="outlined">
<mat-card-header><mat-card-title>Historial médico</mat-card-title></mat-card-header>
<mat-card-content>
@if (domain() === 'cacu') {
<app-stages
[sample]="sample()"
[report]="sampleReportDate()"
[cutoff]="cutoff()"
[facts]="sampleFacts()"
[detail]="true"
/>
<p class="muted route-note">
Etapas de la citología{{ sample() ? ' del ' + sample() : '' }} a la fecha de corte
{{ cutoff() }}. «Inferida temporalmente» es una asociación por cercanía de fechas, no
un vínculo clínico confirmado; «Desconocida» indica que no hay dato.
</p>
}
<table class="plain">
<thead>
<tr>
@@ -169,6 +196,72 @@
><mat-card-title>Riesgos y recomendaciones</mat-card-title></mat-card-header
>
<mat-card-content>
@if (domain() === 'cacu') {
<p class="muted">
Divisiones numéricas descriptivas; no representan umbrales clínicos.
</p>
@for (model of riskScales(); track model.model) {
<h3>{{ model.model }} · fecha índice {{ model.index }}</h3>
@for (
scale of [
{ label: 'Riesgo inmediato (al índice)', value: model.immediate },
{ label: 'Riesgo a 5 años', value: model.five },
];
track scale.label
) {
<div class="risk-scale">
<p>
<strong>{{ scale.label }}</strong>
@if (scale.value; as v) {
@if (v.low !== undefined && v.high !== undefined) {
· IC 95 %: {{ v.low * 100 | number: '1.1-2' }}–{{
v.high * 100 | number: '1.1-2'
}}
%
}
} @else {
· No disponible
}
</p>
<div class="risk-plot" [class.unavailable]="!scale.value">
<div class="risk-line" aria-hidden="true"></div>
@if (scale.value; as v) {
<span
class="risk-marker"
[style.left.%]="v.value * 100"
aria-hidden="true"
></span>
<strong
class="risk-value"
[style.left]="'clamp(2.5rem, ' + v.value * 100 + '%, calc(100% - 2.5rem))'"
>{{ v.value * 100 | number: '1.1-2' }} %</strong
>
}
</div>
<div class="risk-labels">
<span>0 %</span><span>25 %</span><span>50 %</span><span>75 %</span
><span>100 %</span>
</div>
</div>
}
} @empty {
@for (label of ['Riesgo inmediato', 'Riesgo a 5 años']; track label) {
<div class="risk-scale">
<p>
<strong>{{ label }}</strong> · No disponible
</p>
<div class="risk-plot unavailable">
<div class="risk-line" aria-hidden="true"></div>
</div>
<div class="risk-labels">
<span>0 %</span><span>25 %</span><span>50 %</span><span>75 %</span
><span>100 %</span>
</div>
</div>
}
<p class="muted">Ningún modelo vigente la ha evaluado.</p>
}
}
@if (models().length) {
<table class="plain">
<thead>