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("@@");
17
int selOrgUnitLevel = 1;
18
int maxOrgUnitLevel = 1;
20
// these are the input parameters
21
int selOrgUnitID = Integer.parseInt(partsOfUrl[0]);
22
String startingDate = partsOfUrl[1];
23
String endingDate = partsOfUrl[2];
26
String selOrgUnitName = "";
28
double dataStatusPer = 0.0;
29
double totDataStatusPer =0.0;
30
double selOrgUnitDataStatus[];
32
// These 2 are hard coded, we need to change these
33
int periodIDs[] = new int[200];
34
String periodNames[] = new String[200];
36
int totDataSetMem = 1;
40
String dataSetName = "";
42
String monthNames[] = {"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
44
// if we want to use this Program to another state we need to give the level names of that state
45
String levelNames[] = {"","State","District","Taluk","PHC","Subcentre"};
49
String cellColor = "";
51
// String strPeriodIDs = "-1";
53
Hashtable htForChildOUTree = DataStausAction.getChildOrgUnitTree(selOrgUnitID);
54
if(htForChildOUTree == null) {out.println("<h3>No Children</h3>");return ; }
56
List liForChildOUIDs = (ArrayList) htForChildOUTree.get("childOUIDsList");
57
List liForChildOUNames = (ArrayList) htForChildOUTree.get("childOUNamesList");
58
List liForChildOULevles = (ArrayList) htForChildOUTree.get("childOULevelsList");
59
maxOrgUnitLevel = ((Integer) Collections.max(liForChildOULevles)).intValue();
62
Hashtable htForDataSets = DataStausAction.getAllDataSetMemebers();
63
if(htForDataSets == null) {out.println("<h3>No DataSets</h3>");return ; }
64
Vector keysFoDataSets = new Vector(htForDataSets.keySet());
65
Collections.sort(keysFoDataSets);
66
Iterator keysFoDataSetsIter = keysFoDataSets.iterator();
68
List liForSelOU = (ArrayList) DataStausAction.getSelectedOUDetails(selOrgUnitID);
69
selOrgUnitName = (String) liForSelOU.get(0);
70
selOrgUnitLevel = ((Integer) liForSelOU.get(1)).intValue();
72
List liForPeriods = (ArrayList) DataStausAction.getPeriodDetails(startingDate, endingDate, 1);
73
Iterator itForPeriods = liForPeriods.iterator();
78
<title>DataStatus</title>
82
<font face="arial" size="3"><b><%=selOrgUnitName%> Data Entry Status</b></font>
86
<tr><td bgcolor="green"> </td><td><font face="arial" size="1"> Completed (75+)</font></td></tr>
87
<tr><td bgcolor="yellow"> </td><td><font face="arial" size="1"> Partially Completed (40 - 75)</font></td></tr>
88
<tr><td bgcolor="red"> </td><td><font face="arial" size="1"> Not Completed (< 40)</font></td></tr>
94
//This is to get Datasets - id,name,totalnumber of dataelements that are members of dataset
95
while(keysFoDataSetsIter.hasNext())
97
String strDataSetID = (String)keysFoDataSetsIter.next();
98
dataSetID = Integer.parseInt(strDataSetID);
100
ArrayList liForDataSets = (ArrayList) htForDataSets.get(strDataSetID);
101
dataSetName = (String) liForDataSets.get(0);
102
int totNoOfDSMemebers = ((Integer) liForDataSets.get(1)).intValue();
106
<div align="left"><font face="arial" size="3"><b>DataSet : <%=dataSetName%></b></font></div>
107
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
110
for(count1=selOrgUnitLevel+1;count1<=maxOrgUnitLevel;count1++)
113
<td><font face="arial" size="2"><b><%=levelNames[count1]%></b></font></td>
117
// strPeriodIDs = "-1";
119
itForPeriods = liForPeriods.iterator();
120
while(itForPeriods.hasNext())
122
List templi = (ArrayList) itForPeriods.next();
123
int periodID = ((Integer)templi.get(0)).intValue();
124
String startDate = (String)templi.get(1);
125
String monYearFormat = GAUtilities.getMonYearFormat(startDate);
127
// strPeriodIDs += ","+periodID;
129
<td><font face="arial" size="2"><b><%=monYearFormat%></b></font></td>
131
}// Period While loop end
133
<td><font face="arial" size="2"><b>Overall %</b></font></td>
136
Iterator itForChildOUIDs = liForChildOUIDs.iterator();
137
Iterator itForChildOUNames = liForChildOUNames.iterator();
138
Iterator itForChildOULevels = liForChildOULevles.iterator();
140
while(itForChildOUIDs.hasNext())
145
int childOUID = ((Integer)itForChildOUIDs.next()).intValue();
146
String childOUName = (String) itForChildOUNames.next();
147
int childOULevel = ((Integer) itForChildOULevels.next()).intValue();
149
String tempOUName ="";
150
for(count1=selOrgUnitLevel+1;count1<=maxOrgUnitLevel;count1++)
152
if(count1==childOULevel) tempOUName = childOUName;
153
else tempOUName = "";
155
<td><font face="arial" size="2"><%=tempOUName%></font></td>
158
totDataStatusPer = 0.0;
159
String cellData = "";
161
itForPeriods = liForPeriods.iterator();
162
while(itForPeriods.hasNext())
164
List templi = (ArrayList) itForPeriods.next();
165
int periodID = ((Integer)templi.get(0)).intValue();
166
String startDate = (String)templi.get(1);
168
dataStatus = DataStausAction.getStatusByPeriod(childOUID,dataSetID,periodID);
169
dataStatusPer = ((double)dataStatus / (double)totNoOfDSMemebers) * 100.0;
170
totDataStatusPer += dataStatusPer;
172
if(dataStatusPer >= 75) cellColor = "green";
173
else if (dataStatusPer >=40 && dataStatusPer < 75) cellColor = "yellow";
174
else cellColor = "red";
176
if(childOULevel!=maxOrgUnitLevel) { cellColor = "white"; cellData="";}
177
else cellData = ""+( Math.round(dataStatusPer*Math.pow(10,1)) / Math.pow(10,1));
179
<td bgcolor="<%=cellColor%>" align="center"><font face="Arial" size="1" color="#FF6633"><%=cellData%></font></td>
181
}// Period While loop end
183
if(totDataStatusPer/periodCount >= 75) cellColor = "green";
184
else if (totDataStatusPer/periodCount >=40 && totDataStatusPer/periodCount < 75) cellColor = "yellow";
185
else cellColor = "red";
187
if(childOULevel!=maxOrgUnitLevel) { cellColor = "white"; cellData="";}
188
else cellData = ""+( Math.round( (totDataStatusPer/periodCount) *Math.pow(10,1)) / Math.pow(10,1));
190
<td bgcolor="<%=cellColor%>" align="center"><font face="Arial" size="1" color="#FF6633"><%=cellData%></font></td>
193
}// ChildOrgUnit While loop end
197
}// DataSet While loop end