From 5bd82187a4240746fe35368dc7bd3fc23ce6f091 Mon Sep 17 00:00:00 2001 From: henrykorir Date: Fri, 15 Sep 2023 12:36:44 +0300 Subject: [PATCH 1/3] POC-536: Display all the available PCR results on the HEI summary --- .../hiv-summary-latest.component.html | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html index 213903d83..9bb83dba8 100644 --- a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html +++ b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html @@ -278,11 +278,41 @@ Current weight (kg): {{ hivSummary?.weight !== null ? hivSummary?.weight : 'NONE' }} -
  • - Last PCR status: {{ lastPCRStatus }} +
  • + PCR 1 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_1_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_1 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_1_date | date: 'dd-MM-yyyy' }} +
  • -
  • - Last PCR Date: {{ lastPCRDate | date: 'dd-MM-yyyy' }} +
  • + PCR 2 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_2_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_2 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_2_date | date: 'dd-MM-yyyy' }} +
    +
  • +
  • + PCR 3 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_3_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_3 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_3_date | date: 'dd-MM-yyyy' }} +
  • Current ART Prophylaxis: {{ hivSummary?.cur_arv_meds }} From 7b8b50285211e02b3ad36314498458dcfb84a3b4 Mon Sep 17 00:00:00 2001 From: henrykorir Date: Wed, 13 Sep 2023 16:07:39 +0300 Subject: [PATCH 2/3] POC-536: Display all the available PCR results on the HEI summary --- .../hiv-summary-latest.component.ts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts index 0c1b3edbf..2aedc1c4a 100644 --- a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts +++ b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts @@ -58,6 +58,14 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { public infantFeedingMethod: string; public heiOutCome: string; public pcpProphylaxis: string; + public pcrSnapShop = { + hiv_dna_pcr_1: null, + hiv_dna_pcr_1_at: null, + hiv_dna_pcr_2: null, + hiv_dna_pcr_2_at: null, + hiv_dna_pcr_3: null, + hiv_dna_pcr_3_at: null + }; constructor( private hivSummaryService: HivSummaryService, @@ -238,11 +246,13 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { this.hivSummary.vl_1 = filtered.vl_1; } if (this.isHEIActive) { + console.log(this.hivSummary); this.lastPCRDate = this.getLastPCRDate(); this.lastPCRStatus = this.getLastPCRStatus(); this.infantFeedingMethod = this.getInfantFeedingMethod(); this.heiOutCome = this.getHEIOutcome(); this.pcpProphylaxis = this.getPCPprophylaxis(); + this.getHEIPCRSnapshot(); } } this.getPatientEligibility(this.hivSummary); @@ -469,4 +479,50 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { } return 'NONE'; } + + private pcr_status_helper(pcr_status: number): string { + if (pcr_status === 664) { + return 'NEGATIVE'; + } else if (pcr_status === 703) { + return 'POSITIVE'; + } else if (pcr_status === 1118) { + return 'NOT DONE'; + } else if (pcr_status === 1138) { + return 'INDETERMINATE'; + } else if (pcr_status === 1304) { + return 'POOR SAMPLE QUALITY'; + } else { + return 'NONE'; + } + } + + private calculate_age_by_pcr_date(pcr_date: string): number { + const age = Moment(pcr_date).diff( + Moment(this.hivSummary.birth_date), + 'months' + ); + return age; + } + + public getHEIPCRSnapshot(): void { + this.pcrSnapShop.hiv_dna_pcr_1 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_1 + ); + this.pcrSnapShop.hiv_dna_pcr_2 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_2 + ); + this.pcrSnapShop.hiv_dna_pcr_3 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_3 + ); + + this.pcrSnapShop.hiv_dna_pcr_1_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_1_date + ); + this.pcrSnapShop.hiv_dna_pcr_2_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_2_date + ); + this.pcrSnapShop.hiv_dna_pcr_3_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_3_date + ); + } } From 9fcc4ce1c478a3d974ff3bc2a999316d9ad73e3a Mon Sep 17 00:00:00 2001 From: Henry Korir <5462699+henrykorir@users.noreply.github.com> Date: Fri, 29 Sep 2023 08:44:58 +0300 Subject: [PATCH 3/3] Update hiv-summary-latest.component.ts --- .../hiv/hiv-summary/hiv-summary-latest.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts index 2aedc1c4a..5f717a050 100644 --- a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts +++ b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts @@ -246,7 +246,6 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { this.hivSummary.vl_1 = filtered.vl_1; } if (this.isHEIActive) { - console.log(this.hivSummary); this.lastPCRDate = this.getLastPCRDate(); this.lastPCRStatus = this.getLastPCRStatus(); this.infantFeedingMethod = this.getInfantFeedingMethod();