Skip to content

Commit

Permalink
Merge branch 'master' into v2.18.3-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Mutai authored Jul 31, 2024
2 parents c225365 + eeed8d4 commit b1d0dff
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,29 @@
<span class="id-label">UPI:</span>
<span>{{ searchIdentifiers?.upi }}</span>
</span>
<span
*ngIf="!isPatientVerified"
(click)="
identifiers.showDialog('verify', patient?._identifier, true)
"
style="
color: darkorange;
border: 1px solid darkorange;
padding-left: 4px;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 0px;
cursor: pointer;
"
>
<span class="glyphicon glyphicon-info-sign"></span>
<span style="margin-left: -5px">Verify Patient</span>
</span>
</span>
<span
*ngIf="
!isPatientVerified &&
isVerifiable &&
searchIdentifiers &&
isPatientEnrolledToHIVProgram
"
(click)="
identifiers.showDialog('verify', patient?._identifier, true)
"
style="
color: darkorange;
border: 1px solid darkorange;
padding-left: 4px;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 0px;
cursor: pointer;
"
>
<span class="glyphicon glyphicon-info-sign"></span>
<span style="margin-left: -5px">Verify Patient</span>
</span>
<span *ngIf="searchIdentifiers && enrolledToHEIProgram">
<span
Expand Down Expand Up @@ -308,24 +313,29 @@
<span class="id-label">UPI:</span>
<span>{{ searchIdentifiers?.upi }}</span>
</span>
<span
*ngIf="!isPatientVerified"
(click)="
identifiers.showDialog('verify', patient?._identifier, true)
"
style="
color: darkorange;
border: 1px solid darkorange;
padding-left: 4px;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 0px;
cursor: pointer;
"
>
<span class="glyphicon glyphicon-info-sign"></span>
<span style="margin-left: -5px">Verify Patient</span>
</span>
</span>
<span
*ngIf="
!isPatientVerified &&
isVerifiable &&
searchIdentifiers &&
isPatientEnrolledToHIVProgram
"
(click)="
identifiers.showDialog('verify', patient?._identifier, true)
"
style="
color: darkorange;
border: 1px solid darkorange;
padding-left: 4px;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 0px;
cursor: pointer;
"
>
<span class="glyphicon glyphicon-info-sign"></span>
<span style="margin-left: -5px">Verify Patient</span>
</span>
<span *ngIf="searchIdentifiers && enrolledToHEIProgram">
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class PatientBannerComponent implements OnInit, OnDestroy, OnChanges {
ignoreBackdropClick: true
};
private enrolled: boolean;
private isVerifiable: boolean;
private enrolledToHEIProgram: boolean;
private isPatientEnrolledToHIVProgram: boolean;
private currentLocation: { uuid: string; display: string };
Expand Down Expand Up @@ -117,6 +118,9 @@ export class PatientBannerComponent implements OnInit, OnDestroy, OnChanges {
this.isPatientEligableForCCCNumber(
_.filter(patient.enrolledPrograms, 'isEnrolled')
);
this.isPatientVerifiable(
_.filter(patient.enrolledPrograms, 'isEnrolled')
);
this.isEnrolledToHEIProgram(
_.filter(patient.enrolledPrograms, 'isEnrolled')
);
Expand Down Expand Up @@ -308,6 +312,14 @@ export class PatientBannerComponent implements OnInit, OnDestroy, OnChanges {
program.concept.uuid === '9c64af03-f712-411e-8880-16e98dcdb4a6'
);
}
private isPatientVerifiable(enrolledPrograms: Array<any>) {
_.filter(
enrolledPrograms,
({ concept }) => concept.uuid === '23e234c3-5d8a-46ca-8465-3b746143dd68'
).length > 0
? (this.isVerifiable = false)
: (this.isVerifiable = true);
}

private getHIVPatient(enrolledPrograms: Array<any>) {
_.filter(enrolledPrograms, ({ baseRoute }) => baseRoute === 'hiv').length >
Expand Down

0 comments on commit b1d0dff

Please sign in to comment.