2
<%@ page contentType="text/html ; charset=UTF-8"%>
4
<%@ page import="java.sql.*,java.util.*" %>
5
<%@ page session="true"%>
7
<!-- Bean Specification -->
8
<jsp:useBean id="DataStausAction" scope="session" class="org.hisp.gtool.action.DataStatusAction" />
9
<jsp:useBean id="GAUtilities" scope="session" class="org.hisp.gtool.utilities.GAUtilities" />
12
//String urlForSR = request.getParameter("Action");
13
//String partsOfUrl[] = urlForSR.split("@@");
16
int selOrgUnitID = Integer.parseInt(request.getParameter("ouIDTB"));
17
String startingDate = request.getParameter("sDateLB");
18
String endingDate = request.getParameter("eDateLB");
19
String dataSetIdsList[] = request.getParameterValues("dataSetListCB");
20
String localLang = request.getParameter("LocalLangCB");
24
int selOrgUnitLevel = 1;
25
int maxOrgUnitLevel = 1;
27
String selOrgUnitName = "";
29
double dataStatusPer = 0.0;
30
double totDataStatusPer =0.0;
31
double selOrgUnitDataStatus[];
33
// These 2 are hard coded, we need to change these
34
int periodIDs[] = new int[200];
35
String periodNames[] = new String[200];
37
int totDataSetMem = 1;
41
String dataSetName = "";
43
String monthNames[] = {"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
45
// if we want to use this Program to another state we need to give the level names of that state
46
String levelNames[] = {"","State","District","Taluk","PHC","Subcentre"};
50
String cellColor = "";
52
// String strPeriodIDs = "-1";
54
Hashtable htForChildOUTree = DataStausAction.getChildOrgUnitTree(selOrgUnitID);
55
if(htForChildOUTree == null) {out.println("<h3>No Children</h3>");return ; }
57
List liForChildOUIDs = (ArrayList) htForChildOUTree.get("childOUIDsList");
58
List liForChildOUNames = (ArrayList) htForChildOUTree.get("childOUNamesList");
59
List liForChildOULevles = (ArrayList) htForChildOUTree.get("childOULevelsList");
60
maxOrgUnitLevel = ((Integer) Collections.max(liForChildOULevles)).intValue();
61
List listForChildShortNames = (ArrayList) htForChildOUTree.get("childOUShortNamesList");
63
Hashtable htForDataSets = DataStausAction.getSelectedDataSetMemebers(dataSetIdsList);
64
if(htForDataSets == null) {out.println("<h3>No DataSets</h3>");return ; }
65
Vector keysFoDataSets = new Vector(htForDataSets.keySet());
66
Collections.sort(keysFoDataSets);
67
Iterator keysFoDataSetsIter = keysFoDataSets.iterator();
69
List liForSelOU = (ArrayList) DataStausAction.getSelectedOUDetails(selOrgUnitID);
70
selOrgUnitName = (String) liForSelOU.get(0);
71
selOrgUnitLevel = ((Integer) liForSelOU.get(1)).intValue();
73
List liForPeriods = (ArrayList) DataStausAction.getPeriodDetails(startingDate, endingDate, 1);
74
Iterator itForPeriods = liForPeriods.iterator();
79
<title>DataStatus</title>
83
<font face="arial" size="3"><b><%=selOrgUnitName%> Data Entry Status</b></font>
87
<tr><td bgcolor="green"> </td><td><font face="arial" size="1"> Completed (75+)</font></td></tr>
88
<tr><td bgcolor="yellow"> </td><td><font face="arial" size="1"> Partially Completed (40 - 75)</font></td></tr>
89
<tr><td bgcolor="red"> </td><td><font face="arial" size="1"> Not Completed (< 40)</font></td></tr>
95
//This is to get Datasets - id,name,totalnumber of dataelements that are members of dataset
96
while(keysFoDataSetsIter.hasNext())
98
String strDataSetID = (String)keysFoDataSetsIter.next();
99
dataSetID = Integer.parseInt(strDataSetID);
101
ArrayList liForDataSets = (ArrayList) htForDataSets.get(strDataSetID);
102
dataSetName = (String) liForDataSets.get(0);
103
int totNoOfDSMemebers = ((Integer) liForDataSets.get(1)).intValue();
107
<div align="left"><font face="arial" size="3"><b>DataSet : <%=dataSetName%></b></font></div>
108
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
111
for(count1=selOrgUnitLevel+1;count1<=maxOrgUnitLevel;count1++)
114
<td><font face="arial" size="2"><b><%=levelNames[count1]%></b></font></td>
118
// strPeriodIDs = "-1";
120
itForPeriods = liForPeriods.iterator();
121
while(itForPeriods.hasNext())
123
List templi = (ArrayList) itForPeriods.next();
124
int periodID = ((Integer)templi.get(0)).intValue();
125
String startDate = (String)templi.get(1);
126
String monYearFormat = GAUtilities.getMonYearFormat(startDate);
128
// strPeriodIDs += ","+periodID;
130
<td><font face="arial" size="2"><b><%=monYearFormat%></b></font></td>
132
}// Period While loop end
134
<td><font face="arial" size="2"><b>Overall %</b></font></td>
137
Iterator itForChildOUIDs = liForChildOUIDs.iterator();
138
Iterator itForChildOUNames = liForChildOUNames.iterator();
139
Iterator itForChildOULevels = liForChildOULevles.iterator();
140
Iterator itForChildOUSNames = listForChildShortNames.iterator();
142
while(itForChildOUIDs.hasNext())
147
int childOUID = ((Integer)itForChildOUIDs.next()).intValue();
148
String childOUName = (String) itForChildOUNames.next();
149
int childOULevel = ((Integer) itForChildOULevels.next()).intValue();
151
if(localLang != null) childOUName = (String) itForChildOUSNames.next();
153
String tempOUName ="";
154
for(count1=selOrgUnitLevel+1;count1<=maxOrgUnitLevel;count1++)
156
if(count1==childOULevel) tempOUName = childOUName;
157
else tempOUName = "";
159
<td><font face="arial" size="2"><%=tempOUName%></font></td>
162
totDataStatusPer = 0.0;
163
String cellData = "";
165
itForPeriods = liForPeriods.iterator();
166
while(itForPeriods.hasNext())
168
List templi = (ArrayList) itForPeriods.next();
169
int periodID = ((Integer)templi.get(0)).intValue();
170
String startDate = (String)templi.get(1);
172
dataStatus = DataStausAction.getStatusByPeriod(childOUID,dataSetID,periodID);
173
dataStatusPer = ((double)dataStatus / (double)totNoOfDSMemebers) * 100.0;
174
totDataStatusPer += dataStatusPer;
176
if(dataStatusPer >= 75) cellColor = "green";
177
else if (dataStatusPer >=40 && dataStatusPer < 75) cellColor = "yellow";
178
else cellColor = "red";
180
if(childOULevel!=maxOrgUnitLevel) { cellColor = "white"; cellData="";}
181
else cellData = ""+( Math.round(dataStatusPer*Math.pow(10,1)) / Math.pow(10,1));
183
<td bgcolor="<%=cellColor%>" align="center"><font face="Arial" size="1" color="#FF6633"><%=cellData%></font></td>
185
}// Period While loop end
187
if(totDataStatusPer/periodCount >= 75) cellColor = "green";
188
else if (totDataStatusPer/periodCount >=40 && totDataStatusPer/periodCount < 75) cellColor = "yellow";
189
else cellColor = "red";
191
if(childOULevel!=maxOrgUnitLevel) { cellColor = "white"; cellData="";}
192
else cellData = ""+( Math.round( (totDataStatusPer/periodCount) *Math.pow(10,1)) / Math.pow(10,1));
194
<td bgcolor="<%=cellColor%>" align="center"><font face="Arial" size="1" color="#FF6633"><%=cellData%></font></td>
197
}// ChildOrgUnit While loop end
201
}// DataSet While loop end