Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hiqedme/ng2-amrs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqedme committed Jan 16, 2024
2 parents c674777 + 63d3f19 commit ed739e8
Show file tree
Hide file tree
Showing 43 changed files with 2,027 additions and 257 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-amrs",
"version": "2.17.3-prerelease",
"version": "2.18.1",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --port 3000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ <h4 for="week-selector">
</div>
</div>
</form>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-12 col-lg-12 col-xs-12 col-sm-12">
<span
>Key
<span class="label label-success" style="font-size: 12px; color: black"
>Successful contact attempts</span
>
<span
class="label"
style="background-color: pink; font-size: 12px; color: black"
>Unsuccessful contact attempts</span
>
<span
class="label"
style="background-color: yellow; font-size: 12px; color: black"
>Requested reschedule</span
>
</span>
</div>
</div>
</div>

<div *ngIf="errors" style="color: red !important">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,25 @@ export class PreAppointmentOutreachComponent implements OnInit {
private route: ActivatedRoute
) {
const today = new Date();
const currentWeek = this.getISOWeek(today);
const currentYear = today.getFullYear();
const startYear = 2023;
const numberOfWeeks = 52; // Set the maximum number of weeks to 52

for (let weekNumber = 1; weekNumber <= numberOfWeeks; weekNumber++) {
const weekString = `${currentYear}-W${weekNumber
.toString()
.padStart(2, '0')}`;
this.weeks.push({
label: `${currentYear}-W${weekNumber} - From ${this.getStartDate(
weekString
)} to ${this.getEndDate(weekString)}`,
value: weekString
});
for (let year = startYear; year <= currentYear; year++) {
const lastWeek = year === currentYear ? currentWeek : numberOfWeeks;
for (let weekNumber = 1; weekNumber <= lastWeek; weekNumber++) {
const weekString = `${year}-W${weekNumber.toString().padStart(2, '0')}`;
this.weeks.push({
label: `${year}-W${weekNumber} - From ${this.getStartDate(
weekString
)} to ${this.getEndDate(weekString)}`,
value: weekString
});
}
}
this.weeks.reverse();

const currentWeek = this.getISOWeek(today);
this.selectedWeek = `${currentYear}-W${currentWeek
.toString()
.padStart(2, '0')}`;
Expand Down Expand Up @@ -215,6 +218,11 @@ export class PreAppointmentOutreachComponent implements OnInit {
width: 100,
field: 'rescheduled_date'
},
{
headerName: 'No. of Failed Phone Attempts',
width: 100,
field: 'number_of_failed_phone_attempts'
},
{
headerName: 'Contact Reached',
width: 100,
Expand Down
67 changes: 67 additions & 0 deletions src/app/etl-api/cohort-otz-module-resource.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Injectable } from '@angular/core';
import { AppSettingsService } from '../app-settings/app-settings.service';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';

@Injectable()
export class CohortOtzModuleResourceService {
constructor(
private http: HttpClient,
private appSettingsService: AppSettingsService
) {}
public getUrl(): string {
return (
this.appSettingsService.getEtlRestbaseurl().trim() + 'cohort-modules'
);
}

public getSummaryUrl(): string {
return (
this.appSettingsService.getEtlRestbaseurl().trim() +
'hiv-latest-summaries'
);
}

public getCohortSuppressionsUrl(): string {
return (
this.appSettingsService.getEtlRestbaseurl().trim() +
'viral-load-suppression-rate'
);
}

public getCohortOtzModule(cohortUuid: string): Observable<any> {
return this.http.get(this.getUrl() + '/' + cohortUuid);
}
public getUrlRequestParams(patientUuids: string[]): HttpParams {
let urlParams: HttpParams = new HttpParams();

if (patientUuids && patientUuids.length > 0) {
urlParams = urlParams.set('uuid', patientUuids.join(','));
}
return urlParams;
}

public getUrlRequestParamsByLocationUuid(locationUuid: string): HttpParams {
let urlParams: HttpParams = new HttpParams();

if (locationUuid) {
urlParams = urlParams.set('uuid', locationUuid);
}
return urlParams;
}

public getPatientsLatestHivSummaries(payload: string[]) {
if (!payload || payload.length === 0) {
return null;
}
return this.http.get(this.getSummaryUrl(), {
params: this.getUrlRequestParams(payload)
});
}

public getCohortSuppressionStatus(locationUuid: string) {
return this.http.get(this.getCohortSuppressionsUrl(), {
params: this.getUrlRequestParamsByLocationUuid(locationUuid)
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h4 class="text">Group Summary</h4>
<strong>Leader: </strong>
<ng-container *ngIf="currentLeader">
<span *ngIf="currentLeader.person">
{{ currentLeader.person.display }} ({{ leadershipType }}),
{{ currentLeader.person.display }},
</span>
<span>since {{ currentLeader.startDate | date: 'medium' }}</span>
</ng-container>
Expand Down Expand Up @@ -108,6 +108,12 @@ <h4 class="text">Group Summary</h4>
</ng-container>
</td>
</tr>
<tr>
<td>
<strong>Group Activity: </strong>
<span *ngIf="landmark">{{ groupActivity?.value }}</span>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -195,10 +201,23 @@ <h4 class="modal-title pull-left">Edit Leadership</h4>
>
<div class="col-xs-10">
<mat-radio-group formControlName="leadershipType">
<mat-radio-button value="peer" color="primary"
<mat-radio-button
*ngIf="validOTZProgram"
value="peer"
[checked]="defaultLeadershipType == 'peer'"
color="primary"
>OTZ Champion</mat-radio-button
>
<mat-radio-button
*ngIf="!validOTZProgram"
value="peer"
color="primary"
>Peer Leadership</mat-radio-button
>
<mat-radio-button value="staff" color="primary"
<mat-radio-button
*ngIf="!validOTZProgram"
value="staff"
color="primary"
>Community Staff Leadership</mat-radio-button
>
</mat-radio-group>
Expand Down Expand Up @@ -349,12 +368,21 @@ <h4 class="modal-title pull-left">Add Leader</h4>
<div class="col-xs-10">
<mat-radio-group (change)="onDefaultLeadershipTypeChanged($event)">
<mat-radio-button
*ngIf="validOTZProgram"
value="peer"
[checked]="defaultLeadershipType == 'peer'"
color="primary"
>OTZ Champion</mat-radio-button
>
<mat-radio-button
*ngIf="!validOTZProgram"
value="peer"
[checked]="defaultLeadershipType == 'peer'"
color="primary"
>Peer Leadership</mat-radio-button
>
<mat-radio-button
*ngIf="!validOTZProgram"
value="staff"
[checked]="defaultLeadershipType !== 'peer'"
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
public group: Group;
public groupNumber: any;
public landmark: any;
public groupActivity: any;
public provider: any;
public program: any;
public currentLeader: any;
Expand All @@ -76,6 +77,7 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
public currentMonth = Moment().month() + 1;
public providerSuggest: Subject<any> = new Subject();
public editLeaderForm: FormGroup;
public validOTZProgram = false;
public endDate = {
date: {
month: this.currentMonth,
Expand Down Expand Up @@ -104,6 +106,10 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
'landmark',
this.group.attributes
);
this.groupActivity = this.communityGroupService.getGroupAttribute(
'groupActivity',
this.group.attributes
);
this.currentLeader = this.getCurrentLeader(
group.cohortLeaders,
group.cohortMembers
Expand Down Expand Up @@ -347,6 +353,10 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
'landmark',
this.group.attributes
);
this.groupActivity = this.communityGroupService.getGroupAttribute(
'groupActivity',
this.group.attributes
);
this.currentLeader = this.getCurrentLeader(
group.cohortLeaders,
group.cohortMembers
Expand Down Expand Up @@ -561,6 +571,7 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
groupProgram: { label: program['name'], value: program['uuid'] },
provider: { label: provider.person.display, value: provider.person.uuid },
address: this.landmark.value,
groupActivity: this.groupActivity.value,
groupUuid: this.group.uuid,
actionButtonText: 'Save Changes'
};
Expand Down Expand Up @@ -716,6 +727,9 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
const sub = this.programService.getProgramByUuid(program.value).subscribe(
(prog) => {
this.program = prog;
if (this.program.name === 'OTZ PROGRAM') {
this.validOTZProgram = true;
}
},
(error) => {
console.log(error);
Expand Down
18 changes: 16 additions & 2 deletions src/app/group-manager/group-detail/group-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ <h4 class="modal-title pull-left">Add Membership</h4>
<div class="alert alert-danger" *ngIf="enrollmentErrorMessage">
{{ enrollmentErrorMessage }}
</div>
<div class="alert alert-info" *ngIf="showEnrollmentButton">
<div
class="alert alert-info"
*ngIf="showEnrollmentButton && showOTZEnrollmentMsg"
>
<button
class="btn btn-xs btn-primary pull-right"
(click)="enrollPatienttoProgram()"
Expand All @@ -249,6 +252,13 @@ <h4 class="modal-title pull-left">Add Membership</h4>
</button>
The patient is not enrolled in this program.
</div>
<div
class="alert alert-info"
*ngIf="showEnrollmentButton && !showOTZEnrollmentMsg"
>
Patient is not eligible for OTZ enrollment
</div>

<busy
*ngIf="validatingEnrollment"
[message]="'Validating Enrollment...'"
Expand Down Expand Up @@ -366,7 +376,11 @@ <h4 class="modal-title pull-left">Start Group Meeting</h4>
>
<ng-container *ngFor="let item of visitTypes">
<option
*ngIf="item.display.toLowerCase().includes('community')"
*ngIf="
isOtzProgram
? item.display.toLowerCase().includes('otz')
: item.display.toLowerCase().includes('community')
"
[value]="item.uuid"
>
{{ item.display }}
Expand Down
Loading

0 comments on commit ed739e8

Please sign in to comment.