Skip to content

Commit

Permalink
Corrections: added verification (#1767)
Browse files Browse the repository at this point in the history
* Corrections: added verification

* Corrections: added verification
  • Loading branch information
hiqedme authored Jul 24, 2024
1 parent fb04f7b commit eeed8d4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 37 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 @@ -301,31 +306,36 @@
</span>
<span
*ngIf="
searchIdentifiers && enrolled && isPatientEnrolledToHIVProgram
searchIdentifiers && !enrolled && isPatientEnrolledToHIVProgram
"
>
<span *ngIf="isPatientVerified && searchIdentifiers?.upi">
<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 eeed8d4

Please sign in to comment.