Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poc 536: Display all the available PCR results on the HEI summary #1666

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
}
}