diff --git a/src/app/paciente/paciente.ts b/src/app/paciente/paciente.ts index 7bdbddd..23fe2e5 100644 --- a/src/app/paciente/paciente.ts +++ b/src/app/paciente/paciente.ts @@ -158,18 +158,17 @@ export class Paciente { }); protected readonly cutoff = computed(() => this.corte() ?? new Date().toLocaleDateString('sv')); protected readonly age = computed(() => ageAt(this.patient()?.birthDate, this.cutoff())); - /** Why she has no risk estimate; nothing when she is eligible. Only while the backend gives - * no decision (failure, gold not updated) is the hysterectomy of her record held against it. */ + /** Why she has no risk estimate; nothing when she is eligible. The backend's reason first; the + * hysterectomy of her record is still held against her when the backend does not report it, + * as with evidence loaded without the day it was available. */ protected readonly riskExclusion = computed(() => { if (this.domain() !== 'cacu') return undefined; const patient = this.patient(); const sample = this.citologia()?.slice(0, 10); const index = sample && sample < this.cutoff() ? sample : this.cutoff(); - const state = this.eligibility(); - if (state.kind === 'evaluated' || state.kind === 'none') { - const status = (patient && ext(patient, 'follow-up-status')?.valueCoding?.code) ?? ''; - return ineligibility(state, status, index); - } + const status = (patient && ext(patient, 'follow-up-status')?.valueCoding?.code) ?? ''; + const reported = ineligibility(this.eligibility(), status, index); + if (reported) return reported; const recorded = patient && ext(patient, 'first-hysterectomy-recorded')?.valueDate; return recorded && recorded <= index ? `No disponible por: histerectomía registrada el ${recorded}.`