Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1970 task completion rate #2073

Open
wants to merge 5 commits into
base: issue#1970-wcaro-inapp-reporting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opensrp-chw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
dependencies {
classpath 'org.apache.commons:commons-lang3:3.10'
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.google.gms:google-services:4.3.4'
// classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
}
}
Expand Down Expand Up @@ -42,7 +42,7 @@ allprojects {
apply plugin: 'com.android.application'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply from: "jacoco.gradle"
apply plugin: 'kotlin-android'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
indicators:
- key: "supervisor_catchment_task_completion_rate"
- key: "chw_with_open_tasks"
description: "Task Completion Rate for Entire Catchment Area"
indicatorQuery: ""
indicatorQuery: "SELECT count(DISTINCT ef.provider_id ) FROM schedule_service sc
INNER JOIN ec_family_member efm ON sc.base_entity_id= efm.base_entity_id COLLATE NOCASE
INNER JOIN ec_family ef ON efm.relational_id= ef.base_entity_id COLLATE NOCASE
AND sc.completion_date is NULL"

- key: "chw_with_no_open_tasks"
description: "Task Completion Rate for Entire Catchment Area"
indicatorQuery: "SELECT (SELECT count(DISTINCT ef.provider_id) FROM ec_family ef)-
(SELECT count(DISTINCT ef.provider_id ) FROM schedule_service sc
INNER JOIN ec_family_member efm ON sc.base_entity_id= efm.base_entity_id COLLATE NOCASE
INNER JOIN ec_family ef ON efm.relational_id= ef.base_entity_id COLLATE NOCASE
AND sc.completion_date is NULL)"

- key: "supervisor_synced_count"
description: "Sync Completion Rate for Entire Catchment Area"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.smartregister.chw.reporting;

import static org.smartregister.chw.util.ReportingConstants.SupervisorIndicatorKeys.CHW_WITH_NO_OPEN_TASKS;
import static org.smartregister.chw.util.ReportingConstants.SupervisorIndicatorKeys.CHW_WITH_OPEN_TASKS;
import static org.smartregister.chw.util.ReportingConstants.SupervisorIndicatorKeys.COUNT_PROVIDER_SYNCED_COMPLETED;
import static org.smartregister.chw.util.ReportingConstants.SupervisorIndicatorKeys.COUNT_PROVIDER_SYNCED_PENDING;

Expand Down Expand Up @@ -81,9 +83,20 @@ public static void showIndicatorVisualisations(ViewGroup mainLayout, List<Map<St

public static void showSupervisorIndicatorVisualisations(ViewGroup mainLayout, List<Map<String, IndicatorTally>> indicatorTallies, Activity context) {
// Sync completion rate ror entire catchment area
PieChartSlice chartSlice1 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, COUNT_PROVIDER_SYNCED_COMPLETED, "Sync Completed", mainLayout.getContext().getResources().getColor(R.color.pie_chart_yes_green), indicatorTallies, COUNT_PROVIDER_SYNCED_COMPLETED);
//supervisior
/* // sync completeion rate entire area
PieChartSlice chartSlice1 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, COUNT_PROVIDER_SYNCED_COMPLETED, "Sync Completed1", mainLayout.getContext().getResources().getColor(R.color.pie_chart_yes_green), indicatorTallies, COUNT_PROVIDER_SYNCED_COMPLETED);
PieChartSlice chartSlice2 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, COUNT_PROVIDER_SYNCED_PENDING, "Sync Pending", mainLayout.getContext().getResources().getColor(R.color.pie_chart_no_red), indicatorTallies, COUNT_PROVIDER_SYNCED_PENDING);
appendView(mainLayout, new PieChartIndicatorView(mainLayout.getContext(), ReportingUtil.getPieChartDisplayModel(ReportingUtil.addPieChartSlices(chartSlice1, chartSlice2), R.string.catchment_sync_completion_rate_indicator, null, null)));
*/
// Sync completion rate ror entire catchment area
PieChartSlice chartSlice1 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, CHW_WITH_NO_OPEN_TASKS, "CHW with no open tasks", mainLayout.getContext().getResources().getColor(R.color.pie_chart_yes_green), indicatorTallies, CHW_WITH_NO_OPEN_TASKS);
PieChartSlice chartSlice2 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, CHW_WITH_OPEN_TASKS, "CHW with open tasks", mainLayout.getContext().getResources().getColor(R.color.pie_chart_no_red), indicatorTallies, CHW_WITH_OPEN_TASKS);
appendView(mainLayout, new PieChartIndicatorView(mainLayout.getContext(), ReportingUtil.getPieChartDisplayModel(ReportingUtil.addPieChartSlices(chartSlice1, chartSlice2), R.string.catchment_task_completion_rate_indicator, null, null)));

PieChartSlice chartSlice3 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, COUNT_PROVIDER_SYNCED_COMPLETED, "Sync Completed1", mainLayout.getContext().getResources().getColor(R.color.pie_chart_yes_green), indicatorTallies, CHW_WITH_OPEN_TASKS);
PieChartSlice chartSlice4 = ReportingUtil.getPieChartSlice(ReportContract.IndicatorView.CountType.LATEST_COUNT, COUNT_PROVIDER_SYNCED_PENDING, "Sync Pending", mainLayout.getContext().getResources().getColor(R.color.pie_chart_no_red), indicatorTallies, CHW_WITH_NO_OPEN_TASKS);
appendView(mainLayout, new PieChartIndicatorView(mainLayout.getContext(), ReportingUtil.getPieChartDisplayModel(ReportingUtil.addPieChartSlices(chartSlice3, chartSlice4), R.string.catchment_sync_completion_rate_indicator, null, null)));

// Households with open tasks
List<String> tableHeaderList = Arrays.asList("", "", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ interface AncIndicatorKeys {
}

interface SupervisorIndicatorKeys {
String CHW_WITH_OPEN_TASKS = "chw_with_open_tasks";
String CHW_WITH_NO_OPEN_TASKS = "chw_with_no_open_tasks";
String COUNT_PROVIDER_SYNCED_COMPLETED = "supervisor_synced_count";
String COUNT_PROVIDER_SYNCED_PENDING = "supervisor_unsynced_count";
String SUPERVISOR_HOUSEHOLDS_WITH_OPEN_TASKS = "supervisor_households_with_open_tasks_for_month";
Expand Down
1 change: 1 addition & 0 deletions opensrp-chw/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@

<!-- Supervisor indicator labels -->
<string name="catchment_sync_completion_rate_indicator">Sync Completion Rate for Entire Catchment Area</string>
<string name="catchment_task_completion_rate_indicator">Task Completion Rate for Entire Catchment Area</string>
<string name="households_with_open_tasks_indicator">Households with open tasks remaining for the month by CHW</string>
<string name="incomplete_tasks_indicator">Tasks remaining incomplete for the month by CHW</string>
<string name="last_sync_date_by_chw_indicator">Last sync by CHW</string>
Expand Down