← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8001: local vn - Fixed logic when loading entry hospital form. Added a filter into ICD default form.

 

------------------------------------------------------------
revno: 8001
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-09-05 09:17:50 +0700
message:
  local vn - Fixed logic when loading entry hospital form. Added a filter into ICD default form.
modified:
  local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java
  local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties
  local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties
  local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/defaultICDForm.vm
  local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js
  local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm


--
lp:dhis2
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
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java'
--- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java	2012-09-04 08:23:52 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java	2012-09-05 02:17:50 +0000
@@ -29,7 +29,6 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;

=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2012-08-10 08:52:33 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2012-09-05 02:17:50 +0000
@@ -136,4 +136,5 @@
 explore_icd_report_result = Explore ICD report result
 collapse_icd_report_result = Collapse ICD report result
 disease = Disease
-dhis-web-dataentry-hospital = Data Entry 
\ No newline at end of file
+dhis-web-dataentry-hospital = Data Entry
+filter_disease_or_icd_code = Filter by Disease name or ICD code
\ No newline at end of file

=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties	2012-08-10 08:52:33 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/org/hisp/dhis/de/i18n_module_vi_VN.properties	2012-09-05 02:17:50 +0000
@@ -142,4 +142,5 @@
 explore_icd_report_result = Hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3 b\u00e1o c\u00e1o ICD
 collapse_icd_report_result = Thu nh\u1ecf k\u1ebft qu\u1ea3 b\u00e1o c\u00e1o ICD
 disease = B\u1ec7nh
-dhis-web-dataentry-hospital = Nh\u1eadp d\u1eef li\u1ec7u
\ No newline at end of file
+dhis-web-dataentry-hospital = Nh\u1eadp d\u1eef li\u1ec7u
+filter_disease_or_icd_code = L\u1ecdc theo T\u00ean b\u1ec7nh ho\u1eb7c M\u00e3 b\u1ec7nh
\ No newline at end of file

=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/defaultICDForm.vm'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/defaultICDForm.vm	2012-09-04 08:23:52 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/defaultICDForm.vm	2012-09-05 02:17:50 +0000
@@ -1,6 +1,17 @@
 <script type="text/javascript">
 	jQuery(document).ready( function() {
 		setTableStyles();
+
+		var filterSpan = jQuery( "#filterSpan" );
+		filterSpan.val( i18n_filter_disease_or_icd_code );
+		
+		filterSpan.blur( function() {
+			filterSpan.val( i18n_filter_disease_or_icd_code );
+		} );
+
+		filterSpan.focus( function() {
+			filterSpan.val( "" );
+		} );
 	});
 </script>
 
@@ -9,7 +20,7 @@
 
 <table class="listTable" id="listTable" cellspacing="0">
 	<thead>
-	<tr><td></td>
+	<tr><td><span><input type="text" id="filterSpan" style="width:25em" onkeyup="filterValues( this.value, 1 );"/></span></td>
 		<th>$i18n.getString( "icd_element_1" )</th>
 		<th>$i18n.getString( "icd_element_2" )</th>
 		<th>$i18n.getString( "icd_element_3" )</th>

=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js	2012-09-04 08:23:52 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/javascript/form.js	2012-09-05 02:17:50 +0000
@@ -28,6 +28,9 @@
 // Indicates whether meta data is loaded
 var metaDataIsLoaded = false;
 
+// Indicates whether meta data is loaded
+var chapterIsShowed = false;
+
 // Currently selected organisation unit identifier
 var currentOrganisationUnitId = null;
 
@@ -332,13 +335,14 @@
     $( '#nextButton' ).removeAttr( 'disabled' );
 
     var dataSetId = $( '#selectedDataSetId option:selected' ).val();
-    var periodId = $( '#selectedPeriodId option:selected' ).val();
-    var periodType = $( '#selectedDataSetId option:selected' ).attr('periodType');
-    var periods = periodTypeFactory.get( periodType ).generatePeriods( currentPeriodOffset );
-    periods = periodTypeFactory.filterFuturePeriods( periods );
 
     if ( dataSetId != -1 )
     {
+		var periodId = $( '#selectedPeriodId option:selected' ).val();
+		var periodType = $( '#selectedDataSetId option:selected' ).attr('periodType');
+		var periods = periodTypeFactory.get( periodType ).generatePeriods( currentPeriodOffset );
+		periods = periodTypeFactory.filterFuturePeriods( periods );
+	
 		addOptionById( 'selectedPeriodId', "-1", '[ ' + i18n_select_period + ' ]' );
 	
         for ( i in periods )
@@ -358,9 +362,10 @@
         currentDataSetId = dataSetId;
 		currentPeriodType = periodType;
 
-		showById( 'chapterTR' );
 		loadAttributeValues( dataSetId );
-    }
+    } else {
+		resetCriteriaDiv();
+	}
 }
 
 function loadSubDataSets( dataSetId )
@@ -415,9 +420,10 @@
 		if ( json.attributeValues.length > 0 )
 		{
 			byId( 'inputCriteria' ).style.width = '504px';
-			byId( 'inputCriteria' ).style.height = '130px';
+			byId( 'inputCriteria' ).style.height = '100px';
 
 			showById( 'chapterTR' );
+			chapterIsShowed = true;
 		}
 		else
 		{
@@ -425,6 +431,8 @@
 			byId( 'inputCriteria' ).style.height = '80px';
 			
 			hideById( 'chapterTR' );
+			chapterIsShowed = false;
+			currentChapterId = null;
 		}
 		
 		jQuery( '#selectedPeriodId' ).bind( 'change', periodSelected );
@@ -494,6 +502,11 @@
 
 		if ( periodId && periodId != -1 )
 		{
+			if ( chapterIsShowed && (currentChapterId == null || currentChapterId == -1) )
+			{
+				return;
+			}
+		
 			if ( currentDataSetId && currentDataSetId == dataSetId )
 			{
 				if ( formLoaded )
@@ -505,8 +518,7 @@
 			} else {
 				loadForm( dataSetId, "" );
 			}
-		}
-		else {
+		} else {
 			clearEntryForm();
 		}
 	} else {
@@ -551,7 +563,7 @@
 
 function loadForm( dataSetId, value )
 {
-	showLoader();
+	lockScreen();
 
     $( '#currentDataElement' ).html( i18n_no_dataelement_selected );
 
@@ -571,7 +583,7 @@
 	function ( responseText, textStatus, req )
 	{
 		if ( textStatus == "error" ) {
-			hideLoader();
+			unLockScreen();
 			hideById( 'showReportButton' );
 			hideById( 'ICDButtonDiv' );
 			clearEntryForm();
@@ -587,6 +599,8 @@
 	var periodId = getFieldValue( 'selectedPeriodId' );
 	var dataSetId = getFieldValue( 'selectedDataSetId' );
 
+	currentChapterId = chapterId;
+	
 	if ( dataSetId == null || dataSetId == -1 )
 	{
 		setHeaderDelayMessage( i18n_please_select_data_set );
@@ -598,10 +612,8 @@
 		setHeaderDelayMessage( i18n_please_select_period );
 		return;
 	}
-	
+
 	loadForm( dataSetId );
-
-	currentChapterId = chapterId;
 }
 
 function loadDepartmentFormSelected()
@@ -615,7 +627,7 @@
 
     if ( periodId && periodId != -1 && dataSetId != -1 )
     {
-        showLoader();
+        lockScreen();
         loadForm( dataSetId, getFieldValue( 'valueInput' ) );
     }
 	else
@@ -626,6 +638,8 @@
 
 function loadDataValues( dataSetId, chapterId )
 {
+	lockScreen();
+
     $( '#completeButton' ).removeAttr( 'disabled' );
     $( '#undoButton' ).attr( 'disabled', 'disabled' );
     $( '#infoDiv' ).css( 'display', 'none' );
@@ -753,8 +767,8 @@
 	            $( '#infoDiv' ).hide();
 	        }
 
-			showById('completenessDiv');
-			hideLoader();
+			showById( 'completenessDiv' );
+			unLockScreen();
 	    }
 	} );
 }
@@ -764,8 +778,6 @@
     addEventListeners();
 
     $( '#validationButton' ).removeAttr( 'disabled' );
-
-    hideLoader();
 }
 
 function valueFocus( e )

=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm'
--- local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm	2012-09-04 08:23:52 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/webapp/dhis-web-dataentry-hospital/select.vm	2012-09-05 02:17:50 +0000
@@ -176,4 +176,5 @@
 var i18n_select_chapter = "[ " + '$encoder.jsEscape( $i18n.getString( "select_chapter" ) , "'")' + " ]";
 var i18n_explore_icd_report_result = '$encoder.jsEscape( $i18n.getString( "explore_icd_report_result" ) , "'")';
 var i18n_collpase_icd_report_result = '$encoder.jsEscape( $i18n.getString( "collapse_icd_report_result" ) , "'")';
+var i18n_filter_disease_or_icd_code = '$encoder.jsEscape( $i18n.getString( "filter_disease_or_icd_code" ) , "'")';
 </script>
\ No newline at end of file