Skip to content

Commit

Permalink
POC-536: Display all the available PCR results on the HEI summary
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykorir committed Sep 13, 2023
1 parent ae733c4 commit 993702c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,29 @@
Current weight (kg):
{{ hivSummary?.weight !== null ? hivSummary?.weight : 'NONE' }}
</li>
<li class="list-group-item" style="font-size: large">
<!-- <li class="list-group-item" style="font-size: large">
Last PCR status: {{ lastPCRStatus }}
</li>
<li class="list-group-item" style="font-size: large">
Last PCR Date: {{ lastPCRDate | date: 'dd-MM-yyyy' }}
</li> -->
<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 *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 @@ -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);
Expand Down Expand Up @@ -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
);
}
}

0 comments on commit 993702c

Please sign in to comment.