Skip to content

Commit

Permalink
DQA report improvements & enhancements (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett authored Mar 24, 2023
1 parent c01e65a commit f0cb0cf
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 71 deletions.
13 changes: 0 additions & 13 deletions src/app/clinic-dashboard/hiv/hiv-program.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,6 @@ const routes: Routes = [
path: 'surge-reports',
component: SurgeReportComponent
},
{
path: 'dqa-reports',
children: [
{
path: 'dqa-report-patientlist',
component: ChartAbstractionPatientlistComponent
},
{
path: '',
component: DqaReportsComponent
}
]
},
{
path: 'surge-reports/surge-report-patientlist',
component: SurgeReportPatientListComponent
Expand Down
11 changes: 10 additions & 1 deletion src/app/etl-api/dqa-chart-abstraction.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ export class DqaChartAbstractionService {
}

public getDqaChartAbstractionReport(params: any): Observable<any> {
let extraParams = '';
if (params.startDate && params.endDate) {
extraParams +=
'&startDate=' + params.startDate + '&endDate=' + params.endDate;
}
if (params.patientType) {
extraParams += '&patientType=' + params.patientType;
}
const sampleUrl =
this.url +
'dqa-chart-abstraction?locationUuids=' +
params.locations +
'&limit=' +
params.limit +
'&offset=' +
params.offset;
params.offset +
extraParams;

return this.http.get(sampleUrl, {}).pipe(
map((response: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,6 @@ <h3>DQA patient list</h3>

<p></p>
</div>

<div style="display: inline-block" *ngIf="hasLoadedAll">
<button
style="width: 80px"
[ladda]="isLoading"
data-size="xs"
data-color="blue"
(click)="loadMoreDQAList('next')"
>
<span class=""></span>Next
</button>

<button
style="margin-left: 20px; width: 80px"
[ladda]="isLoading"
data-size="xs"
data-color="grey"
(click)="loadMoreDQAList('all')"
>
<span class=""></span>Load all
</button>
</div>
<div *ngIf="hasError">
<p class="alert-error alert">Error loading patient list.</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ export class ChartAbstractionPatientlistComponent implements OnInit {

ngOnInit() {
let requestParams: any;
this.addExtraColumns();

this.route.queryParams.subscribe(
(params) => {
if (params) {
this.patientData = [];
this.isLoading = true;
this.params = params;
this.addExtraColumns(this.params.patientType);
requestParams = {
locations: this.params.locationUuids,
limit: 300,
startDate: this.params.startDate,
endDate: this.params.endDate,
patientType: this.params.patientType,
limit: this.params.limit ? this.params.limit : 10,
offset: 0
};

this.getPatientList(requestParams);
}
},
Expand All @@ -60,19 +65,37 @@ export class ChartAbstractionPatientlistComponent implements OnInit {
}
});
}
public addExtraColumns() {
public addExtraColumns(patientType) {
let hide = true;
if (patientType === 'PMTCT') {
hide = false;
}
const extraColumns = {
person_id: 'Unique Patient ID',
person_id: 'CCC Number',
NUPI: 'NUPI',
birthdate: 'DOB',
last_appointment_date: 'Date Of Last Appointment',
next_appointment: 'Date Of Next Appointment ',
drugs_given: 'Drugs Given',
sex_gender: 'Gender',
drugs_given: 'Current Regimen',
drugs_duration: 'Drug dosage given (duration)',
weight: 'Weight',
height: 'Height',
muac: 'MUAC',
BMI: 'BMI',
condom_provided_this_visit: 'Condom Issued',
tb_screened_this_visit: 'TB screening',
last_ipt_start_date: 'IPT initiated'
nutrition: 'Nutrition Assessment Done',
DSD: 'DSD Model',
hiv_start_date: 'Date Confirmed HIV Positive',
arv_start_date: 'Date of ART Initiation',
cd4_1: 'Baseline CD4 Test Result',
vl_1: 'Latest Valid VL',
tpt_status: 'TPT Status',
last_ipt_start_date: 'TPT initiated',
ipt_stop_date: 'TPT Stop Date',
ipt_completion_date: 'TPT Completion Date',
last_clinical_encounter: 'Last Clinical Encounter',
last_appointment_date: 'Date of Last Appointment',
next_appointment: 'Date of Next Appointment ',
visit_type: 'Visit Type',
tb_screened_this_visit: 'TB screening'
};
for (const indicator in extraColumns) {
if (indicator) {
Expand All @@ -89,26 +112,51 @@ export class ChartAbstractionPatientlistComponent implements OnInit {
if (column.value != null) {
return moment(column.value).format('YYYY-MM-DD');
}
}
},
pinned: false
},
{
field: 'last_appointment_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('YYYY-MM-DD');
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'arv_start_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'hiv_start_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'last_clinical_encounter',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'next_appointment',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('YYYY-MM-DD');
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'condom_provided_this_visit',
field: 'tb_screened_this_visit',
width: 150,
cellRenderer: (column) => {
if (column.value === 0) {
Expand All @@ -118,42 +166,137 @@ export class ChartAbstractionPatientlistComponent implements OnInit {
}
},
{
field: 'tb_screened_this_visit',
width: 150,
field: 'vl_1',
cellRenderer: (column) => {
if (column.value === 0) {
return 'NO';
return 'LDL';
}
return 'YES';
return column.value;
}
},
{
field: 'nutrition',
width: 150,
cellRenderer: (column) => {
if (column.value === 'YES') {
return 'YES';
}
return 'NO';
}
},
{
field: 'last_ipt_start_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('YYYY-MM-DD');
return moment(column.value).format('DD-MM-YYYY');
}
},
hide: true
},
{
field: 'ipt_completion_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
},
hide: true
},
{
field: 'ipt_stop_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
},
hide: true
},
{
field: 'arv_start_date',
cellRenderer: (column) => {
if (column.value != null) {
return moment(column.value).format('DD-MM-YYYY');
}
}
},
{
field: 'drugs_given',
width: 280
},
{
field: 'height',
width: 100
},
{
field: 'weight',
width: 150
width: 100
},
{
field: 'Height',
width: 150
field: 'muac',
width: 100
},
{
field: 'BMI',
field: 'visit_type',
width: 150
},
{
field: 'muac',
width: 100
},
{
field: 'person_id',
width: 200
width: 200,
pinned: true
},
{
field: 'NUPI',
width: 150,
pinned: true
},
{
field: 'drugs_given',
width: 280
},
{
field: 'vl_1',
width: 150
},
{
field: 'drugs_duration',
width: 150
},
{
field: 'person_name',
width: 150,
hide: true
},
{
field: 'gender',
width: 150,
hide: true
},
{
field: 'identifiers',
width: 150,
hide: true
},
{
field: 'age',
width: 150
},
{
field: 'sex_gender',
width: 150
},
{
field: '#',
width: 150,
hide: true
},
{
field: 'visit_type',
width: 150,
hide: true
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ <h4 class="component-title text-success">

<report-filters
[enabledControls]="enabledControls"
[(startDate)]="startDate"
[(endDate)]="endDate"
(patientTypeChange)="patientTypeChange($event)"
(sampleSizeChange)="sampleSizeChange($event)"
(generateReport)="generateReport()"
>
</report-filters>
Expand Down
Loading

0 comments on commit f0cb0cf

Please sign in to comment.