Skip to content

Commit

Permalink
Merge branch 'master' into POC-763
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Mutai authored Jul 21, 2024
2 parents 6f87566 + 67bfbc5 commit 931fde7
Show file tree
Hide file tree
Showing 14 changed files with 298 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ export class DailyScheduleAppointmentsComponent implements OnInit, OnDestroy {
width: 120,
field: 'arv_first_regimen_start_date'
},
{
headerName: 'Weight',
width: 200,
field: 'weight'
},
{
headerName: 'Height',
width: 200,
field: 'height'
},
{
headerName: 'WHO Stage',
width: 200,
field: 'stage'
},
{
headerName: 'Covid-19 Assessment Status',
width: 250,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ export class DailyScheduleNotReturnedComponent implements OnInit, OnDestroy {
width: 120,
field: 'arv_first_regimen_start_date'
},
{
headerName: 'Weight',
width: 200,
field: 'weight'
},
{
headerName: 'Height',
width: 200,
field: 'height'
},
{
headerName: 'WHO Stage',
width: 200,
field: 'stage'
},
{
headerName: 'Covid-19 Assessment Status',
width: 250,
Expand Down
10 changes: 7 additions & 3 deletions src/app/etl-api/family-testing-resource.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ export class FamilyTestingService {
);
}

public getPatientEncounters(patientUuid: string) {
const familyTestingEncounterTypeUuid =
'975ae894-7660-4224-b777-468c2e710a2a';
public getPatientEncounters(
patientUuid: string,
isFamilyTestingEncounter: boolean
) {
const familyTestingEncounterTypeUuid = isFamilyTestingEncounter
? '975ae894-7660-4224-b777-468c2e710a2a'
: '5a58f6f5-f5a6-47eb-a644-626abd83f83b';
return this.http.get(
`${this.amrsUrl()}encounter?patient=${patientUuid}&encounterType=${familyTestingEncounterTypeUuid}`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ <h4 class="text">Group Summary</h4>
</ng-container>
</td>
</tr>
<tr>
<tr *ngIf="validOTZProgram">
<td>
<strong>Group Activity: </strong>
<span *ngIf="landmark">{{ groupActivity?.value }}</span>
<span *ngIf="groupActivity">{{ groupActivity?.value }}</span>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ export class GroupDetailSummaryComponent implements OnInit, OnDestroy {
public showUpdateGroupModal(modal) {
let program = null;
let provider = null;
const context = this.validOTZProgram;
this.program
? (program = this.program)
: (program = { name: null, value: null });
Expand All @@ -571,7 +572,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,
groupActivity: context ? this.groupActivity.value : null,
groupUuid: this.group.uuid,
actionButtonText: 'Save Changes'
};
Expand Down
11 changes: 1 addition & 10 deletions src/app/group-manager/group-detail/group-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,7 @@ <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 && showOTZEnrollmentMsg"
>
<div class="alert alert-info" *ngIf="showEnrollmentButton">
<button
class="btn btn-xs btn-primary pull-right"
(click)="enrollPatienttoProgram()"
Expand All @@ -252,12 +249,6 @@ <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"
Expand Down
27 changes: 23 additions & 4 deletions src/app/group-manager/group-detail/group-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {
(group) => !group.voided
);
}
const targetProgramUuid = '203571d6-a4f2-4953-9e8b-e1105e2340f5';
const checkOTZProgram = programsEnrolled.some(
(program) => program.programUuid === targetProgramUuid
);
const validation = this.communityGroupMemberService.validateMemberEnrollment(
programsEnrolled,
currentGroupsEnrolled,
Expand All @@ -778,9 +782,17 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {
this.validatingEnrollment = false;
this.showEnrollmentAlert('Patient already enrolled in this group!');
break;
case !validation.notEnrolledInGroupProgram.found:
case !validation.notEnrolledInGroupProgram.found &&
checkOTZProgram &&
this.isOtzProgram:
this.validatingEnrollment = false;
this.validateAge(patient);
if (this.showOTZEnrollmentMsg) {
this.showEnrollButton(patient);
}
break;
case !validation.notEnrolledInGroupProgram.found:
this.validatingEnrollment = false;
this.showEnrollButton(patient);
break;
case validation.enrolledInAnotherGroupInSameProgram.found:
Expand Down Expand Up @@ -839,12 +851,16 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {
}

private validateAge(patient) {
if (patient._person.age > 9 && patient._person.age <= 24) {
const age = patient._person.age;

if (age > 9 && age <= 24) {
this.showOTZEnrollmentMsg = true;
} else {
this.showOTZEnrollmentMsg = false;
return;
}

this.showEnrollmentAlert('Patient is not eligible for OTZ enrollment!');
}

private enrollPatientToGroup(group: Group, patient: Patient) {
this.communityGroupMemberService
.createMember(group.uuid, patient.uuid)
Expand All @@ -859,6 +875,9 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {

private showEnrollmentAlert(msg: string) {
this.enrollmentErrorMessage = msg;
setTimeout(() => {
this.enrollmentErrorMessage = '';
}, 5000);
}

private transferPatientFromGroup(groupToEnroll, groupToUnenroll, patient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export class IptReportPatientListComponent implements OnInit {

public addExtraColumns() {
const extraColumns = {
weight: 'Weight',
height: 'Height',
stage: 'WHO Stage',
phone_number: 'Phone Number',
enrollment_date: 'Date Enrolled',
last_appointment: 'Latest Appointment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ export class Moh731PatientListComponent implements OnInit, OnChanges {

public addExtraColumns(indicators: Array<any>) {
const extraColumns = {
weight: 'Weight',
height: 'Height',
stage: 'WHO Stage',
location: 'Location',
enrollment_date: 'Enrollment Date',
arv_first_regimen_start_date: 'ARVs Initial Start Date',
Expand Down
49 changes: 49 additions & 0 deletions src/app/lab-order-search/lab-order-search-helper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class LabOrdersSearchHelperService {
conceptUuid: 'a898fe80-1350-11df-a1f1-0026b9348838',
display: 'DNA PCR'
},

{
type: 'VL',
conceptUuid: 'a8982474-1350-11df-a1f1-0026b9348838',
Expand All @@ -24,13 +25,26 @@ export class LabOrdersSearchHelperService {
conceptUuid: 'a896cce6-1350-11df-a1f1-0026b9348838',
display: 'CD4 Panel'
},
{
type: 'HPV',
conceptUuid: 'a8a46fd6-1350-11df-a1f1-0026b9348838',
display: 'HPV'
},
{
type: 'Other',
conceptUuid: '',
display: 'Others'
}
];
}
public get hpvTestSampleTypes() {
return [
{
id: 1,
display: 'Cervical Swab'
}
];
}

public get sampleTypes() {
return [
Expand Down Expand Up @@ -181,6 +195,41 @@ export class LabOrdersSearchHelperService {
};
}

public createHpvPayload(
order: any,
encounterObs: any,
encounterLocationUuid: any,
patientIdentifier: any,
patientName: any,
sex: any,
birthDate: any,
dateRecieved: any,
sampleType: any,
isPregnant = 0,
breastfeeding = 0
) {
const vlJustificationUuid: any = this.findObsValueByConceptUuid(
encounterObs,
'0a98f01f-57f1-44b7-aacf-e1121650a967'
);

return {
type: 'HPV',
locationUuid: encounterLocationUuid,
orderNumber: order.orderNumber,
providerIdentifier: order.orderer.identifier,
patientName: patientName,
patientIdentifier: patientIdentifier,
sex: sex,
birthDate: this.formatDate(birthDate),
sampleType: sampleType,
vlJustificationUuid: vlJustificationUuid,
isPregnant: isPregnant,
breastfeeding: breastfeeding,
dateDrawn: this.formatDate(order.dateActivated),
dateReceived: this.formatDate(dateRecieved)
};
}
public createViralLoadPayload(
order,
encounterObs,
Expand Down
48 changes: 48 additions & 0 deletions src/app/lab-order-search/lab-order-search-post.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ <h5>
</div>
<div class="clear"></div>
<!-- DNAPCR ends -->
<!-- HPV starts-->
<div class="panel-info" *ngIf="isHPVtest">
<h5>
<span>HPV Summary Info</span>
</h5>
<table class="table">
<tbody>
<tr class="after_table row_0">
<td>Entry Point:</td>
<td>{{ HPVData.entryPoint }}</td>
</tr>
<tr>
<td>HIV Status:</td>
<td>{{ HPVData.hivStatus }}</td>
</tr>
<tr>
<td>Type Of Screening:</td>
<td>{{ HPVData.typeOfScreening }}</td>
</tr>
<tr>
<td>Sample Collection Method:</td>
<td>{{ HPVData.sampleCollectionMethod }}</td>
</tr>
</tbody>
</table>
</div>
<div class="clear"></div>
<!-- HPV ends -->
<div *ngIf="!isBusy" class="container-fluid">
<div class="row">
<div>
Expand Down Expand Up @@ -214,6 +242,26 @@ <h5>
</div>
</div>
</div>
<div class="row" *ngIf="orderType.type === 'HPV'">
<div>
<div class="form-group">
<label for="hpvTestSampleType">Sample Type</label>
<select
class="form-control"
id="hpvTestSampleType"
[(ngModel)]="selectedSampleType"
>
<option [ngValue]=""></option>
<option
*ngFor="let sample of hpvTestSampleTypes"
[ngValue]="sample.id"
>
{{ sample.display }}
</option>
</select>
</div>
</div>
</div>
<div class="row">
<div>
<div class="form-group">
Expand Down
Loading

0 comments on commit 931fde7

Please sign in to comment.