← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7571: Remove search patients by name function in Add new patient form.

 

------------------------------------------------------------
revno: 7571
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-07-11 11:18:49 +0700
message:
  Remove search patients by name function in Add new patient form.
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientsByNameAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/resultSearchPatients.vm
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.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
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientsByNameAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientsByNameAction.java	2012-07-10 07:16:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientsByNameAction.java	1970-01-01 00:00:00 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.caseentry.action.patient;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
-
-/**
- * @author Chau Thu Tran
- * @version $ID : GetPatientsByNameAction.java Dec 23, 2010 9:14:34 AM $
- */
-public class GetPatientsByNameAction
-    extends ActionPagingSupport<Patient>
-{
-    // -------------------------------------------------------------------------
-    // Dependency
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private String fullName;
-
-    private List<Patient> patients;
-
-    private Integer total;
-
-    // -------------------------------------------------------------------------
-    // Getter && Setter
-    // -------------------------------------------------------------------------
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    public void setFullName( String fullName )
-    {
-        this.fullName = fullName;
-    }
-
-    public List<Patient> getPatients()
-    {
-        return patients;
-    }
-
-    public Integer getTotal()
-    {
-        return total;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-    {
-        fullName = fullName.trim();
-        
-        total = patientService.countGetPatientsByName( fullName );
-        this.paging = createPaging( total );
-
-        patients = new ArrayList<Patient>( patientService.getPatientsByNames( fullName, paging.getStartPos(), paging
-            .getPageSize() ) );
-
-        return SUCCESS;
-    }
-
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-07-10 06:06:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-07-11 04:18:49 +0000
@@ -577,12 +577,6 @@
 			ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
 	</bean>
 
-	<bean id="org.hisp.dhis.caseentry.action.patient.GetPatientsByNameAction"
-		class="org.hisp.dhis.caseentry.action.patient.GetPatientsByNameAction"
-		scope="prototype">
-		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-	</bean>
-
 	<bean id="org.hisp.dhis.caseentry.action.patient.GetPatientHistoryAction"
 		class="org.hisp.dhis.caseentry.action.patient.GetPatientHistoryAction"
 		scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-07-09 03:38:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-07-11 04:18:49 +0000
@@ -503,12 +503,6 @@
 			</result>
 			<param name="requiredAuthorities">F_PATIENT_ADD</param>
 		</action>
-
-		<action name="getPatientsByName"
-			class="org.hisp.dhis.caseentry.action.patient.GetPatientsByNameAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/resultSearchPatients.vm</param>
-		</action>
  
    		<action name="getPatientHistory"
 			class="org.hisp.dhis.caseentry.action.patient.GetPatientHistoryAction">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-07-05 09:52:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-07-11 04:18:49 +0000
@@ -675,10 +675,6 @@
 
 function addEventForPatientForm( divname )
 {
-	jQuery("#" + divname + " [id=searchPatientByNameBtn]").click(function() {
-		getPatientsByName( divname );
-	});
-	
 	jQuery("#" + divname + " [id=checkDuplicateBtn]").click(function() {
 		checkDuplicate( divname );
 	});

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2012-06-27 08:21:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2012-07-11 04:18:49 +0000
@@ -32,10 +32,6 @@
 
 function addEventForPatientForm( divname )
 {
-	jQuery("#" + divname + " [id=searchPatientByNameBtn]").click(function() {
-		getPatientsByName( divname );
-	});
-	
 	jQuery("#" + divname + " [id=checkDuplicateBtn]").click(function() {
 		checkDuplicate( divname );
 	});

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-07-05 07:00:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-07-11 04:18:49 +0000
@@ -24,7 +24,6 @@
 	<td class='text-column'><label for="fullName">$i18n.getString( "full_name" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 	<td class="input-column">
 		<input type="text" id="fullName" name="fullName" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"/>
-		<img src='../images/search.png' id="searchPatientByNameBtn" name="searchPatientByNameBtn"/>
 	</td>
 </tr>
 	
@@ -48,8 +47,8 @@
 			<option value="D" >$i18n.getString( "declared" )</option>
 			<option value="V" >$i18n.getString( "verified" )</option>
 		</select>
-		<input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:150px" />
-		<input type="text" id="birthDate" name="birthDate" style='width:150px;display:none;' />
+		<input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:156px" />
+		<input type="text" id="birthDate" name="birthDate" style='width:156px;display:none;' />
 		<input id="memberValidator" class="hidden {validate:{required:true}}"/>
 	</td>
 </tr>

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/resultSearchPatients.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/resultSearchPatients.vm	2011-12-27 06:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/resultSearchPatients.vm	1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
-<span class="bold">$i18n.getString( "total_result" ): $!total $i18n.getString('patients')</span>
-<p></p>
-<table width='100%' id='searchTable' name='searchTable'>
-#if($!patients)
-	<tr>
-		<td></td>
-		<td colspan='4'>&nbsp;</td>
-		<td></td>
-	</tr>
-	
-	<thead><tr #alternate( true )>
-		<th>#</th>
-		<th>$i18n.getString('full_name')</th>
-		<th>$i18n.getString( "age" )</th>
-		<th>$i18n.getString( "gender" )</th>
-		<th>$i18n.getString( "dob_type" )</th>
-		<th>$i18n.getString( "date_of_birth" )</th>
-		<th>$i18n.getString( "registered_by_orgunit" )</th>
-	</tr></thead>
-	<tbody>
-		#set($mark = false)
-		#foreach( $patient  in $patients )
-			<tr id="tr${patient.id}" #alternate($mark) onclick='showUpdatePatientForm($patient.id)' style="cursor:pointer" title="$i18n.getString('update_this_patient')">
-				<td>
-					#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
-					$nr
-				</td>
-				<td>$!patient.getFullName()</td>
-				<td>$!patient.getAge()</td>
-				<td>$i18n.getString( $!patient.gender )</td>
-				<td>$!patient.dobType</td>
-				<td>$format.formatDate($!patient.birthDate)</td>
-				<td>$!patient.organisationUnit.name</td>
-			</tr>
-		#set($mark = !$mark)
-		#end
-	</tbody>
-	 <tr>
-  	<td colspan="7">
-		<p></p>
-  		<div class="paging-container">
-				#parse( "/dhis-web-commons/paging/paging.vm" )
-		</div>
-	</td>
-  	<td></td>
-  </tr>
-#else
-	<tr>
-		<td colspan='6' class="bold">i18n_no_patients_found</td>
-	</tr>
-#end
-</table>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2011-12-27 06:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2012-07-11 04:18:49 +0000
@@ -3,7 +3,6 @@
 		
 		jQuery("#tabs").tabs();
 		hideById('addRepresentativeForm [id=underAgeDiv]');
-		hideById('addRepresentativeForm [id=searchPatientByNameBtn]');
 		addEventForPatientForm('addRepresentativeForm');
 		
 		jQuery("#searchForm").validate({

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-07-05 06:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-07-11 04:18:49 +0000
@@ -99,8 +99,8 @@
 				<option value="D" #if($patient.dobType=='D') selected #end >$i18n.getString( "declared" )</option>
 				<option value="V" #if($patient.dobType=='V') selected #end >$i18n.getString( "verified" )</option>
 			</select>
-			<input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:150px;' />
-			<input type="text" id="age" name="age" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:150px;' />
+			<input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:156px;' />
+			<input type="text" id="age" name="age" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:156px;' />
 		</td>
 	</tr>