Add breast cancer follow-up reports and patient record

This commit is contained in:
Angel Capetillo Zavala
2026-11-12 22:40:21 -06:00
parent 17a91d3924
commit b84d428814
33 changed files with 2008 additions and 16 deletions
@@ -1,4 +1,4 @@
import { afterNextRender, ChangeDetectorRef, Component, DestroyRef, inject, Injector, Input, OnChanges, output } from '@angular/core';
import { afterNextRender, ChangeDetectorRef, Component, DestroyRef, inject, Injector, Input, OnChanges, output, signal } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -30,6 +30,9 @@ export class IndicadoresTracking implements OnChanges {
private readonly injector = inject(Injector);
readonly pacienteDetalle = inject(PacienteDetalleState);
readonly fichaPacienteAbierta = output<boolean>();
/** CaMa's record opens inside its own table; this hides the section title while it does. */
readonly camaFichaAbierta = signal(false);
cambiaFichaCama(abierta: boolean) { this.camaFichaAbierta.set(abierta); this.fichaPacienteAbierta.emit(abierta); }
private controlPaciente?: HTMLElement;
private readonly requests = new Subject<SeguimientoQuery | null>();
private initialized = false;
@@ -70,7 +73,9 @@ export class IndicadoresTracking implements OnChanges {
}
ngOnChanges() {
if (this.previousDomain !== this.dominio) {
if (this.pacienteDetalle.estado().tipo !== 'cerrado') this.fichaPacienteAbierta.emit(false);
// Changing domain removes the table that holds CaMa's record, so the page is told here that no record shows.
if (this.pacienteDetalle.estado().tipo !== 'cerrado' || this.camaFichaAbierta()) this.fichaPacienteAbierta.emit(false);
this.camaFichaAbierta.set(false);
this.pacienteDetalle.cerrar(); this.controlPaciente = undefined;
this.previousDomain = this.dominio; this.requests.next(null); this.data = undefined;
this.status = 'idle'; this.statuses = []; this.initialized = false; this.draft = { meses: 3, page: 1, page_size: 50 }; this.applied = { ...this.draft };