← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7686: local/in merge excelImport and mobile from 2.7 to trunk

 

------------------------------------------------------------
revno: 7686
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-07-24 14:41:33 +0530
message:
  local/in merge excelImport and mobile from 2.7 to trunk
modified:
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetRegistredPatientInformationAction.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 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2012-06-13 06:35:38 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2012-07-24 09:11:33 +0000
@@ -579,8 +579,10 @@
             return SUCCESS;
         }
         
-        Workbook excelImportFile = Workbook.getWorkbook( file );
-       
+        //Workbook excelImportFile = Workbook.getWorkbook( file );
+        
+        Workbook excelImportFile = Workbook.getWorkbook( new File( excelFilePath ) );
+        
         Workbook excelTemplateFile = Workbook.getWorkbook( new File( excelTemplatePath ) );
 
         excelValidator = validateReport( deCodesImportXMLFileName, excelImportFile, excelTemplateFile );
@@ -686,7 +688,9 @@
                 Sheet sheet = excelImportFile.getSheet( sheetNo );
 
                 String cellContent = sheet.getCell( tempColNo, tempRowNo ).getContents();
-
+                
+                System.out.println( tempColNo + " : " + tempRowNo + " : " + cellContent );
+                
                 value = cellContent;
 
                 if ( cellContent.equalsIgnoreCase( "" ) || cellContent == null || cellContent.equalsIgnoreCase( " " ) )
@@ -744,9 +748,21 @@
         excelImportFile.close();
 
         statementManager.destroy();
-
+        
         message = "The report has been imported successfully";
 
+        try
+        {
+        }
+        catch( Exception e )
+        {
+        }
+        finally
+        {
+            if( inputStream != null )
+            inputStream.close();             
+        }
+
         return SUCCESS;
     }
 
@@ -1239,9 +1255,10 @@
 
         finally
         {
-            in.close();
-
-            out.close();
+            if( in != null ) 
+                in.close();
+            if( out != null )                       
+                out.close();
         }
 
         return 1;

=== modified file 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java	2012-05-21 11:48:24 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/portal/action/PortalExcelImportResultAction.java	2012-07-24 09:11:33 +0000
@@ -612,7 +612,7 @@
                         for( ExcelImport_DeCode deCode : deCodeList )
                         {
                             String deCodeExpression = deCode.getExpression();
-							System.out.println( deCodeExpression );
+			    System.out.println( deCodeExpression );
                             if( deCodeExpression != null && !deCodeExpression.trim().equals( "" ) )
                             {
                                 Integer deId = Integer.parseInt( deCodeExpression.split( "\\." )[0] );
@@ -949,7 +949,7 @@
     public Integer getOrgUnitIdByURL( String url )
     {
         url = url.replace("'","\\'");
-		System.out.println(url);
+	System.out.println(url);
         String query = "SELECT organisationunitid FROM organisationunit WHERE url LIKE '"+ url +"'";
         SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query );
         if ( sqlResultSet != null && sqlResultSet.next() )

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetRegistredPatientInformationAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetRegistredPatientInformationAction.java	2012-04-04 11:58:27 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetRegistredPatientInformationAction.java	2012-07-24 09:11:33 +0000
@@ -188,7 +188,7 @@
         this.isSelectedOrg = isSelectedOrg;
     }
     
-
+    private OrganisationUnit organisationUnit;
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -197,7 +197,7 @@
         throws Exception
     {
         //OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
-        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
+        organisationUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
         // ---------------------------------------------------------------------
         // Get all of patients into the selected organisation unit
         // ---------------------------------------------------------------------
@@ -237,6 +237,7 @@
         else
         {
             searchPatientByAttributes( searchingAttributeId, searchText );
+            //searchPatientByNameAndOrgUnit( searchText , organisationUnit );
         }
         
         
@@ -301,11 +302,18 @@
     
     private void searchPatientByAttributes( List<Integer> searchingAttributeId, List<String> searchText )
     {
-        total = patientAttributeValueService.countSearchPatients( searchingAttributeId, searchText );
+        //total = patientAttributeValueService.countSearchPatients( searchingAttributeId, searchText );
+        
+        //OrganisationUnit orgUnit = null;
+        
+        organisationUnit = (isSelectedOrg) ? organisationUnit : null;
+        total = patientService.countSearchPatients( searchText, organisationUnit );
+        //Collection<Patient> getPatients( String searchText, Integer min, Integer max );
+        
         this.paging = createPaging( total );
         
-        patients = patientAttributeValueService.searchPatients( searchingAttributeId, searchText, paging.getStartPos(),
-            paging.getPageSize() );
+        //patients = patientAttributeValueService.searchPatients( searchingAttributeId, searchText, paging.getStartPos(),paging.getPageSize() );
+        patients = patientService.searchPatients( searchText, organisationUnit, paging.getStartPos(), paging.getPageSize() );
         
         /*
         if ( isSelectedOrg )
@@ -344,7 +352,8 @@
             //mapPatientPrograms.put( patient.getId(), getProgramsByPatient( patient ) );            
         }
     }
-
+    
+    
     private String getHierarchyOrgunit( OrganisationUnit orgunit )
     {
         String hierarchyOrgunit = orgunit.getName();
@@ -358,6 +367,7 @@
 
         return hierarchyOrgunit;
     }
+    
 /*    
     private List<Program> getProgramsByPatient( Patient patient )
     {