T10/T11: the TEA record and the risk page render inside rebuild's patient frame

Paciente renders the TEA record and, on the risk route, the risk page with
the same frame as CaCu and CaMa: back link, title with id, identity block
from the FHIR Patient (name, birth date, sex, one row per identifier
system), sections as one card component, Material controls for the
altered-zones toggle and the pair choice, export button in rebuild's style.
tea-patient.ts, tea-record.html, tea-risk.html and tea-section.html/scss are
deleted; the logic specs follow the new structure.
This commit is contained in:
2026-12-01 02:02:56 -06:00
parent 48e6c9f390
commit 6df008bf8a
13 changed files with 739 additions and 816 deletions
+90
View File
@@ -0,0 +1,90 @@
import { Component, input } from '@angular/core';
import { MatCardModule } from '@angular/material/card';
import { Plot } from '../plot';
import { Section } from './tea-sections';
@Component({
selector: 'app-tea-section',
imports: [MatCardModule, Plot],
template: `
<mat-card appearance="outlined">
<mat-card-header><mat-card-title>{{ section().title }}</mat-card-title></mat-card-header>
<mat-card-content>
<ng-content />
@for (block of section().blocks; track $index) {
@if (block.title) {
<h3>{{ block.title }}</h3>
}
@if (block.text) {
<p>{{ block.text }}</p>
}
@if (block.fields; as fields) {
<dl>
@for (field of fields; track $index) {
<div>
<dt>{{ field[0] }}</dt>
<dd>{{ field[1] }}</dd>
</div>
}
</dl>
}
@if (block.table; as table) {
@if (table.rows.length) {
<table class="plain">
<thead>
<tr>
@for (header of table.headers; track $index) {
<th scope="col">{{ header }}</th>
}
</tr>
</thead>
<tbody>
@for (row of table.rows; track $index) {
<tr>
@for (cell of row; track $index) {
<td>{{ cell }}</td>
}
</tr>
}
</tbody>
</table>
} @else {
<p class="muted">—</p>
}
}
@if (block.chart; as chart) {
<h3>{{ chart.title }}</h3>
<app-plot [figure]="chart.figure" [height]="chart.height ?? 340" />
}
} @empty {
<p class="muted">—</p>
}
</mat-card-content>
</mat-card>
`,
styles: `
:host {
display: block;
}
mat-card-content {
overflow-x: auto;
}
dl {
display: flex;
flex-wrap: wrap;
gap: var(--space-4);
margin-block: var(--space-3);
}
dt {
color: var(--color-text-secondary);
font-size: 12px;
}
dd {
margin: 0;
font-weight: 500;
}
`,
})
export class TeaSection {
readonly section = input.required<Section>();
}