← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7348: local/in change in patient information report in NRHM report

 

------------------------------------------------------------
revno: 7348
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-06-22 11:06:42 +0530
message:
  local/in change in patient information report in NRHM report
modified:
  local/in/dhis-web-alert/pom.xml
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetPatientReportResultAction.java
  local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/patient.js
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/patientRegistrationList.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-alert/pom.xml'
--- local/in/dhis-web-alert/pom.xml	2012-06-02 08:49:58 +0000
+++ local/in/dhis-web-alert/pom.xml	2012-06-22 05:36:42 +0000
@@ -21,66 +21,80 @@
 		
 		<!-- DHIS -->
 		
+		
 		<dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-api</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-service-core</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-service-patient</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-web-commons</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-web-commons-resources</artifactId>
             <type>war</type>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-support-external</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-support-system</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-in-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-in-service-configuration</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
         <dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-in-service-dataentrystatus</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
 		<dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-in-service-survey</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
 		<dependency>
             <groupId>org.hisp.dhis</groupId>
             <artifactId>dhis-in-service-reports</artifactId>
             <version>${project.version}</version>
         </dependency>
+		
         <dependency>			
             <groupId>org.springframework</groupId>
             <artifactId>spring-context-support</artifactId>
             <version>${spring.version}</version>
         </dependency>
+		
         <dependency>
             <groupId>opensymphony</groupId>
             <artifactId>quartz</artifactId>
@@ -91,28 +105,35 @@
             <groupId>jfree</groupId>
             <artifactId>jfreechart</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>jfree</groupId>
             <artifactId>jfreechart-experimental</artifactId>
             <version>1.0.3</version>
         </dependency>
+		
         <dependency>
             <groupId>jfree</groupId>
             <artifactId>jcommon</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>com.lowagie</groupId>
             <artifactId>itext</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>
+		
         <dependency>
             <groupId>net.sourceforge.jexcelapi</groupId>
             <artifactId>jxl</artifactId>
         </dependency>
+		
 	</dependencies>
+	
 	<properties>
 		<rootDir>../../</rootDir>
 	</properties>

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetPatientReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetPatientReportResultAction.java	2012-04-04 11:58:27 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/GetPatientReportResultAction.java	2012-06-22 05:36:42 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientIdentifier;
 import org.hisp.dhis.patient.PatientIdentifierService;
+import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
@@ -197,6 +198,10 @@
     
     
     private Date executionDate;
+    
+    private String systemIdentifier;
+    
+    private Map<Integer, String> identiferMap;
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -229,6 +234,27 @@
             newdir.mkdirs();
         }
         outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+       
+        PatientIdentifierType idType = null;
+        
+       
+        
+        for ( PatientIdentifier identifier : patient.getIdentifiers() )
+        {
+            idType = identifier.getIdentifierType();
+
+            if ( idType != null )
+            {
+                //identiferMap.put( identifier.getIdentifierType().getId(), identifier.getIdentifier() );
+            }
+            else
+            {
+                systemIdentifier = identifier.getIdentifier();
+            }
+        }
+        
+        
+        
         /*
         select identifier from patientidentifier where patientid = 122748 and patientidentifiertypeid = 1;
 
@@ -430,6 +456,7 @@
                         else
                         {
                             tempStr = patient.getAge();
+                          
                             
                         }
                     }
@@ -451,13 +478,33 @@
                     else if( deCodeString.equalsIgnoreCase("FACILITY") )
                     {
                         tempStr = patient.getOrganisationUnit().getName();
+                        //System.out.println( "FACILITY ----" + tempStr);
                     }
                     
+                    else if( deCodeString.equalsIgnoreCase( "FACILITYP" ) )
+                    {
+                        tempStr = patient.getOrganisationUnit().getParent().getName();
+                        //System.out.println( "FACILITY - P---" + tempStr);
+                    } 
+                    else if( deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
+                    {
+                        tempStr = patient.getOrganisationUnit().getParent().getParent().getName();
+                        //System.out.println( "FACILITY - PP---" + tempStr);
+                    } 
+                    
                     else if( deCodeString.equalsIgnoreCase("PATIENTNAME") )
                     {
                         tempStr = patient.getFullName();
                     }
-                    
+
+                    else if( deCodeString.equalsIgnoreCase("SYSTEMIDENTIFIER") )
+                    {
+                        tempStr = systemIdentifier;
+                    }
+                    else if( deCodeString.equalsIgnoreCase("NA") )
+                    {
+                        tempStr = "";
+                    }
                     
                     
                     else if( sType.equalsIgnoreCase("identifier") )
@@ -562,6 +609,47 @@
                         }
                         
                     }
+                    else if( sType.equalsIgnoreCase("after1stday") )
+                    {
+                        tempStr = programStageDataElementValueMap.get( deCodeString );
+                        
+                        if (  tempStr != null )
+                        {
+                            Date tempDate = format.parseDate( tempStr );
+                            Calendar tempSDate = Calendar.getInstance();
+                            tempSDate.setTime( tempDate );
+                            tempSDate.add(Calendar.DATE, 1);
+                            //tempStr = "" + tempSDate.get(Calendar.YEAR) + "-" + ( tempSDate.get(Calendar.MONTH) + 1) + "-" +tempSDate.get(Calendar.DATE);
+                            tempStr =  simpleDateFormat.format( tempSDate.getTime() );
+                            
+                        }
+                        else
+                        {
+                            tempStr = " ";
+                        }
+                        
+                    }
+                    else if( sType.equalsIgnoreCase("after3rdday") )
+                    {
+                        tempStr = programStageDataElementValueMap.get( deCodeString );
+                        
+                        if (  tempStr != null )
+                        {
+                            Date tempDate = format.parseDate( tempStr );
+                            Calendar tempSDate = Calendar.getInstance();
+                            tempSDate.setTime( tempDate );
+                            tempSDate.add(Calendar.DATE, 3);
+                            //tempStr = "" + tempSDate.get(Calendar.YEAR) + "-" + ( tempSDate.get(Calendar.MONTH) + 1) + "-" +tempSDate.get(Calendar.DATE);
+                            tempStr =  simpleDateFormat.format( tempSDate.getTime() );
+                            
+                        }
+                        else
+                        {
+                            tempStr = " ";
+                        }
+                        
+                    }
+ 
                     else if( sType.equalsIgnoreCase("after7thday") )
                     {
                         tempStr = programStageDataElementValueMap.get( deCodeString );
@@ -582,7 +670,26 @@
                         }
                         
                     }
-                    
+                    else if( sType.equalsIgnoreCase("after14thday") )
+                    {
+                        tempStr = programStageDataElementValueMap.get( deCodeString );
+                        
+                        if (  tempStr != null )
+                        {
+                            Date tempDate = format.parseDate( tempStr );
+                            Calendar tempSDate = Calendar.getInstance();
+                            tempSDate.setTime( tempDate );
+                            tempSDate.add(Calendar.DATE, 14);
+                            //tempStr = "" + tempSDate.get(Calendar.YEAR) + "-" + ( tempSDate.get(Calendar.MONTH) + 1) + "-" +tempSDate.get(Calendar.DATE);
+                            tempStr =  simpleDateFormat.format( tempSDate.getTime() );
+                            
+                        }
+                        else
+                        {
+                            tempStr = " ";
+                        }
+                        
+                    }
                     else if( sType.equalsIgnoreCase("after15thday") )
                     {
                         tempStr = programStageDataElementValueMap.get( deCodeString );
@@ -747,7 +854,7 @@
                     else
                     {
                     
-                        if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) || deCodeString.equalsIgnoreCase( "FACILITYPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
+                        if ( deCodeString.equalsIgnoreCase( "PERIOD-FROM" ) || deCodeString.equalsIgnoreCase( "PERIOD-TO" ) || deCodeString.equalsIgnoreCase( "FACILITYPPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPP" ) )
                         {
                             
                         } 

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties'
--- local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties	2012-04-16 08:47:07 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties	2012-06-22 05:36:42 +0000
@@ -333,4 +333,6 @@
 no_xls_xml = There is no xml and xls template for selected program
 in_selected_orgU = In Selected Organisation Unit
 available_delist = Available dataelements
-selected_delist = Selected dataelements
\ No newline at end of file
+selected_delist = Selected dataelements
+discharge = Discharge
+followup = Followup
\ No newline at end of file

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/patient.js'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/patient.js	2012-04-04 11:58:27 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/patient.js	2012-06-22 05:36:42 +0000
@@ -218,3 +218,37 @@
 	//alert( event.target.href );
 	
 }
+
+
+function generatePatientFollowUpReport( event, patientId )
+{
+	
+	var tempPatientId = "";
+	var tempProgramId = "";
+	
+	var programDropDown = document.getElementById("programId_"+patientId);
+	var selProgramId = programDropDown.options[ programDropDown.selectedIndex ].value;
+	
+	var excelTemplateName = "SNCUFollowUpSheet.xls";
+	var xmlTemplateName = "SNCUFollowUpSheet.xml";
+	
+	tempPatientId = patientId;
+	tempProgramId = selProgramId;
+
+
+
+    //event.target.href = "generatePatientReport.action?patientId=" + patientId + "&selProgramId=" + selProgramId + "&excelTemplateName=" + excelTemplateName + "&xmlTemplateName=" + xmlTemplateName;
+	
+    //alert( tempPatientId + "----" + tempProgramId + "----" + excelTemplateName + "----" + xmlTemplateName  );
+	
+    document.getElementById("patientId").value = tempPatientId;
+    document.getElementById("selProgramId").value = tempProgramId;
+    document.getElementById("excelTemplateName").value = excelTemplateName;
+    document.getElementById("xmlTemplateName").value = xmlTemplateName;
+    
+    document.patientForm.action = "generatePatientReport.action";
+    document.patientForm.submit();
+	    
+   
+	
+}

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/patientRegistrationList.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/patientRegistrationList.vm	2012-04-30 11:56:21 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/patientRegistrationList.vm	2012-06-22 05:36:42 +0000
@@ -90,8 +90,9 @@
 				##if($mapPatientPrograms.size()!=0)
 				<th class="{sorter: false}">$i18n.getString( "enrolled_in_program" )</th>
 				##end
-				<th class="{sorter: false}">&nbsp;</th>
-				<th class="{sorter: false}">$i18n.getString( "operations" )</th>
+				<th colspan="3" align="center" class="{sorter: false}">$i18n.getString( "operations" )</th>
+				<!--<th class="{sorter: false}">&nbsp;</th>
+				<th class="{sorter: false}">$i18n.getString( "operations" )</th>-->
 			  </tr>
           </thead>
 		  
@@ -148,13 +149,15 @@
 				
 				#if( $patient.getPrograms().size() !=0 )
 				  <td>
-					<input type="button" id='generateButton' value="$i18n.getString( 'discharge' )" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "discharge" )'>
+					<input type="button" id='generateButton' value="$i18n.getString( 'discharge' )" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "discharge" )'></td>
+					<td><input type="button" id='generateButton' value="$i18n.getString( 'followup' )" onclick="javascript:generatePatientFollowUpReport( event, '$patient.id' )" title='$i18n.getString( "followup" )'>
 				   <!-- <a  href="#" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "generate" )' target="_blank">$i18n.getString( "generate" )</a>-->
 				  <!--<a id="exportToExcel" name="exportToExcel" href="#" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "generate" )' target="_blank"><img src="images/GenerateButton.gif" alt='$i18n.getString( "generate" )'></a>-->
 				  </td>
 				#else
 				  <td>	
-				  <input type="button" id='generateButton' value="$i18n.getString( 'discharge' )" onclick="javascript:generatePatientReport( event, '$patient.id' )" disabled="disabled" title='$i18n.getString( "discharge" )'>
+				  <input type="button" id='generateButton' value="$i18n.getString( 'discharge' )" onclick="javascript:generatePatientReport( event, '$patient.id' )" disabled="disabled" title='$i18n.getString( "discharge" )'></td>
+				  <td><input type="button" id='generateButton' value="$i18n.getString( 'followup' )" onclick="javascript:generatePatientFollowUpReport( event, '$patient.id' )" disabled="disabled" title='$i18n.getString( "followup" )'>
 				  <!--<a  href="#" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "generate" )' disabled="disabled" target="_blank">$i18n.getString( "generate" )</a>-->
 				  <!--<a id="exportToExcel" name="exportToExcel" href="#" onclick="javascript:generatePatientReport( event, '$patient.id' )" title='$i18n.getString( "generate" )' target="_blank" style='display:none'><img src="images/GenerateButton.gif" alt='$i18n.getString( "generate" )'></a>-->	  
 				  </td>