← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15275: RBF: Minor fixes on MaxScore

 

------------------------------------------------------------
revno: 15275
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-05-15 07:51:53 +0100
message:
  RBF: Minor fixes on MaxScore
modified:
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java
  local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java
  local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.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/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java	2014-04-30 05:26:01 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/action/GetDataElementforTariffAction.java	2014-05-15 06:51:53 +0000
@@ -1,9 +1,11 @@
 package org.hisp.dhis.rbf.action;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.TreeSet;
 
 import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.constant.Constant;
@@ -98,6 +100,10 @@
         this.orgUnitGroupId = orgUnitGroupId;
     }
     
+    public Integer getOrgUnitGroupId()
+    {
+        return orgUnitGroupId;
+    }
     
     // -------------------------------------------------------------------------
     // Action implementation
@@ -130,63 +136,38 @@
         
         orgUnitGroups = new ArrayList<OrganisationUnitGroup>( orgUnitGroupService.getOrganisationUnitGroupSet( (int) tariff_authority.getValue() ).getOrganisationUnitGroups() );
         
+        Set<DataElement> dataElements = new TreeSet<DataElement>();
+        for( OrganisationUnitGroup orgUnitGroup : orgUnitGroups )
+        {
+            for( DataSet dataSet : orgUnitGroup.getDataSets() )
+            {
+                dataElements.addAll( dataSet.getDataElements() );
+            }
+        }
+            
+        for( DataElement de : dataElements )
+        {
+            if( dataElementList != null && !( dataElementList.contains( "{\"name\" : \"" + de.getName() + "\"}" ) ) )
+            {
+                dataElementList.add( "{\"name\" : \"" + de.getName() + "\"}" );
+            }
+        }
+            
         /*
-        if ( orgUnitGroupId != null )
+        for ( DataElement de : dataElements )
         {
-            List<DataElement> dataElements = new ArrayList<DataElement>();
-            
-            OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( orgUnitGroupId );
-            List<DataSet> dataSets = new ArrayList<DataSet>( orgUnitGroup.getDataSets() );
-            for ( DataSet ds : dataSets )
-            {
-                dataElements.addAll( ds.getDataElements() );
-            }
-            
-            for ( DataElement de : dataElements )
-            {
-                Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
-                for ( AttributeValue attValue : attrValueSet )
+            Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
+            for ( AttributeValue attValue : attrValueSet )
+            {
+                if ( dataElementList != null && !( dataElementList.contains( "{\"name\" : \"" + de.getName() + "\"}" ) )
+                    && attValue.getAttribute().getId() == tariffDataElement.getValue() )
                 {
-                    if ( dataElementList != null && !( dataElementList.contains( "{\"name\" : \"" + de.getName() + "\"}" ) )
-                        && attValue.getAttribute().getId() == tariffDataElement.getValue() )
-                    {
-                        dataElementList.add( "{\"name\" : \"" + de.getName() + "\"}" );
-                    }
+                    dataElementList.add( "{\"name\" : \"" + de.getName() + "\"}" );
                 }
             }
-            
         }
         */
-        
-        //else
-        //{
-            List<DataElement> dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
 
-            for ( DataElement de : dataElements )
-            {
-                Set<AttributeValue> attrValueSet = new HashSet<AttributeValue>( de.getAttributeValues() );
-                for ( AttributeValue attValue : attrValueSet )
-                {
-                    if ( dataElementList != null && !( dataElementList.contains( "{\"name\" : \"" + de.getName() + "\"}" ) )
-                        && attValue.getAttribute().getId() == tariffDataElement.getValue() )
-                    {
-                        dataElementList.add( "{\"name\" : \"" + de.getName() + "\"}" );
-                    }
-                }
-            }
-        //}
-        
-        /*
-        System.out.println( "dataElementList Size : " + dataElementList.size() );
-        
-        for( String dataElement : dataElementList )
-        {
-            System.out.println("  --- dataElement" + dataElement );
-        }
-        */
-            
-        
-        
         return SUCCESS;
     }
 }
\ No newline at end of file

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/LoadQualityScoreDetailsAction.java	2014-05-15 06:51:53 +0000
@@ -32,7 +32,7 @@
 public class LoadQualityScoreDetailsAction
     implements Action
 {
-    private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY";
+    private final static String TARIFF_SETTING_AUTHORITY = "MAXSCORE_SETTING_AUTHORITY";
 
     private final static String QUALITY_MAX_DATAELEMENT = "QUALITY_MAX_DATAELEMENT";
 

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityMaxInitAction.java	2014-05-15 06:51:53 +0000
@@ -21,7 +21,7 @@
  */
 public class QualityMaxInitAction implements Action
 {
-	private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY";
+	private final static String TARIFF_SETTING_AUTHORITY = "MAXSCORE_SETTING_AUTHORITY";
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java'
--- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java	2014-04-26 11:27:06 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/quality/dataentry/QualityScoreInitAction.java	2014-05-15 06:51:53 +0000
@@ -20,7 +20,7 @@
  */
 public class QualityScoreInitAction implements Action
 {
-	private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY";
+	private final static String TARIFF_SETTING_AUTHORITY = "MAXSCORE_SETTING_AUTHORITY";
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------

=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm'
--- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm	2014-05-08 11:03:37 +0000
+++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/loadDataElementsforTariff.vm	2014-05-15 06:51:53 +0000
@@ -110,15 +110,15 @@
 
 function organisationUnitSelected( orgUnits, orgUnitNames )
 {
-		document.getElementById('simpleCombo').style.display = 'block';
-        enable('orgUnit'); 
-		setFieldValue("orgUnit", orgUnitNames[0]);
-		setFieldValue("orgUnitUid", orgUnits[0]);
-		document.getElementById('loadTariffDetails').style.display = 'block';
-		if( $('#dataElementName').val() != '' && $( "#orgUnitGroupId" ).val() != "-1" )
-		{
-			getTariffData();	
-		}
+	document.getElementById('simpleCombo').style.display = 'block';
+    enable('orgUnit'); 
+    setFieldValue("orgUnit", orgUnitNames[0]);
+	setFieldValue("orgUnitUid", orgUnits[0]);
+	document.getElementById('loadTariffDetails').style.display = 'block';
+	if( $('#dataElementName').val() != '' && $( "#orgUnitGroupId" ).val() != "-1" )
+	{
+		getTariffData();	
+	}
 }
 
 selection.setListenerFunction( organisationUnitSelected );