Merged in reportAPI (pull request #39)

backend issue fix
This commit is contained in:
Tafseer Binte Mannan 2024-10-16 11:53:57 +00:00
commit d47614f0ca
4 changed files with 17 additions and 16 deletions

View File

@ -234,10 +234,10 @@ public class DataListRestControllerWithFunction {
penta1Coverage.put("title", "Penta-1 Coverage");
responseData.put(penta1Coverage);
JSONObject birthNotification= new JSONObject();
birthNotification.put("count", row.get("birth_notification_sent"));
birthNotification.put("title", "Total Birth Notification Sent");
responseData.put(birthNotification);
// JSONObject birthNotification= new JSONObject();
// birthNotification.put("count", row.get("birth_notification_sent"));
// birthNotification.put("title", "Total Birth Notification Sent");
// responseData.put(birthNotification);
// JSONObject brnReceived= new JSONObject();
@ -245,20 +245,20 @@ public class DataListRestControllerWithFunction {
// brnReceived.put("title", "Total BRN Received");
// responseData.put(brnReceived);
JSONObject deathNotification= new JSONObject();
deathNotification.put("count", row.get("death_notification_sent"));
deathNotification.put("title", "Total Death Notification Sent");
responseData.put(deathNotification);
// JSONObject deathNotification= new JSONObject();
// deathNotification.put("count", row.get("death_notification_sent"));
// deathNotification.put("title", "Total Death Notification Sent");
// responseData.put(deathNotification);
// JSONObject deathReg= new JSONObject();
// deathReg.put("count", row.get("death_reg"));
// deathReg.put("title", "Total Death Registration Completed");
// responseData.put(deathReg);
JSONObject newborn= new JSONObject();
newborn.put("count", row.get("no_newborn_reg"));
newborn.put("title", "Newborns Registered");
responseData.put(newborn);
// JSONObject newborn= new JSONObject();
// newborn.put("count", row.get("no_newborn_reg"));
// newborn.put("title", "Newborns Registered");
// responseData.put(newborn);
// JSONObject dhis2Count= new JSONObject();
// dhis2Count.put("count", row.get("dhis2_count"));

View File

@ -1507,7 +1507,7 @@ public class ReportController {
JSONObject params = new JSONObject(dto);
params = reportService.fetchLowerLevelLocations(params);
String jsonParams = "" + params.toString() + "";
// System.out.println("params: " + jsonParams);
System.out.println("params: " + jsonParams);
String functionName = params.getString("functionName");
List<String> chartNames = reportService.getChartsByFunctionName(functionName);

View File

@ -2257,6 +2257,7 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
childs = fetchChildLocations(parents, "");
}
else if (params.has("division") && StringUtils.isBlank(params.getString("division"))) {
System.err.println("vgvhv");
parents = "select cast(l.id as varchar) from core.location l where l.location_tag_id = 10";
childKey = "division";
childs = fetchChildLocations(parents, "");
@ -2279,7 +2280,7 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
else if (paurasava.equals("no")) {
addCond = " and EXISTS (select vw.paurasava from core.vm_paurasava_only vw where vw.id = l.id) ";
}
String sql = " select STRING_AGG(cast(l.id as varchar), ',') from core.location l where cast(l.parent_location_id as text) = any("+parents+") "
String sql = " select STRING_AGG(cast(l.id as varchar), ',') from core.location l where cast(l.parent_location_id as text) = any("+parents+") and l.location_tag_id is not null "
+ addCond;
List<String> result = em.createNativeQuery(sql).getResultList();
if (result!=null && result.size()>0) {

View File

@ -272,8 +272,8 @@ public class ReportService {
}
else if (functionName.equals("maternalDelivery")) {
// return new ArrayList<String>(Arrays.asList("maternalInstitutionalRateDeliveryPercentage", "maternalConductedByProvidersDelivery","maternalDeliveryByModeOfDelivery","maternalDeliveryLiveBirthAndStillBirth","maternalDeliveryComplicationOccurredAndTypeComplication","maternalDeliveryAccordingToConsultant","maternalDeliveryAgeOfDeath","maternalDeliveryStatistics","maternalPlaceOfDelivery"));
return new ArrayList<String>(Arrays.asList("maternalDeliveryStatistics"));
return new ArrayList<String>(Arrays.asList("maternalInstitutionalRateDeliveryPercentage", "maternalConductedByProvidersDelivery","maternalDeliveryByModeOfDelivery","maternalDeliveryLiveBirthAndStillBirth","maternalDeliveryComplicationOccurredAndTypeComplication","maternalDeliveryAccordingToConsultant","maternalDeliveryAgeOfDeath","maternalDeliveryStatistics","maternalPlaceOfDelivery"));
// return new ArrayList<String>(Arrays.asList("maternalDeliveryStatistics"));
}
else if (functionName.equals("maternalPnc")) {