From d0cded1879b969f7d9fc63cca54cc1b7cb153644 Mon Sep 17 00:00:00 2001 From: Henry Korir <5462699+henrykorir@users.noreply.github.com> Date: Fri, 29 Sep 2023 07:59:15 +0300 Subject: [PATCH] POC-539: Display latest PCR and Infant feeding method under HEI Snapshot (#1669) --- .../hiv-program-snapshot.component.html | 52 +++++++---- .../hiv-program-snapshot.component.ts | 88 +++++++++++++++++++ 2 files changed, 123 insertions(+), 17 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 7cbc151b5..f0c1f2de4 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 @@ -93,24 +93,12 @@

Last Encounter

-
+

Date: {{ patientData?.encounter_datetime | date: 'dd-MM-yyyy' }}

-
+

Type: {{ @@ -125,8 +113,11 @@

Last Encounter

ARV Regimen: {{ patientData?.cur_arv_meds }}

-
-

+

+

Last Viral Load: {{ patientData?.latest_vl | zeroVl }} ({{ @@ -135,6 +126,12 @@

Last Encounter

>)

+

+ Age PCR Done: {{ age_of_ped_on_last_pcr }}M +

Last Encounter

-

RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }}

+

+ RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }} +

+

+ Infant Feeding Method: {{ infant_feeding_method }} +

Disclosure Status: @@ -211,6 +213,14 @@

Last Encounter

+
+

+ PCR Results: + + {{ 'NEGATIVE' }} + +

+
Last Encounter
+
+
+

RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }}

+
+
+

Date of PCR: {{ last_pcr_date | date: 'dd-MM-yyyy' }}

+
+
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 9a2d15ad2..b07e0bb40 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,6 +124,10 @@ export class HivProgramSnapshotComponent implements OnInit { public prediction: any; public isHEIActive = false; + public age_of_ped_on_last_pcr: number; + public last_pcr_status: string; + public last_pcr_date: string; + public infant_feeding_method: string; constructor( private hivSummaryResourceService: HivSummaryResourceService, @@ -251,6 +255,15 @@ export class HivProgramSnapshotComponent implements OnInit { this.resolveLastEncounterLocation(this.patientData.location_uuid); } } + 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' + ); + } }); } @@ -725,4 +738,79 @@ export class HivProgramSnapshotComponent implements OnInit { return latestStatus[0]; } + + public getLastPCRDate(): string { + let last_pcr_date = ''; + + if (this.patientData.hiv_dna_pcr_4_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_4_date; + } else if (this.patientData.hiv_dna_pcr_3_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_3_date; + } else if (this.patientData.hiv_dna_pcr_2_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_2_date; + } else if (this.patientData.hiv_dna_pcr_1_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_1_date; + } else { + return ''; + } + + return last_pcr_date; + } + + public getLastPCRStatus(): string { + let last_pcr_status: number; + + if (this.patientData.hiv_dna_pcr_resulted !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_resulted; + } else if (this.patientData.hiv_dna_pcr_4 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_4; + } else if (this.patientData.hiv_dna_pcr_3 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_3; + } else if (this.patientData.hiv_dna_pcr_2 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_2; + } else if (this.patientData.hiv_dna_pcr_1 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_1; + } else { + last_pcr_status = null; + } + if (last_pcr_status === 664) { + return 'NEGATIVE'; + } else if (last_pcr_status === 703) { + return 'POSITIVE'; + } else if (last_pcr_status === 1118) { + return 'NOT DONE'; + } else if (last_pcr_status === 1138) { + return 'INDETERMINATE'; + } else if (last_pcr_status === 1304) { + return 'POOR SAMPLE QUALITY'; + } else { + return 'NONE'; + } + } + + public getInfantFeedingMethod(): string { + const INFANT_FEEDING_METHODS = [ + 'NONE', + 'EXPRESSED BREASTMILK', + 'WEANED', + 'INFANT FORMULA', + 'BREASTFEEDING PREDOMINATELY', + 'MIXED FEEDING', + 'BREASTFEEDING EXCLUSIVELY', + 'COW MILK', + 'REGULAR FOOD', + 'BREASTFEEDING', + 'LIQUID FOODS OTHER THAN BREAST MILK', + 'WATER', + 'SOLID FOOD', + 'UJI', + 'OTHER NON-CODED', + 'COMPLEMENTARY FEEDING', + 'PLUMPY NUT', + 'NEVER BREASTFED', + 'CHILD ON REPLACEMENT FEEDING' + ]; + + return INFANT_FEEDING_METHODS[this.patientData.infant_feeding_method]; + } }