3b246b4f1f
Rows name their patient with pac_id (a decimal string) or the legacy id_seudonimo. pac_id wins; an invalid pac_id is never replaced by the legacy field, and a page that repeats a patient or mixes both fields is not drawn or exported. The table, patient record, PDF and spreadsheet follow the announced identifier column and label. CaCu requests risk only with a pac_id.
24 lines
876 B
TypeScript
24 lines
876 B
TypeScript
import { Component, effect, inject, input } from '@angular/core';
|
|
import { DecimalPipe } from '@angular/common';
|
|
import { PacienteRiesgoState } from './paciente-riesgo.state';
|
|
import { tieneIntervalo } from './paciente-riesgo.validation';
|
|
|
|
@Component({
|
|
selector: 'app-paciente-riesgo-tabla',
|
|
imports: [DecimalPipe],
|
|
providers: [PacienteRiesgoState],
|
|
templateUrl: './paciente-riesgo-tabla.html',
|
|
styleUrl: './paciente-riesgo-tabla.scss',
|
|
})
|
|
export class PacienteRiesgoTabla {
|
|
/** The patient's `pac_id`, or `null` when the row has none: the risk is then unavailable and nothing is requested. */
|
|
readonly pacId = input.required<string | null>();
|
|
private readonly state = inject(PacienteRiesgoState);
|
|
readonly estado = this.state.estado;
|
|
readonly tieneIntervalo = tieneIntervalo;
|
|
|
|
constructor() {
|
|
effect(() => this.state.pacId.set(this.pacId()));
|
|
}
|
|
}
|