← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7393: Minor

 

------------------------------------------------------------
revno: 7393
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-25 23:43:59 +0200
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java


--
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 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-06-25 14:27:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-06-25 21:43:59 +0000
@@ -366,52 +366,56 @@
         for ( String searchValue : searchingValues )
         {
             String[] values = searchValue.split( "_" );
-            String prefix = values[0];
-
-            TabularReportColumn column = new TabularReportColumn();
-            column.setPrefix( prefix );
-            column.setIdentifier( values[1] );
-            column.setHidden( Boolean.parseBoolean( values[2] ) );
-            column.setQuery( values.length == 4 ? TextUtils.lower( values[3] ) : null );
-
-            if ( PREFIX_FIXED_ATTRIBUTE.equals( prefix ) )
-            {
-                column.setName( values[1] );
-            }
-            else if ( PREFIX_IDENTIFIER_TYPE.equals( prefix ) )
-            {
-                PatientIdentifierType identifierType = patientIdentifierTypeService.getPatientIdentifierType( column
-                    .getIdentifierAsInt() );
-
-                column.setName( identifierType.getName() );
-            }
-            else if ( PREFIX_PATIENT_ATTRIBUTE.equals( prefix ) )
-            {
-                int objectId = Integer.parseInt( values[1] );
-                PatientAttribute attribute = patientAttributeService.getPatientAttribute( objectId );
-                patientAttributes.add( attribute );
-
-                valueTypes.add( attribute.getValueType() );
-                mapSuggestedValues.put( index, getSuggestedAttributeValues( attribute ) );
-
-                column.setName( attribute.getName() );
-            }
-            else if ( PREFIX_DATA_ELEMENT.equals( prefix ) )
-            {
-                int objectId = Integer.parseInt( values[1] );
-                DataElement dataElement = dataElementService.getDataElement( objectId );
-                dataElements.add( dataElement );
-
-                String valueType = dataElement.getOptionSet() != null ? VALUE_TYPE_OPTION_SET : dataElement.getType();
-                valueTypes.add( valueType );
-                mapSuggestedValues.put( index, getSuggestedDataElementValues( dataElement ) );
-
-                column.setName( dataElement.getName() );
-            }
-
-            columns.add( column );
-
-            index++;
+            
+            if ( values != null && values.length >= 3 )
+            {
+                String prefix = values[0];
+    
+                TabularReportColumn column = new TabularReportColumn();
+                column.setPrefix( prefix );
+                column.setIdentifier( values[1] );
+                column.setHidden( Boolean.parseBoolean( values[2] ) );
+                column.setQuery( values.length == 4 ? TextUtils.lower( values[3] ) : null );
+    
+                if ( PREFIX_FIXED_ATTRIBUTE.equals( prefix ) )
+                {
+                    column.setName( values[1] );
+                }
+                else if ( PREFIX_IDENTIFIER_TYPE.equals( prefix ) )
+                {
+                    PatientIdentifierType identifierType = patientIdentifierTypeService.getPatientIdentifierType( column
+                        .getIdentifierAsInt() );
+    
+                    column.setName( identifierType.getName() );
+                }
+                else if ( PREFIX_PATIENT_ATTRIBUTE.equals( prefix ) )
+                {
+                    int objectId = Integer.parseInt( values[1] );
+                    PatientAttribute attribute = patientAttributeService.getPatientAttribute( objectId );
+                    patientAttributes.add( attribute );
+    
+                    valueTypes.add( attribute.getValueType() );
+                    mapSuggestedValues.put( index, getSuggestedAttributeValues( attribute ) );
+    
+                    column.setName( attribute.getName() );
+                }
+                else if ( PREFIX_DATA_ELEMENT.equals( prefix ) )
+                {
+                    int objectId = Integer.parseInt( values[1] );
+                    DataElement dataElement = dataElementService.getDataElement( objectId );
+                    dataElements.add( dataElement );
+    
+                    String valueType = dataElement.getOptionSet() != null ? VALUE_TYPE_OPTION_SET : dataElement.getType();
+                    valueTypes.add( valueType );
+                    mapSuggestedValues.put( index, getSuggestedDataElementValues( dataElement ) );
+    
+                    column.setName( dataElement.getName() );
+                }
+    
+                columns.add( column );
+    
+                index++;
+            }
         }
 
         return columns;