Conservar la exclusión por histerectomía cuando la API no la reporta

This commit is contained in:
2026-12-02 20:26:14 -06:00
parent 3693991772
commit cca9517b7c
+6 -7
View File
@@ -158,18 +158,17 @@ export class Paciente {
}); });
protected readonly cutoff = computed(() => this.corte() ?? new Date().toLocaleDateString('sv')); protected readonly cutoff = computed(() => this.corte() ?? new Date().toLocaleDateString('sv'));
protected readonly age = computed(() => ageAt(this.patient()?.birthDate, this.cutoff())); 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 /** Why she has no risk estimate; nothing when she is eligible. The backend's reason first; the
* no decision (failure, gold not updated) is the hysterectomy of her record held against it. */ * 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(() => { protected readonly riskExclusion = computed(() => {
if (this.domain() !== 'cacu') return undefined; if (this.domain() !== 'cacu') return undefined;
const patient = this.patient(); const patient = this.patient();
const sample = this.citologia()?.slice(0, 10); const sample = this.citologia()?.slice(0, 10);
const index = sample && sample < this.cutoff() ? sample : this.cutoff(); const index = sample && sample < this.cutoff() ? sample : this.cutoff();
const state = this.eligibility(); const status = (patient && ext(patient, 'follow-up-status')?.valueCoding?.code) ?? '';
if (state.kind === 'evaluated' || state.kind === 'none') { const reported = ineligibility(this.eligibility(), status, index);
const status = (patient && ext(patient, 'follow-up-status')?.valueCoding?.code) ?? ''; if (reported) return reported;
return ineligibility(state, status, index);
}
const recorded = patient && ext(patient, 'first-hysterectomy-recorded')?.valueDate; const recorded = patient && ext(patient, 'first-hysterectomy-recorded')?.valueDate;
return recorded && recorded <= index return recorded && recorded <= index
? `No disponible por: histerectomía registrada el ${recorded}.` ? `No disponible por: histerectomía registrada el ${recorded}.`