Skip to content

Commit

Permalink
POC-536: Display all the available PCR results on the HEI summary (AM…
Browse files Browse the repository at this point in the history
…PATH#1668)

* POC-536: Display all the available PCR results on the HEI summary

* POC-536: Display all the available PCR results on the HEI summary

* Update hiv-summary-latest.component.ts

---------

Co-authored-by: Drizzentic <[email protected]>
  • Loading branch information
henrykorir and drizzentic authored Sep 29, 2023
1 parent 662bff3 commit 6dd2a93
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,41 @@
Current weight (kg):
{{ hivSummary?.weight !== null ? hivSummary?.weight : 'NONE' }}
</li>
<li class="list-group-item" style="font-size: large">
Last PCR status: {{ lastPCRStatus }}
<li
*ngIf="hivSummary?.hiv_dna_pcr_1"
class="list-group-item"
style="font-size: large"
>
PCR 1
<div>Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_1_at }}M</div>
<div>PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_1 }}</div>
<div>
Date Done: {{ hivSummary?.hiv_dna_pcr_1_date | date: 'dd-MM-yyyy' }}
</div>
</li>
<li class="list-group-item" style="font-size: large">
Last PCR Date: {{ lastPCRDate | date: 'dd-MM-yyyy' }}
<li
*ngIf="hivSummary?.hiv_dna_pcr_2"
class="list-group-item"
style="font-size: large"
>
PCR 2
<div>Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_2_at }}M</div>
<div>PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_2 }}</div>
<div>
Date Done: {{ hivSummary?.hiv_dna_pcr_2_date | date: 'dd-MM-yyyy' }}
</div>
</li>
<li
*ngIf="hivSummary?.hiv_dna_pcr_3"
class="list-group-item"
style="font-size: large"
>
PCR 3
<div>Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_3_at }}M</div>
<div>PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_3 }}</div>
<div>
Date Done: {{ hivSummary?.hiv_dna_pcr_3_date | date: 'dd-MM-yyyy' }}
</div>
</li>
<li class="list-group-item" style="font-size: large">
Current ART Prophylaxis: {{ hivSummary?.cur_arv_meds }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -243,6 +251,7 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy {
this.infantFeedingMethod = this.getInfantFeedingMethod();
this.heiOutCome = this.getHEIOutcome();
this.pcpProphylaxis = this.getPCPprophylaxis();
this.getHEIPCRSnapshot();
}
}
this.getPatientEligibility(this.hivSummary);
Expand Down Expand Up @@ -469,4 +478,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
);
}
}

0 comments on commit 6dd2a93

Please sign in to comment.