From 513fe01ea08b3035f401a1e3f392690988ec9809 Mon Sep 17 00:00:00 2001 From: Henry Korir <5462699+henrykorir@users.noreply.github.com> Date: Wed, 4 Oct 2023 16:02:17 +0300 Subject: [PATCH] [POC-539-fix] dna pcr snapshot (#1674) --- .../hiv-program-snapshot.component.html | 4 ++-- .../hiv-program-snapshot.component.ts | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html index f0c1f2de4..bcde35032 100644 --- a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html +++ b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html @@ -130,7 +130,7 @@
Last Encounter
PCR Results: - {{ 'NEGATIVE' }} + {{ last_pcr_status }}
diff --git a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts index b07e0bb40..050f7b703 100644 --- a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts +++ b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts @@ -124,7 +124,7 @@ export class HivProgramSnapshotComponent implements OnInit { public prediction: any; public isHEIActive = false; - public age_of_ped_on_last_pcr: number; + public age_of_ped_on_last_pcr: string; public last_pcr_status: string; public last_pcr_date: string; public infant_feeding_method: string; @@ -256,13 +256,18 @@ export class HivProgramSnapshotComponent implements OnInit { } } if (this.isHEIActive) { - this.last_pcr_date = this.getLastPCRDate(); - this.last_pcr_status = this.getLastPCRStatus(); this.infant_feeding_method = this.getInfantFeedingMethod(); - this.age_of_ped_on_last_pcr = moment(this.last_pcr_date).diff( - moment(this.patientData.birth_date), - 'months' - ); + this.last_pcr_date = this.getLastPCRDate(); + if (this.last_pcr_date === '') { + this.age_of_ped_on_last_pcr = ''; + this.last_pcr_status = ''; + } else { + this.last_pcr_status = this.getLastPCRStatus(); + this.age_of_ped_on_last_pcr = + moment(this.last_pcr_date) + .diff(moment(this.patientData.birth_date), 'months') + .toString() + 'M'; + } } }); }