← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 74: Author: Bharath Kumar - Validating Line Listing Data Entry

 

------------------------------------------------------------
revno: 74
committer: Saptarshi <sunbiz@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2009-03-17 17:06:23 +0530
message:
  Author: Bharath Kumar - Validating Line Listing Data Entry
modified:
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java	2009-03-16 08:43:19 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java	2009-03-17 11:36:23 +0000
@@ -1311,13 +1311,13 @@
             + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value < '16'";
         // Metarnal Death At age 16 to 19
         queries[7] = "SELECT COUNT(*) FROM lldatavalue WHERE sourceid = " + ouId + " AND periodid = " + pId
-            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value >= '16' and value < '19'";
-        // Metarnal Death At age 19 to 35
+            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value >= '16' and value <= '19'";
+        // Metarnal Death At age 20 to 35
         queries[8] = "SELECT COUNT(*) FROM lldatavalue WHERE sourceid = " + ouId + " AND periodid = " + pId
-            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value >= '19' and value <'35' ";
+            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value >= '20' and value <= '35' ";
         // Metarnal Death At age above 35
         queries[9] = "SELECT COUNT(*) FROM lldatavalue WHERE sourceid = " + ouId + " AND periodid = " + pId
-            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value >= '35'";
+            + " AND dataelementid = " + LLDataSets.LLMD_AGE_AT_DEATH + "  AND value > '35'";
 
         // Metarnal Death At Home
         queries[10] = "SELECT COUNT(*) FROM lldatavalue WHERE sourceid = " + ouId + " AND periodid = " + pId

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2009-03-10 06:15:33 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2009-03-17 11:36:23 +0000
@@ -63,6 +63,197 @@
 }
 
 // -----------------------------------------------------------------------------
+// String Trim
+// -----------------------------------------------------------------------------
+
+function trim( stringToTrim ) 
+{
+  return stringToTrim.replace(/^\s+|\s+$/g,"");
+}
+
+
+// -----------------------------------------------------------------------------
+// Date Validation for Linelisting
+// -----------------------------------------------------------------------------
+
+// Declaring valid date character, minimum year and maximum year
+var dtCh= "-";
+var minYear=1900;
+var maxYear=2100;
+
+function isInteger(s)
+{
+  var i;
+  for (i = 0; i < s.length; i++)
+  {   
+    // Check that current character is number.
+    var c = s.charAt(i);
+    if (((c < "0") || (c > "9"))) return false;
+  }
+  // All characters are numbers.
+  return true;
+}
+
+function stripCharsInBag(s, bag)
+{
+  var i;
+  var returnString = "";
+  
+  // Search through string's characters one by one.
+  // If character is not in bag, append to returnString.
+  for (i = 0; i < s.length; i++)
+  {   
+    var c = s.charAt(i);
+    if (bag.indexOf(c) == -1) returnString += c;
+  }
+  
+  return returnString;
+}
+
+function daysInFebruary (year)
+{
+  // February has 29 days in any year evenly divisible by four,
+  // EXCEPT for centurial years which are not also divisible by 400.
+  
+  return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
+}
+
+function DaysArray(n) 
+{
+  for (var i = 1; i <= n; i++) 
+  {
+    this[i] = 31
+    if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
+    if (i==2) {this[i] = 29}
+  } 
+  
+  return this
+}
+
+function isDate(dtStr)
+{
+  var daysInMonth = DaysArray(12)
+  var pos1=dtStr.indexOf(dtCh)
+  var pos2=dtStr.indexOf(dtCh,pos1+1)
+
+  var strYear=dtStr.substring(0,pos1)
+  var strMonth=dtStr.substring(pos1+1,pos2)
+  var strDay=dtStr.substring(pos2+1)
+
+  //var strMonth=dtStr.substring(0,pos1)
+  //var strDay=dtStr.substring(pos1+1,pos2)
+  //var strYear=dtStr.substring(pos2+1)
+  strYr=strYear
+  if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
+  if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
+  for (var i = 1; i <= 3; i++) 
+  {
+    if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
+  }
+  month=parseInt(strMonth)
+  day=parseInt(strDay)
+  year=parseInt(strYr)
+  if (pos1==-1 || pos2==-1)
+  {
+    alert("The date format should be : yyyy-mm-dd")
+    return false
+  }
+  
+  if (strMonth.length<1 || month<1 || month>12)
+  {
+    alert("Please enter a valid month")
+    return false
+  }
+  if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month])
+  {
+    alert("Please enter a valid day")
+    return false
+  }
+  if (strYear.length != 4 || year==0 || year<minYear || year>maxYear)
+  {
+    alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
+    return false
+  }
+  if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
+  {
+    alert("Please enter a valid date")
+    return false
+  }
+
+  return true
+}
+
+function isInteger(s)
+{
+  var n = trim(s);
+  return n.length > 0 && !(/[^0-9]/).test(n);
+}
+
+function validateWeightField( dataElementId, recordNo )
+{
+  var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+  var resVal = resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+
+  if(resVal == null || resVal == "" )
+  {    
+    field.value = "";
+    field.focus();
+    
+    return false;
+  }
+
+  if( isInteger( resVal) || resVal.toUpperCase() == "NK" )
+  {
+    saveLLbirthValue( dataElementId, recordNo );
+  }
+  else
+  {
+  	alert("Please enter weight in Grams");
+  	field.value = "";
+    field.focus();
+    
+    return false;
+  }	
+}
+
+function validateNameField( dataElementId, recordNo )
+{
+  var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+
+  if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == "" )
+  {
+    alert("Please enter Name");
+    field.value = "";
+    field.focus();
+    
+    return false;
+  }
+  
+  saveLLbirthValue( dataElementId, recordNo );  	
+}
+
+function validateBirthDateField( dataElementId, recordNo )
+{
+	var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+    
+	if( isDate(resVal) )
+	{	
+    saveLLbirthValue( dataElementId, recordNo );
+	}
+	else
+	{
+	 field.value = "";
+	 field.focus();
+	}	
+	
+	return false; 
+}
+
+
+// -----------------------------------------------------------------------------
 // Save
 // -----------------------------------------------------------------------------
 

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm	2009-03-16 05:42:59 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm	2009-03-17 11:36:23 +0000
@@ -6,17 +6,28 @@
 	var nextFlag = 0;
 	
 	var slnos = $recordNos.size()+1;
+	var curRecord = slnos;
 	
-	function addLLBNewRow()
+	function addLLBNewRow( thisValue, dataElementId, recordNo )
 	{
-		if(nextFlag == 0)
-		{
-		   nextFlag = 1;
-		}
-		else
-		{
-		    return;
-		}
+
+		var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].slno' );    
+		var resVal = field.innerHTML;
+		
+       if( thisValue == null || thisValue.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == "" || slnos != resVal )
+       {
+            return;
+       }
+		
+		//if(nextFlag == 0)
+		//{
+		//   nextFlag = 1;
+		//}
+		//else
+		//{
+		//    return;
+		//}
+		
 		
 		nextRecordNo++;
 		slnos++;
@@ -26,22 +37,22 @@
 		var newRow = tbl.insertRow(lastRow);		
             
     	var oCell = newRow.insertCell(0);
-    	oCell.innerHTML = "<div align='center'>" + slnos + "</div>";
+    	oCell.innerHTML = "<div id='value[1020].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + "</div>";
 
     	var oCell = newRow.insertCell(1);
-    	oCell.innerHTML = "<input name='entryfield' id='value[1020].value:value["+nextRecordNo+"].value' type='text' value=' ' onchange='saveLLbirthValue(1020,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' onblur='addLLBNewRow()' style='width:100% text-align:center'>";
+    	oCell.innerHTML = "<input name='entryfield' id='value[1020].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateNameField(1020,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' onblur='addLLBNewRow(this.value, 1020, "+nextRecordNo+")' style='width:100% text-align:center'>";
     
     	oCell = newRow.insertCell(2);
-    	oCell.innerHTML = "<input name='entryfield' id='value[1021].value:value["+nextRecordNo+"].value' type='text' value=' ' onchange='saveLLbirthValue(1021,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+    	oCell.innerHTML = "<input name='entryfield' id='value[1021].value:value["+nextRecordNo+"].value' type='text' value='' onchange='saveLLbirthValue(1021,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
     
     	oCell = newRow.insertCell(3);    	
     	oCell.innerHTML = "<select name='entryfield' id='value[1022].value:value["+nextRecordNo+"].value' onchange='saveLLbirthValue(1022,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='M'>Male</option><option value='F'>Female</option></select>";    	
 
     	oCell = newRow.insertCell(4);
-    	oCell.innerHTML = "<input name='entryfield' id='value[1023].value:value["+nextRecordNo+"].value' type='text' value='' onchange='saveLLbirthValue(1023,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:10em text-align:center'> <img src='../images/calendar_icon.gif' width='16' height='16' id='getvalue[1023].value:value["+nextRecordNo+"].value' cursor: pointer;' title='$i18n.getString( 'date_selector' )' onmouseover='this.style.background='orange';' onmouseout='this.style.background='''>";
+    	oCell.innerHTML = "<input name='entryfield' id='value[1023].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateBirthDateField(1023,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:10em text-align:center'> <img src='../images/calendar_icon.gif' width='16' height='16' id='getvalue[1023].value:value["+nextRecordNo+"].value' cursor: pointer;' title='$i18n.getString( 'date_selector' )' onmouseover='this.style.background='orange';' onmouseout='this.style.background='''>";
     		    	        	
     	oCell = newRow.insertCell(5);
-    	oCell.innerHTML = "<input name='entryfield' id='value[1024].value:value["+nextRecordNo+"].value' type='text' value=' ' onchange='saveLLbirthValue(1024,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+    	oCell.innerHTML = "<input name='entryfield' id='value[1024].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateWeightField(1024,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
 
     	oCell = newRow.insertCell(6);
     	oCell.innerHTML = "<select name='entryfield' id='value[1025].value:value["+nextRecordNo+"].value' onchange='saveLLbirthValue(1025,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='Y'>YES</option><option value='N'>NO</option><option value='NK'>NOT KNOWN</option></select>";
@@ -55,7 +66,7 @@
 
 
 
-<div align="center"><h3><u>Line List of Birth</u></h3></div>
+<div align="center"><h3><u>Linelisting : Live Births</u></h3></div>
 
 
 <table id="tblGrid" width="100%">
@@ -64,7 +75,7 @@
 		<th width="20%">Name of Child Born for Mother/Father Name</th>
 		<th width="20%">Village</th>
 		<th width="10%">Sex</th>
-		<th width="20%">Approx Date of birth</th>
+		<th width="20%">Approx Date of birth<br>(YYYY-MM-DD)</th>
 		<th width="12%">Weight(in gms) or NK</th>
 		<th width="13%">Breast feeding in first hour (Y/N/NK)</th>		
 	<tr>
@@ -96,15 +107,17 @@
 			</td>
 		#elseif($count1 == 4)
 			<td>
-				<input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue()) $llDataValue.getValue() #end" onchange="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+				<input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateBirthDateField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
 				<img src="../images/calendar_icon.gif" width="16" height="16" id="getvalue[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''">
 			</td>
 			#set($calInfo = $calInfo + "Calendar.setup({inputField:'value["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value',ifFormat:'$i18n.getString('format.date.label')',button:'getvalue["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value'});")
 		#elseif($count1 == 1)
-			<td align="center">$slno</td>
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue()) $llDataValue.getValue() #end" onchange="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>							
+			<td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+        #elseif($count1 == 5)
+            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateWeightField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>											
 		#else
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue()) $llDataValue.getValue() #end" onchange="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>		
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>		
 		#end
 		#set( $count1 = $count1 + 1 )		
 	#end
@@ -112,9 +125,9 @@
 	</tr>	
 #end
 <tr>
-	<td align="center">$slno</td>	
-	<td><input name="entryfield" id="value[1020].value:value[$recordNo].value" type="text" value=" " onchange="saveLLbirthValue(1020,$recordNo )" onkeypress="return keyPress(event, this)" onblur="addLLBNewRow()" style="width:100% text-align:center"></td>
-	<td><input name="entryfield" id="value[1021].value:value[$recordNo].value" type="text" value=" " onchange="saveLLbirthValue(1021,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td align="center"><div id='value[1020].value:value[$recordNo].slno' align='center'>$slno</div></td>	
+	<td><input name="entryfield" id="value[1020].value:value[$recordNo].value" type="text" value="" onchange="validateNameField(1020,$recordNo )" onkeypress="return keyPress(event, this)" onblur="addLLBNewRow(this.value, 1020, $recordNo )" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1021].value:value[$recordNo].value" type="text" value="" onchange="saveLLbirthValue(1021,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
 	<td>
 		<select name="entryfield" id="value[1022].value:value[$recordNo].value" onchange="saveLLbirthValue(1022,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
 			<option value="NONE" selected>---</option>
@@ -123,11 +136,11 @@
 		</select>	
 	</td>	
 	<td>
-		<input name="entryfield" id="value[1023].value:value[$recordNo].value" type="text" value="" onchange="saveLLbirthValue(1023,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+		<input name="entryfield" id="value[1023].value:value[$recordNo].value" type="text" value="" onchange="validateBirthDateField(1023,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
 		<img src="../images/calendar_icon.gif" width="16" height="16" id="getvalue[1023].value:value[$recordNo].value" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''">
 		#set($calInfo = $calInfo + "Calendar.setup({inputField:'value[1023].value:value["+$recordNo+"].value',ifFormat:'$i18n.getString('format.date.label')',button:'getvalue[1023].value:value["+$recordNo+"].value'});")
 	</td>	
-	<td><input name="entryfield" id="value[1024].value:value[$recordNo].value" type="text" value=" " onchange="saveLLbirthValue(1024,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1024].value:value[$recordNo].value" type="text" value="" onchange="validateWeightField(1024,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
 	<td>
 		<select name="entryfield" id="value[1025].value:value[$recordNo].value" onchange="saveLLbirthValue(1025,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
 			<option value="NONE" selected>---</option>

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm	2009-03-16 08:43:19 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm	2009-03-17 11:36:23 +0000
@@ -40,7 +40,7 @@
 
 
 
-<div align="center"><h3><u>Line List of Death</u></h3></div>
+<div align="center"><h3><u>Linelisting : Deaths</u></h3></div>
 
 
 <table id="tblGrid" width="100%">
@@ -88,7 +88,7 @@
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="ASPHYXIA" #if($llDataValue.getValue() && $llDataValue.getValue()=="ASPHYXIA") selected #end>ASPHYXIA</option>					
 					<option value="SEPSIS" #if($llDataValue.getValue() && $llDataValue.getValue()=="SEPSIS") selected #end>SEPSIS</option>
-					<option value="LOWBIRTHWEIGH" #if($llDataValue.getValue() && $llDataValue.getValue()=="LOWBIRTHWEIGH") selected #end>LOWBIRTHWEIGH</option>
+					<option value="LOWBIRTHWEIGH" #if($llDataValue.getValue() && $llDataValue.getValue()=="LOWBIRTHWEIGH") selected #end>LOWBIRTHWEIGHT</option>
           <option value="IMMREAC" #if($llDataValue.getValue() && $llDataValue.getValue()=="IMMREAC") selected #end>Immunization reactions</option>
           <option value="PNEUMONIA" #if($llDataValue.getValue() && $llDataValue.getValue()=="PNEUMONIA") selected #end>Pneumonia</option>
           <option value="DIADIS" #if($llDataValue.getValue() && $llDataValue.getValue()=="DIADIS") selected #end>Diarrhoeal Disease</option>

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm	2009-03-16 05:42:59 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm	2009-03-17 11:36:23 +0000
@@ -55,7 +55,7 @@
 
 
 
-<div align="center"><h3><u>Line List of Maternal Death</u></h3></div>
+<div align="center"><h3><u>Linelisting : Maternal Deaths</u></h3></div>
 
 
 <table id="tblGrid" width="100%">

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2009-03-10 06:15:33 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2009-03-17 11:36:23 +0000
@@ -476,6 +476,8 @@
         while ( it.hasNext() )
         {
 
+        	int quarterPeriod = 0;
+        	
             OrganisationUnit currentOrgUnit = (OrganisationUnit) it.next();
 
             Iterator it1 = deCodesList.iterator();
@@ -582,7 +584,7 @@
                 else if ( deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" ) )
                 {
                     String startMonth = "";
-
+                    
                     startMonth = monthFormat.format( sDate );
 
                     if ( startMonth.equalsIgnoreCase( "April" ) )
@@ -602,13 +604,29 @@
                     else
                     {
                         tempStr = "Quarter IV";
+
+                        quarterPeriod = 1;
+                        
+                        
                     }
                 }
 
                 else if ( deCodeString.equalsIgnoreCase( "PERIOD-YEAR" ) )
                 {
+                	if (quarterPeriod != 0)
+                	{
+
+                		Calendar tempQuarterYear = Calendar.getInstance();
+                        
+                        tempQuarterYear.setTime(sDate);
+                        
+                        tempQuarterYear.roll( Calendar.YEAR, -1 );
+                        
+                        sDate = tempQuarterYear.getTime();
+
+                	}              		
+                		
                     tempStr = yearFormat.format( sDate );
-
                 }
                 else if ( deCodeString.equalsIgnoreCase( "SLNO" ) )
                 {
@@ -1502,7 +1520,7 @@
     {
         try
         {
-            System.out.println( "expression : "+formula + " ***** "+ String.valueOf( startDate ) + " **** "+ String.valueOf( endDate ));
+            //System.out.println( "expression : "+formula + " ***** "+ String.valueOf( startDate ) + " **** "+ String.valueOf( endDate ));
             
             int deFlag1 = 0;
             int deFlag2 = 0;



--

https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.