diff --git a/api/src/main/java/org/openmrs/module/systemmonitor/export/DHISGenerateDataValueSetSchemas.java b/api/src/main/java/org/openmrs/module/systemmonitor/export/DHISGenerateDataValueSetSchemas.java index bdc8064..041e2ad 100644 --- a/api/src/main/java/org/openmrs/module/systemmonitor/export/DHISGenerateDataValueSetSchemas.java +++ b/api/src/main/java/org/openmrs/module/systemmonitor/export/DHISGenerateDataValueSetSchemas.java @@ -38,7 +38,7 @@ public static JSONObject generateRwandaSPHEMTDHISDataValueSets() { JSONObject jsonObj = new JSONObject(); JSONObject jsonObj2 = new JSONObject(); JSONObject finalJSON = new JSONObject(); - JSONArray jsonToBePushed; + JSONArray jsonToBePushed = new JSONArray(); JSONArray jsonDataValueSets = new JSONArray(); SystemMonitorService systemMonitorService = Context.getService(SystemMonitorService.class); OSAndHardwareIndicators osshi = new OSAndHardwareIndicators(); @@ -383,11 +383,12 @@ public static JSONObject generateRwandaSPHEMTDHISDataValueSets() { jsonToBePushed.put(installedModulesDataElementJSON2); jsonDataValueSets.put(systemRealLocationDataElementJSON); jsonDataValueSets.put(installedModulesDataElementJSON); - jsonObj.put("dataValues", addMetricDetailsLikeNamesToAllDataJSON(jsonDataValueSets)); - jsonObj2.put("dataValues", jsonToBePushed); - finalJSON.put("allData", jsonObj); - finalJSON.put("toBePushed", jsonObj2); } + jsonObj.put("dataValues", addMetricDetailsLikeNamesToAllDataJSON(jsonDataValueSets)); + jsonObj2.put("dataValues", jsonToBePushed); + finalJSON.put("allData", jsonObj); + finalJSON.put("toBePushed", jsonObj2); + return finalJSON; }