There are two dimensions to DSS. The first refers to the process where the data is pooled into ElasticSearch and the second relates to the way the data is fetched, aggregated, computed, transformed and sent across.
The DSS processes are easily configurable and this enables users to configure new analytics insights using a wide range of data sets.
This document defines the configuration steps for fetching analytical insights on the DSS for the Birth & Death module.
The Chart API Configuration Document is used to configure each visualization and its properties. The Visualization Code is the key and its properties are easily configurable.
Sample ChartApiConfiguration.json data for Birth and Death.
Copy "dssBirthTotalApplication": {
"chartName": "DSS_BIRTH_TOTAL_APPLICATION",
"queries": [
{
"module": "BIRTH",
"indexName": "birth-cert-v1",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"Data.applicationStatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"Birth total Application\":{\"value_count\":{\"field\":\"Data.birthCertificateNo.keyword\"}}}}}}",
"requestQueryMap": "{\"wardId\" : \"Data.ward.keyword\", \"district\" : \"Data.district.keyword\", \"tenantId\" : \"Data.tenantId.keyword\"}",
"dateRefField": "Data.dateofissue"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Birth total Application"
],
"insight": {
"chartResponseMap" : "totalApplication",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "month"
},
"_comment": " totalApplication is the chartId"
},
"dssDeathTotalApplication": {
"chartName": "DSS_DEATH_TOTAL_APPLICATION",
"queries": [
{
"module": "DEATH",
"indexName": "death-cert-v1",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"Data.applicationStatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"Death total Application\":{\"value_count\":{\"field\":\"Data.deathCertificateNo.keyword\"}}}}}}",
"requestQueryMap": "{\"wardId\" : \"Data.ward.keyword\", \"district\" : \"Data.district.keyword\", \"tenantId\" : \"Data.tenantId.keyword\"}",
"dateRefField": "Data.dateofissue"
}
],
"chartType": "metric",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Death total Application"
],
"insight": {
"chartResponseMap" : "totalApplication",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "month"
},
"_comment": " totalApplication is the chartId"
},
"birthNetCollection": {
"chartName": "DSS_BIRTH_NET_COLLECTION",
"queries": [
{
"module": "BIRTH",
"dateRefField": "dataObject.paymentDetails.receiptDate",
"requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId.keyword\"}",
"indexName": "dss-collection_v2",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.paymentDetails.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.paymentDetails.businessService.keyword\":[\"BIRTH_CERT\"]}}]}},\"aggs\":{\"Birth total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "amount",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"Birth total Collection"
],
"insight": {
"chartResponseMap" : "netCollectionv2",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "month"
},
"_comment": " "
},
"deathNetCollection": {
"chartName": "DSS_DEATH_NET_COLLECTION",
"queries": [
{
"module": "DEATH",
"dateRefField": "dataObject.paymentDetails.receiptDate",
"requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId.keyword\"}",
"indexName": "dss-collection_v2",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.paymentDetails.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.paymentDetails.businessService.keyword\":[\"DEATH_CERT\"]}}]}},\"aggs\":{\"Death total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "amount",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"Death total Collection"
],
"insight": {
"chartResponseMap" : "netCollectionv2",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "month"
},
"_comment": " "
},
"deathByCategory": {
"chartName": "DSS_DEATH_BY_CATEGORY",
"queries": [
{
"module": "DEATH",
"requestQueryMap": "{\"wardId\" : \"Data.ward.keyword\", \"district\" : \"Data.district.keyword\", \"tenantId\" : \"Data.tenantId.keyword\"}",
"dateRefField": "Data.dateofissue",
"indexName": "death-cert-v1",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"Data.applicationStatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"category\":{\"terms\":{\"field\":\"Data.gender.keyword\"}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "deathByCategoryDrilldownAge",
"drillFields": [
"selectedType",
""
],
"aggregationPaths": [
"category"
],
"insight": {
},
"_comment": "Death By Age Category"
},
"deathByCategoryDrilldownAge": {
"chartName": "DSS_DEATH_BY_CATEGORY_DRILLDOWN_AGE",
"queries": [
{
"module": "DEATH",
"requestQueryMap": "{\"wardId\":\"Data.ward.keyword\",\"district\":\"Data.district.keyword\",\"tenantId\":\"Data.tenantId.keyword\",\"selectedType\":\"Data.gender.keyword\"}",
"dateRefField": "Data.dateofissue",
"indexName": "death-cert-v1",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"Data.applicationStatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"less than 2\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"to\":1}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"2-14\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":2,\"to\":14}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"15-29\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":15,\"to\":29}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"30-44\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":30,\"to\":44}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"45-59\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":45,\"to\":59}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"60-74\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":60,\"to\":74}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}},\"greater than 75\":{\"date_range\":{\"field\":\"Data.age\",\"ranges\":[{\"from\":75}]},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.age\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"filterKeys": [
{"key": "selectedType", "column": "gender"}
],
"drillChart": "none",
"aggregationPaths": [
"less than 2",
"2-14",
"15-29",
"30-44",
"45-59",
"60-74",
"greater than 75"
],
"insight": {
},
"_comment": "Death By Age Category"
},
"birthDownloadTrend": {
"chartName": "DSS_BIRTH_DOWNLOAD_TREND",
"queries": [
{
"module": "BIRTH",
"dateRefField": "Data.dateofissue",
"requestQueryMap": "{\"wardId\" : \"Data.ward.keyword\", \"district\" : \"Data.district.keyword\", \"tenantId\" : \"Data.tenantId.keyword\"}",
"indexName": "birth-cert-v1",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\": [{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"downloads\":{\"date_histogram\":{\"field\": \"Data.dateofissue\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Applications Total\":{\"filter\":{\"bool\":{\"must_not\":[{\"terms\":{\"Data.applicationStatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"Count\": {\"value_count\": {\"field\":\"Data.birthCertificateNo.keyword\"}}}}}}}}}}"
}
],