NDSS has two sides to it. One is the process in which the data is pooled to the ElasticSearch and the other is the way it is fetched, aggregated, computed, transformed and sent across.
As this revolves around a variety of data sets, there is a need for making this configurable. This ensures that the process can be configured easily in case a new scenario is introduced. This document walks us through the steps on how to define the configurations for DSS analytics for the PGR module.
Below is a list of configurations that need to be changed to run PGR successfully.
The Chart API configuration document enables users to configure each visualisation and its properties. The visualization code is the key that has its properties configured as a part of the configuration and are easily changeable.
Copy "_comment": "National PGR charts below-----------------------------------------------------------------------",
"nationalPgrTotalComplaints": {
"chartName": "NATIONAL_DSS_TOTAL_COMPLAINTS",
"queries": [
{
"module": "PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Todays Complaints\":{\"sum\":{\"field\":\"todaysComplaintsForCategory\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"Todays Complaints"
],
"insight": {
"chartResponseMap" : "nationalPgrTotalComplaints",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"isRoundOff":true,
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year"
},
"_comment": " "
},
"pgrClosedComplaints": {
"chartName": "NATIONAL_DSS_CLOSED_COMPLAINTS",
"queries": [
{
"module": "PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"ulb.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed_Complaints\":{\"sum\":{\"field\":\"todaysClosedComplaintsForDepartment\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"Closed_Complaints"
],
"insight": {
"chartResponseMap" : "pgrClosedComplaints",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": " "
},
"nationalPgrSlaAchieved": {
"chartName": "NATIONAL_DSS_SLA_ACHIEVED",
"queries": [
{
"module": "PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"ulb.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"State\":{\"terms\":{\"field\":\"module.keyword\"},\"aggs\":{\"Test\":{\"terms\":{\"field\":\"module.keyword\"},\"aggs\":{\"Resolved_Complaints\":{\"sum\":{\"field\":\"todaysResolvedComplaintsForDepartment\"}},\"Total_Complaints\":{\"sum\":{\"field\":\"todaysComplaintsForCategory\"}}}},\"Resolved Complaints\":{\"sum_bucket\":{\"buckets_path\":\"Test.Resolved_Complaints\"}},\"Total Complaints\":{\"sum_bucket\":{\"buckets_path\":\"Test.Total_Complaints\"}},\"slaAchived\":{\"bucket_script\":{\"buckets_path\":{\"att\":\"Total Complaints\",\"com\":\"Resolved Complaints\"},\"script\":\"params.com \/ params.att * 100\"}}}}}}}}"
}
],
"chartType": "metric",
"valueType": "percentage",
"drillChart": "none",
"documentType": "_doc",
"action": "percentage",
"isRoundOff":true,
"aggregationPaths": [
"slaAchived"
],
"insight": {
"chartResponseMap" : "nationalPgrSlaAchieved",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": " SLA Achieved Percentage "
},
"pgrCompletionRate": {
"chartName": "NATIONAL_DSS_PGR_COMPLETION_RATE",
"queries": [
{
"module":"PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"ulb.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"State\":{\"terms\":{\"field\":\"module.keyword\"},\"aggs\":{\"Test\":{\"terms\":{\"field\":\"module.keyword\"},\"aggs\":{\"Closed_Complaints\":{\"sum\":{\"field\":\"todaysClosedComplaintsForDepartment\"}},\"Total_Complaints\":{\"sum\":{\"field\":\"todaysComplaintsForCategory\"}}}},\"Closed Complaints\":{\"sum_bucket\":{\"buckets_path\":\"Test.Closed_Complaints\"}},\"Total Complaints\":{\"sum_bucket\":{\"buckets_path\":\"Test.Total_Complaints\"}},\"Completion Rate\":{\"bucket_script\":{\"buckets_path\":{\"att\":\"Total Complaints\",\"com\":\"Closed Complaints\"},\"script\":\"params.com \/ params.att * 100\"}}}}}}}}"
}
],
"chartType": "metric",
"valueType": "percentage",
"drillChart": "none",
"documentType": "_doc",
"action": "percentage",
"isRoundOff":true,
"aggregationPaths": [
"Completion Rate"
],
"insight": {
"chartResponseMap" : "pgrCompletionRate",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "Completion rate"
},
"pgrCumulativeClosedComplaints": {
"chartName": "NATIONAL_DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS",
"queries": [
{
"module": "PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Complaints\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"month\"},\"aggs\":{\"Closed_Complaints\":{\"sum\":{\"field\":\"todaysClosedComplaintsForDepartment\"}}}},\"Reopened Complaints\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"month\"},\"aggs\":{\"Reopened\":{\"sum\":{\"field\":\"todaysReopenedComplaintsForDepartment\"}}}},\"Total Complaints\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"month\"},\"aggs\":{\"total\":{\"sum\":{\"field\":\"todaysComplaintsForCategory\"}}}}}}}}"
}
],
"chartType": "line",
"valueType": "number",
"action": "",
"drillChart": "none",
"documentType": "_doc",
"aggregationPaths": [
"Closed Complaints",
"Reopened Complaints",
"Total Complaints"
],
"isCumulative": true,
"interval": "month",
"insight": {
},
"_comment": "National PGR Cumulatiove closed complaints by month area chart"
},
"pgrTotalComplaintsbyStatus": {
"chartName": "NATIONAL_DSS_PGR_TOTAL_COMPLAINTS_BY_STATUS",
"queries": [
{
"module": "PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Resolved\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"resolve\":{\"filter\":{\"terms\":{\"status.keyword\":[\"resolved\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}},\"Closed\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"close\":{\"filter\":{\"terms\":{\"status.keyword\":[\"closed\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}},\"Open\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"opened\":{\"filter\":{\"terms\":{\"status.keyword\":[\"open\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}},\"Assigned\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"assign\":{\"filter\":{\"terms\":{\"status.keyword\":[\"assigned\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}},\"Rejected\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"reject\":{\"filter\":{\"terms\":{\"status.keyword\":[\"rejected\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}},\"Reassign_Requested\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"reassign_request\":{\"filter\":{\"terms\":{\"status.keyword\":[\"reassignrequested\"]}},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}}}}}}"
}
],
"chartType": "line",
"valueType": "number",
"action": "",
"drillChart": "none",
"documentType": "_doc",
"aggregationPaths": [
"Resolved",
"Closed",
"Open",
"Assigned",
"Rejected",
"Reassign_Requested"
],
"isCumulative": false,
"interval": "month",
"insight": {
},
"_comment": " "
},
"pgrComplaintsByStatusPieChart": {
"chartName": "NATIONAL_DSS_PGR_COMPLAINTS_BY_STATUS_PIE_CHART",
"queries": [
{
"module":"PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Status\":{\"terms\":{\"field\":\"status.keyword\"},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForStatus\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Complaints By Status"
],
"insight": {
},
"_comment": "PGR Complaints by status"
},
"pgrComplaintsByDepartment": {
"chartName": "NATIONAL_DSS_PGR_COMPLAINTS_BY_DEPARTMENT",
"queries": [
{
"module":"PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Department\":{\"terms\":{\"field\":\"department.keyword\"},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForDepartment\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Complaints By Department"
],
"insight": {
},
"_comment": "PGR Complaints by Department"
},
"pgrComplaintsByChannel": {
"chartName": "DSS_PGR_COMPLAINTS_BY_CHANNELS",
"queries": [
{
"module":"PGR",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pgr-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Channels\":{\"terms\":{\"field\":\"channel.keyword\"},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"todaysComplaintsForChannel\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Complaints By Channels"
],
"insight": {
},
"_comment": "PGR Channels For Complaints"
},
"pgrAverageSolutionTime": {
"chartName": "NATIONAL_DSS_PGR_EVENT_DASHBOARD",
"queries": [
{
"module":"PGR",
"dateRefField": "date",