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 OBPS module.
Analytics: Microservice responsible for building, fetching, aggregating and computing the data on ElasticSearch into a consumable data response. This is used for visualizations and graphical representations.
Analytics Configurations: Analytics contains multiple configurations. Add the changes related to OBPS in this dashboard-analytics. Configuration file path: configs/egov-dss-dashboards/dashboard-analytics at qa · egovernments/configs Below is a list of configurations that need to be changed to run OBPS successfully.
Chart API Configuration
Master Dashboard Configuration
Role Dashboard Mappings Configuration
Chart API Configuration: Each visualization has its own properties. The visualization data is fetched from different sources. In some cases, it is a combination of different data sources.
The Chart API configuration document is used to configure each visualization and its properties.
The visualization code is the key whose properties are configured here. These properties are easily changeable.
Below is the sample ChartApiConfiguration.json data for the OBPS.
"nssOBPSTodaysCollection": {
"chartName": "NSS_OBPS_TODAYS_COLLECTION",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"range\":{\"date\":{\"gt\":\"now-1d\/d\",\"lte\":\"now\"}}}]}},\"aggs\":{\"todaysDate\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"Todays Collection\":{\"sum\":{\"field\":\"todaysCollectionForPaymentMode\"}}}},\"lastUpdatedTime\":{\"terms\":{\"field\":\"lastModifiedTime\",\"order\":{\"_term\":\"desc\"},\"size\":1}}}}}}"
}
],
"chartType": "metric",
"valueType": "amount",
"action": "",
"drillChart": "none",
"TodaysCollection":true,
"aggregationPaths": [
"Todays Collection"
],
"insight": {
},
"_comment": "DSS OBPS todays collections "
},
"nssOBPSTotalCollection": {
"chartName": "NSS_OBPS_TOTAL_COLLECTION",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"todaysCollectionForPaymentMode\"}}}}"
}
],
"chartType": "metric",
"valueType": "amount",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total Collection"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalCollection",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total Collection"
},
"nssOBPSTotalApplicationsSubmmited": {
"chartName": "NSS_OBPS_TOTAL_APPLICATIONS_SUBMITTED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{ \"aggs\": { \"intermediateAggr\": { \"terms\": { \"field\": \"date\" }, \"aggs\":{ \"applicationsSubmitted\":{ \"avg\":{ \"field\":\"applicationsSubmitted\" } } } }, \"Total Applications Submitted\": { \"sum_bucket\": { \"buckets_path\": \"intermediateAggr.applicationsSubmitted\" } } } }" }
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total Applications Submitted"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalApplicationsSubmmited",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total Applications Submitted"
},
"nssOBPSTotalPermitsIssued": {
"chartName": "NSS_OBPS_TOTAL_PERMITS_ISSUED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{ \"aggs\": { \"AGGR\": { \"filter\": { \"bool\": { \"must\": [ { \"terms\": { \"riskType.keyword\": [ \"LOW\", \"MEDIUM\",\"HIGH\" ] } } ] } }, \"aggs\": { \"Total Permits Issued\": { \"sum\": { \"field\": \"permitsIssuedForRiskType\" } } } } } }"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total Permits Issued"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalPermitsIssued",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total Permits Issued"
},
"nssOBPSTotalPlansScrutinized": {
"chartName": "NSS_OBPS_TOTAL_PLANS_SCRUTINIZED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"intermediateAggr\":{\"terms\":{\"field\":\"date\"},\"aggs\":{\"plansScrutinized\":{\"avg\":{\"field\":\"plansScrutinized\"}}}},\"Total Plans Scrutinized\":{\"sum_bucket\":{\"buckets_path\":\"intermediateAggr.plansScrutinized\"}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total Plans Scrutinized"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalPlansScrutinized",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total Plans Scrutinized "
},
"nssOBPSTotalOCIssued": {
"chartName": "NSS_OBPS_TOTAL_OC_ISSUED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{ \"aggs\": { \"intermediateAggr\": { \"terms\": { \"field\": \"date\" }, \"aggs\":{ \"ocIssued\":{ \"avg\":{ \"field\":\"ocIssued\" } } } }, \"Total OC Issued\": { \"sum_bucket\": { \"buckets_path\": \"intermediateAggr.ocIssued\" } } } }" }
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total OC Issued"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalOCIssued",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total OC Issued"
},
"nssOBPSTotalOCPlansScrutinized": {
"chartName": "NSS_OBPS_TOTAL_OC_PLANS_SCRUTINIZED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"intermediateAggr\":{\"terms\":{\"field\":\"date\"},\"aggs\":{\"ocPlansScrutinized\":{\"avg\":{\"field\":\"ocPlansScrutinized\"}}}},\"Total OC plans scrutinized\":{\"sum_bucket\":{\"buckets_path\":\"intermediateAggr.ocPlansScrutinized\"}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total OC plans scrutinized"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalOCPlansScrutinized",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Total OC plans scrutinized"
},
"nssOBPSAverageDaysIssuePermit": {
"chartName": "NSS_OBPS_AVERAGE_DAYS_TO_ISSUE_PERMIT",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"intermediateAggr\":{\"terms\":{\"field\":\"date\"},\"aggs\":{\"averageDaysToIssuePermit\":{\"avg\":{\"field\":\"averageDaysToIssuePermit\"}}}},\"Average Days to issue permit\":{\"sum_bucket\":{\"buckets_path\":\"intermediateAggr.averageDaysToIssuePermit\"}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Average Days to issue permit"
],
"insight": {
"chartResponseMap" : "nssOBPSAverageDaysIssuePermit",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Average Days to issue permit"
},
"nssOBPSAverageDaysIssueOC": {
"chartName": "NSS_OBPS_AVERAGE_DAYS_TO_ISSUE_PERMIT",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"intermediateAggr\":{\"terms\":{\"field\":\"date\"},\"aggs\":{\"averageDaysToIssueOC\":{\"avg\":{\"field\":\"averageDaysToIssueOC\"}}}},\"Average Days to issue OC\":{\"sum_bucket\":{\"buckets_path\":\"intermediateAggr.averageDaysToIssueOC\"}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Average Days to issue OC"
],
"insight": {
"chartResponseMap" : "nssOBPSAverageDaysIssueOC",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": "DSS OBPS Average Days to issue OC"
},
"nssOBPSTotalOCSubmitted": {
"chartName": "NSS_OBPS_TOTAL_OC_SUBMITTED",
"queries": [
{
"module": "OBPS",
"dateRefField": "date",
"requestQueryMap": "{\"ward\" : \"ward.keyword\",\"ulb\" : \"ulb.keyword\", \"state\" : \"state.keyword\"}",
"indexName": "obps-national-dashboard",
"aggrQuery": "{\"aggs\":{\"intermediateAggr\":{\"terms\":{\"field\":\"date\"},\"aggs\":{\"ocSubmitted\":{\"avg\":{\"field\":\"ocSubmitted\"}}}},\"Total OC Submitted\":{\"sum_bucket\":{\"buckets_path\":\"intermediateAggr.ocSubmitted\"}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"drillChart": "none",
"aggregationPaths": [
"Total OC Submitted"
],
"insight": {
"chartResponseMap" : "nssOBPSTotalOCSubmitted",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true