Skip to content

Commit

Permalink
Merge branch 'POC-534' into POC-534
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqedme authored Mar 18, 2024
2 parents 79b33af + c8149f4 commit 4c43d7a
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 109 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ <h4 class="modal-title pull-left">Add Membership</h4>
>
Enroll
</button>
The patient is not enrolled in this program.
The patient is not enrolled in this Model.
</div>
<div
class="alert alert-info"
Expand Down
2 changes: 1 addition & 1 deletion src/app/patient-creation/patient-creation.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ <h3 style="color: #76b5c5">Current Residence</h3>
class="btn btn-primary"
(click)="loadProgramManager(createdPatient)"
>
Enroll into Program
Enroll into Model
</button>
<button
type="button"
Expand Down
42 changes: 32 additions & 10 deletions src/app/patient-dashboard/common/formentry/formentry.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ import { Covid19StatusSummary } from './../../../interfaces/covid-19-summary.int

// constants
import { FormUuids } from './../../../constants/forms.constants';

import { ComponentResolver } from 'ag-grid/dist/lib/components/framework/componentResolver';
import { Console } from 'console';

import { ProgramManagerService } from 'src/app/program-manager/program-manager.service';
import { ComponentResolver } from 'ag-grid/dist/lib/components/framework/componentResolver';
import { Console } from 'console';


interface RefProgram {
uuid: string;
name: string;
Expand Down Expand Up @@ -686,17 +691,10 @@ export class FormentryComponent implements OnInit, OnDestroy {
.subscribe(() => {});
}
}
public enrollPatientToNewModel(data: any): void {
let programToEnroll = '';
let modelSelected = [];
modelSelected = this.form.searchNodeByQuestionId('dsdModel');
if (modelSelected.length === 0) {
modelSelected = this.form.searchNodeByQuestionId('moreIntense'); // moreIntense
}

const modelUuid = modelSelected[0].initialValue.value.uuid;

switch (modelUuid) {
public assignPatientModel(modelassigned: any) {
let programToEnroll = '';
switch (modelassigned) {
case 'c8b9b024-1a3a-47a4-a2aa-fcaf3053ea27':
programToEnroll = '4545685e-65f6-48c4-a6b4-860cea88c4d4'; // AHD
break;
Expand All @@ -706,7 +704,31 @@ export class FormentryComponent implements OnInit, OnDestroy {
case 'fe239aa1-f5d4-4d15-83a1-ce417e9fb879':
programToEnroll = '30521f4d-0708-4644-9e88-a108a830a5fd'; // viremia
break;
case ' 08381666-5d30-40db-9a77-4413f4329800':
programToEnroll = '9d7422b1-af7b-4602-813e-953cfaf47e21'; // FFT
break;
}
return programToEnroll;
}
public enrollPatientToNewModel(data: any): void {
let programToEnroll = '';
let modelSelected = [];
console.log('');
modelSelected = this.form.searchNodeByQuestionId('dsdModel'); // adult initial form

if (modelSelected.length === 0) {
// adultreturn form
modelSelected =
this.form.searchNodeByQuestionId('moreIntense') || // moreIntense
this.form.searchNodeByQuestionId('communityModel') || // community
this.form.searchNodeByQuestionId('facilityModel'); // facility
}

const modelUuid = modelSelected[0].initialValue.value.uuid;

programToEnroll = this.assignPatientModel(modelUuid);


console.log('Response:', programToEnroll);
const enrollpayload = {
programUuid: programToEnroll,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[message]="'Loading patient care programs...'"
></busy>
<div class="programs" *ngIf="enrolledProgrames.length > 0 && !hasError">
<h4 class="component-title">Patient Care Program Snapshots</h4>
<h4 class="component-title">Patient Care Model Snapshots</h4>

<!--<div
style="margin: 4px 0px; padding: 4px"
Expand Down Expand Up @@ -116,9 +116,9 @@ <h2 class="program-header">
</div>
<div *ngIf="!programsBusy && enrolledProgrames.length === 0 && !hasError">
<p class="alert alert-info">
The patient is not enrolled in any program.
The patient is not enrolled in any Model.
<button class="btn btn-primary pull-right" (click)="loadProgramManager()">
Enroll into Program
Enroll into Model
</button>
</p>
</div>
Expand All @@ -130,11 +130,11 @@ <h2 class="program-header">
!hasError
"
>
<h4 class="component-title">Previous Enrolled Programs</h4>
<h4 class="component-title">Previous Enrolled Models</h4>
<table class="table table-stripped">
<thead>
<tr>
<th>Program Name</th>
<th>Model Name</th>
<th>Location</th>
<th>Started</th>
<th>Stopped</th>
Expand Down
14 changes: 7 additions & 7 deletions src/app/program-manager/new-program/new-program.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2><i class="fa fa-arrow-right"></i> Select Department</h2>
class="btn btn-primary pull-right"
(click)="goToProgram()"
>
Continue To Program
Continue To Model
</button>
<span class="clear">&nbsp;</span>
</div>
Expand Down Expand Up @@ -114,7 +114,7 @@ <h2><i class="fa fa-arrow-right"></i>Check Patient Status</h2>
<div class="wizard-body component">
<div class="step" *ngIf="availableDepartmentPrograms">
<div class="step-name">
<h2><i class="fa fa-arrow-right"></i> Select Program</h2>
<h2><i class="fa fa-arrow-right"></i> Select Model</h2>
</div>
<div class="step-details">
<mat-radio-group
Expand Down Expand Up @@ -300,7 +300,7 @@ <h2><i class="fa fa-arrow-right"></i> Enroll to Group</h2>
</div>
</div>
</program-wizard-step>
<program-wizard-step [name]="'Program Enrollment Success'">
<program-wizard-step [name]="'Model Enrollment Success'">
<div class="wizard-body component">
<div class="step">
<div
Expand Down Expand Up @@ -374,7 +374,7 @@ <h2><i class="fa fa-arrow-right"></i> Enroll to Group</h2>
<ng-container
*ngIf="unenrolledProgrames && unenrolledProgrames.length > 0"
>
<h2 class="component-title">Programs Sucessfully Stopped</h2>
<h2 class="component-title">Model Sucessfully Stopped</h2>
<div
class="alert alert-danger"
*ngFor="let program of unenrolledProgrames"
Expand All @@ -400,7 +400,7 @@ <h2 class="component-title">Programs Sucessfully Stopped</h2>
class="btn btn-danger pull-left"
(click)="editProgram(newlyEnrolledProgram)"
>
Edit Program
Edit Model
</button>
<button
class="btn btn-primary pull-right"
Expand All @@ -413,7 +413,7 @@ <h2 class="component-title">Programs Sucessfully Stopped</h2>
class="btn btn-primary pull-right"
(click)="goToProgramSummary()"
>
<span>GO TO PROGRAM SUMMARY</span>
<span>GO TO MODEL SUMMARY</span>
</button>
<span class="clear">&nbsp;</span>
</div>
Expand All @@ -423,7 +423,7 @@ <h2 class="component-title">Programs Sucessfully Stopped</h2>
</program-wizard>
<busy *ngIf="!loaded" [message]="'Loading...'"></busy>
<p class="alert alert-danger" *ngIf="hasError">
Error loading patient program config. Please make sure that your network is
Error loading patient model config. Please make sure that your network is
working fine.
</p>
<ng-template #dcGroupAutoUnEnrollmentWarning>
Expand Down
11 changes: 11 additions & 0 deletions src/app/program-manager/new-program/new-program.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ export class NewProgramComponent
this.selectedProgram = _.find(this.availablePrograms, (_program: any) => {
return _program.programUuid === this.program;
});

this.programVisitConfig = this.allPatientProgramVisitConfigs[this.program];
this.addToStepInfo({
selectedProgram: this.selectedProgram,
programVisitConfig: this.programVisitConfig
});
// this.checkForRequiredQuestions();
this.checkIfEnrollmentIsAllowed();
this.goToDetails();

if (
this.selectedProgram.concept.uuid ===
'fd90d6b2-7302-4a9c-ad1b-1f93eff77afb'
Expand All @@ -166,6 +176,7 @@ export class NewProgramComponent
this.checkIfEnrollmentIsAllowed();
this.goToDetails();
}

}

public goToProgram() {
Expand Down
84 changes: 0 additions & 84 deletions src/app/program-visit-encounter-search/program-visits-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,37 +214,6 @@
"display": "ADULTRANSFERIN"
}
]
},
{
"uuid": "d4ac2aa5-2899-42fb-b08a-d40161815b48",
"name": "Adult HIV Return Visit ",
"allowedIf": "age >= 20 && programLocation === intendedVisitLocationUuid && !isFirstAMPATHHIVVisit",
"encounterTypes": [
{
"uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7",
"display": "HIVTRIAGE"
},
{
"uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33",
"display": "TRANSFERENCOUNTER"
},
{
"uuid": "7bf4632a-00e8-4c0a-a296-c3977fdd6671",
"display": "PMTCTENCOUNTER"
},
{
"uuid": "5e019c94-0f80-49b7-8593-28100eb4f787",
"display": "HEIFOLLOWUP"
},
{
"uuid": "b1e9ed0f-5222-4d47-98f7-5678b8a21ebd",
"display": "PMTCTPOSTNATAL "
},
{
"uuid": "df553c4a-1350-11df-a1f1-0026b9348838",
"display": "PMTCTANC"
}
]
}
]
},
Expand Down Expand Up @@ -283,59 +252,6 @@
"hivLastTenClinicalEncounters"
],
"visitTypes": [
{
"uuid": "58f20c53-aac7-4e73-bd7a-97986435e570",
"name": "PEP Visit ",
"uuid": "8d5b2be0-c2cc-11de-8d13-0010c6dffd0f",
"display": "ADULTRETURN"
}
]
},
{
"uuid": "18faa058-4eea-4339-a959-84b3e5cb30be",
"name": "Pediatric HIV Initial Visit ",
"allowedIf": "age <= 14 && programLocation === intendedVisitLocationUuid && isFirstAMPATHHIVVisit",
"encounterTypes": [
{
"uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7",
"display": "HIVTRIAGE"
},
{
"uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33",
"display": "TRANSFERENCOUNTER"
}
]
},
{
"uuid": "2e67b87c-8843-45b7-a380-3a0e8bd58e4d",
"name": "Pediatric Transfer In Visit ",
"allowedIf": "age <= 14 && programLocation === intendedVisitLocationUuid && !isFirstAMPATHHIVVisit && previousHIVClinicallocation !== programLocation",
"encounterTypes": [
{
"uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7",
"display": "HIVTRIAGE"
},
{
"uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33",
"display": "TRANSFERENCOUNTER"
}
]
},
{
"uuid": "edb7c6aa-fc69-4470-936d-3d484d3708aa",
"name": "Pediatric HIV Return Visit ",
"allowedIf": "age <= 14 && programLocation === intendedVisitLocationUuid && !isFirstAMPATHHIVVisit",
"encounterTypes": [
{
"uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7",
"display": "HIVTRIAGE"
},
{
"uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33",
"display": "TRANSFERENCOUNTER"
}
]
},
{
"uuid": "dcdefd27-82b9-48e3-821b-3ffc6463564e",
"name": "Resistance Clinic Visit ",
Expand Down

0 comments on commit 4c43d7a

Please sign in to comment.