dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11816
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3467: Improve performance in Beneficiary module.
------------------------------------------------------------
revno: 3467
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-04-26 09:06:38 +0700
message:
Improve performance in Beneficiary module.
added:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/content.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPatientAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patient.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentSelectForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.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 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2011-01-21 04:08:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2011-04-26 02:06:38 +0000
@@ -125,6 +125,7 @@
{
final int prime = 31;
int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((birthDate == null) ? 0 : birthDate.hashCode());
result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2011-04-12 10:59:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2011-04-26 02:06:38 +0000
@@ -125,5 +125,9 @@
width: 800,
height: 400
});
+<<<<<<< TREE
+
+=======
}
+>>>>>>> MERGE-SOURCE
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/content.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/content.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/content.vm 2011-04-26 02:06:38 +0000
@@ -0,0 +1,11 @@
+#foreach ( $style in $stylesheets )
+ <link type="text/css" rel="stylesheet" href="$style">
+#end
+
+<div class="page">
+ #if( !$page )
+ <p>$i18n.getString( "no_page_specified" )</p>
+ #else
+ #parse( $page )
+ #end
+</div>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm 2011-04-03 10:25:42 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm 2011-04-26 02:06:38 +0000
@@ -33,8 +33,8 @@
<div class="paging">
#if ($currentPage > 1)
#set ( $prev = $currentPage - 1 )
- <a href="${baseLink}currentPage=1&pageSize=${pageSize}" class="first" title="First">««</a>
- <a href="${baseLink}currentPage=${prev}&pageSize=${pageSize}" class="prev" title="Previous">«</a>
+ <a href="javascript:ajaxPaging( 1,${pageSize} );" class="first" title="First">««</a>
+ <a href="javascript:ajaxPaging( ${prev},${pageSize} );" class="prev" title="Previous">«</a>
#else
<span class="first" title="First">««</span>
<span class="prev" title="Previous">«</span>
@@ -47,7 +47,7 @@
<span class="seperator">|</span>
#end
#if( $p != $currentPage )
- <a href="${baseLink}currentPage=${p}&pageSize=${pageSize}" class="page" title="Page $p">$p</a>
+ <a href="javascript:ajaxPaging( ${p},${pageSize} );" class="page" title="Page $p">$p</a>
#else
<span class="page" title="Page $p">$p</span>
#end
@@ -56,8 +56,8 @@
#if ( $currentPage < $numberOfPages )
#set ( $next = $currentPage + 1 )
- <a href="${baseLink}currentPage=${next}&pageSize=${pageSize}" class="next" title="Next">»</a>
- <a href="${baseLink}currentPage=${numberOfPages}&pageSize=${pageSize}" class="last" title="Last">»»</a>
+ <a href="javascript:ajaxPaging(${next},${pageSize} );" class="next" title="Next">»</a>
+ <a href="javascript:ajaxPaging(${numberOfPages},${pageSize} );" class="last" title="Last">»»</a>
#else
<span class="next" title="Next">» </span>
<span class="last" title="Last">»»</span>
@@ -68,4 +68,24 @@
</tr>
</table>
#end
-</div>
\ No newline at end of file
+</div>
+
+<script>
+
+ var isAjax;
+
+ function ajaxPaging( currentPage, pageSize )
+ {
+ if( isAjax == undefined )
+ {
+ window.location.href = '${baseLink}currentPage=' + currentPage + '&pageSize=' + pageSize;
+ }
+ else
+ {
+ showLoader();
+ var url = '${baseLink}currentPage=' + currentPage + '&pageSize=' + pageSize;
+ $( '#contentDiv' ).load(url);
+ hideLoader();
+ }
+ }
+</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPatientAction.java 2011-03-31 01:42:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPatientAction.java 2011-04-26 02:06:38 +0000
@@ -44,8 +44,6 @@
import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.relationship.Relationship;
-import org.hisp.dhis.relationship.RelationshipService;
/**
* @author Abyot Asalefew Gizaw
@@ -68,8 +66,6 @@
private PatientAttributeValueService patientAttributeValueService;
- private RelationshipService relationshipService;
-
private ProgramService programService;
// -------------------------------------------------------------------------
@@ -92,22 +88,16 @@
private Integer total;
- private Collection<PatientAttribute> patientAttributes;
-
private Collection<Patient> patients = new ArrayList<Patient>();
- private Map<Integer, Collection<Relationship>> mapRelationShip = new HashMap<Integer, Collection<Relationship>>();
-
- private Map<Patient, String> mapPatientPatientAttr = new HashMap<Patient, String>();
-
- private Map<Patient, String> mapPatientOrgunit = new HashMap<Patient, String>();
+ private Map<Integer, String> mapPatientPatientAttr = new HashMap<Integer, String>();
+
+ private Map<Integer, String> mapPatientOrgunit = new HashMap<Integer, String>();
private PatientAttribute sortingPatientAttribute = null;
private PatientAttribute searchingPatientAttribute = null;
- private Collection<Program> programs;
-
private Program program;
// -------------------------------------------------------------------------
@@ -139,16 +129,11 @@
this.program = program;
}
- public Map<Patient, String> getMapPatientOrgunit()
+ public Map<Integer, String> getMapPatientOrgunit()
{
return mapPatientOrgunit;
}
- public Collection<Program> getPrograms()
- {
- return programs;
- }
-
public void setPatientAttributeService( PatientAttributeService patientAttributeService )
{
this.patientAttributeService = patientAttributeService;
@@ -159,11 +144,6 @@
this.patientAttributeValueService = patientAttributeValueService;
}
- public void setRelationshipService( RelationshipService relationshipService )
- {
- this.relationshipService = relationshipService;
- }
-
public void setSearchText( String searchText )
{
this.searchText = searchText;
@@ -194,11 +174,6 @@
this.searchingAttributeId = searchingAttributeId;
}
- public Collection<PatientAttribute> getPatientAttributes()
- {
- return patientAttributes;
- }
-
public Collection<Patient> getPatients()
{
return patients;
@@ -209,11 +184,6 @@
return total;
}
- public Map<Integer, Collection<Relationship>> getMapRelationShip()
- {
- return mapRelationShip;
- }
-
public Integer getSortPatientAttributeId()
{
return sortPatientAttributeId;
@@ -229,12 +199,12 @@
this.selectedStateManager = selectedStateManager;
}
- public Map<Patient, String> getMapPatientPatientAttr()
+ public Map<Integer, String> getMapPatientPatientAttr()
{
return mapPatientPatientAttr;
}
- public void setMapPatientPatientAttr( Map<Patient, String> mapPatientPatientAttr )
+ public void setMapPatientPatientAttr( Map<Integer, String> mapPatientPatientAttr )
{
this.mapPatientPatientAttr = mapPatientPatientAttr;
}
@@ -247,14 +217,7 @@
throws Exception
{
OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
-
- // ---------------------------------------------------------------------
- // Get all of Patient-Attributes
- // and programs by selected organisation unit
- // ---------------------------------------------------------------------
-
- patientAttributes = patientAttributeService.getAllPatientAttributes();
- programs = programService.getPrograms( organisationUnit );
+
getParamsToSearch();
// ---------------------------------------------------------------------
@@ -435,15 +398,13 @@
{
for ( Patient patient : patients )
{
- mapRelationShip.put( patient.getId(), relationshipService.getRelationshipsForPatient( patient ) );
-
if ( sortingPatientAttribute != null )
{
PatientAttributeValue attributeValue = patientAttributeValueService.getPatientAttributeValue(
patient, sortingPatientAttribute );
String value = (attributeValue == null) ? "" : attributeValue.getValue();
- mapPatientPatientAttr.put( patient, value );
+ mapPatientPatientAttr.put( patient.getId(), value );
}
}
}
@@ -463,7 +424,7 @@
{
for ( Patient patient : patients )
{
- mapRelationShip.put( patient.getId(), relationshipService.getRelationshipsForPatient( patient ) );
+// mapRelationShip.put( patient.getId(), relationshipService.getRelationshipsForPatient( patient ) );
if ( sortingPatientAttribute != null )
{
@@ -471,7 +432,7 @@
patient, sortingPatientAttribute );
String value = (attributeValue == null) ? "" : attributeValue.getValue();
- mapPatientPatientAttr.put( patient, value );
+ mapPatientPatientAttr.put( patient.getId(), value );
}
}
}
@@ -495,13 +456,11 @@
for ( Patient patient : patients )
{
- mapRelationShip.put( patient.getId(), relationshipService.getRelationshipsForPatient( patient ) );
-
// -------------------------------------------------------------
// Get hierarchy organisation unit
// -------------------------------------------------------------
- mapPatientOrgunit.put( patient, getHierarchyOrgunit( patient.getOrganisationUnit() ) );
+ mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
// -------------------------------------------------------------
// Sort patients
@@ -513,7 +472,7 @@
patient, sortingPatientAttribute );
String value = (attributeValue == null) ? "" : attributeValue.getValue();
- mapPatientPatientAttr.put( patient, value );
+ mapPatientPatientAttr.put( patient.getId(), value );
}
}
}
@@ -539,7 +498,7 @@
// Get hierarchy organisation unit
// -------------------------------------------------------------
- mapPatientOrgunit.put( patient, getHierarchyOrgunit( patient.getOrganisationUnit() ) );
+ mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
// -------------------------------------------------------------
// Sort patients
@@ -551,7 +510,7 @@
patient, sortingPatientAttribute );
String value = (attributeValue == null) ? "" : attributeValue.getValue();
- mapPatientPatientAttr.put( patient, value );
+ mapPatientPatientAttr.put( patient.getId(), value );
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-04-22 18:38:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-04-26 02:06:38 +0000
@@ -395,8 +395,6 @@
ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
<property name="patientAttributeService"
ref="org.hisp.dhis.patient.PatientAttributeService" />
- <property name="relationshipService"
- ref="org.hisp.dhis.relationship.RelationshipService" />
<property name="programService"
ref="org.hisp.dhis.program.ProgramService" />
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-04-07 03:04:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-04-26 02:06:38 +0000
@@ -458,3 +458,4 @@
list_patients_by_program = List Beneficiaries by Program
manage_program_unenrollment = Manage Program Un-Enrollment
patient_registration = Beneficiary Registration
+fill_fields_in_programstage_dataelement_validation = Fill all fields in validation form.
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-04-05 07:24:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-04-26 02:06:38 +0000
@@ -354,18 +354,13 @@
/dhis-web-maintenance-patient/responseInput.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
-
+
<action name="searchPatient"
class="org.hisp.dhis.patient.action.patient.SearchPatientAction">
- <interceptor-ref name="organisationUnitTreeStack" />
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-maintenance-patient/listPatient.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenuWithTree.vm</param>
- <param name="menuTreeHeight">285</param>
- <param name="javascripts">
- ../dhis-web-commons/ouwt/ouwt.js,javascript/patient.js</param>
<param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
- </action>
+ </action>
<action name="listAllPatients"
class="org.hisp.dhis.patient.action.patient.SearchPatientAction">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm 2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm 2011-04-26 02:06:38 +0000
@@ -11,7 +11,7 @@
});
</script>
<div>
- <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='patient.action'" style="width:10em">
</div>
<h3>$i18n.getString( "adding_new_relationship_for" )</h3>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2011-02-24 06:02:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2011-04-26 02:06:38 +0000
@@ -275,8 +275,7 @@
if ( type == 'success' )
{
- var form = document.getElementById( 'searchPatientForm' );
- form.submit();
+ searchPatients();
}
else if ( type == 'error' )
{
@@ -284,7 +283,7 @@
}
else if ( type == 'input' )
{
- setHeaderMessage( message );
+ $('#contentDiv').html( "<i style='color:red'>" + message + "</i>" );
}
}
@@ -705,4 +704,37 @@
function removeEnrollment(){
byId('programEnrollmentForm').action = "removeEnrollment.action";
byId('programEnrollmentForm').submit();
-}
\ No newline at end of file
+}
+
+isAjax = true;
+function loadAllPatients()
+{
+ showLoader();
+ var url = 'searchPatient.action?listAll=true';
+ $('#contentDiv').load(url);
+ hideLoader();
+}
+
+function searchPatients()
+{
+ showLoader();
+
+ var url = 'searchPatient.action?';
+ url += 'searchText=' + getFieldValue('searchText');
+ url += '&searchingAttributeId=' + getFieldValue('searchingAttributeId');
+ url += '&sortPatientAttributeId=' + getFieldValue('sortPatientAttributeId');
+ url += '&programId=' + getFieldValue('programId');
+ $('#contentDiv').load(url);
+
+ hideLoader();
+}
+
+function searchPatientsbyBackBtn()
+{
+ showLoader();
+
+ var url = 'searchPatient.action';
+ $('#contentDiv').load(url);
+
+ hideLoader();
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm 2011-02-24 06:02:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm 2011-04-26 02:06:38 +0000
@@ -1,8 +1,23 @@
-#parse( "/dhis-web-maintenance-patient/patient.vm" )
-
-<style>
-tr.relationship-row{background-color: #BFFFC2; display : none}
-</style>
+<script type="text/javascript">
+
+ jQuery(document).ready(function(){
+ tableSorter( 'patientList' );
+ });
+
+ var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
+ var i18n_adding_patient_failed = '$encoder.jsEscape( $i18n.getString( "adding_patient_failed" ), "'")';
+ var i18n_updating_patient_failed = '$encoder.jsEscape( $i18n.getString( "updating_patient_failed" ), "'")';
+ var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
+
+ var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
+ var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
+ var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
+ var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
+ var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
+ var i18n_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ), "'")';
+
+
+</script>
<table>
<tr>
@@ -30,14 +45,14 @@
<table class="mainPageTable">
<tr>
<td colspan="14" style="text-align:right">
- <input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='patient.action'" style="width:10em; align:right;">
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patient.action'" style="width:10em; align:right;">
</td>
</tr>
<tr>
<td>
- <table class="listTable" id="listTable" width='100%'>
- <col/>
+ <table class="listTable" id="patientList" width='100%'>
+ <col width="30"/>
#if($mapPatientPatientAttr.size()!=0)
<col/>
#end
@@ -54,7 +69,7 @@
<thead>
<tr>
- <th class="{sorter: false}">#</th>
+ <th>#</th>
#if($mapPatientPatientAttr.size()!=0)
<th id="patientAttributeName"></th>
<script>
@@ -67,7 +82,7 @@
<th>$i18n.getString( "last_name" )</th>
<th>$i18n.getString( "gender" )</th>
<th>$i18n.getString( "date_of_birth" )</th>
- <th>$i18n.getString( "age" )</th>
+ <th class="{sorter: false}">$i18n.getString( "age" )</th>
#if($mapPatientOrgunit.size()!=0)
<th>$i18n.getString( "hierachy_orgunit" )</th>
#end
@@ -76,41 +91,37 @@
</thead>
<tbody id="list">
-
+ #set( $mark = false )
#foreach( $patient in $patients )
- <tr id="tr${patient.id}">
+ <tr id="tr${patient.id}" #alternate( $mark )>
+
<td>
- #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
- $nr
+ #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
+ $nr
</td>
+
#if($!mapPatientPatientAttr.size()!=0)
<td>
- $!mapPatientPatientAttr.get($patient)
+ $!mapPatientPatientAttr.get( $patient.id )
</td>
#end
- <td>
- $!patient.firstName
- </td>
- <td>
- $!patient.middleName
- </td>
- <td>
- $!patient.lastName
- </td>
- <td>
- $!patient.gender
- </td>
- <td>
- $format.formatDate( $!patient.birthDate)
- </td>
- <td>
- $!patient.getAge()
- </td>
+ <td>$!patient.firstName</td>
+
+ <td>$!patient.middleName</td>
+
+ <td>$!patient.lastName</td>
+
+ <td>$!patient.gender</td>
+
+ <td>$format.formatDate( $!patient.birthDate)</td>
+
+ <td>$!patient.getAge()</td>
+
#if($mapPatientOrgunit.size()!=0)
- <td>
- $!mapPatientOrgunit.get($patient)
- </td>
+
+ <td>$!mapPatientOrgunit.get($patient.id)</td>
+
#end
<td style="text-align:center">
@@ -124,77 +135,7 @@
</td>
</tr>
- #set( $relationships = $mapRelationShip.get($patient.id))
- #foreach( $relationship in $relationships )
- <tr class="relationship-row listrow" id="tr${patient.id}">
- #set( $partnerId = false )
- #if( $relationship.patientA.id == $patient.id )
- #set( $partnerId = $relationship.patientB.id )
- #set ( $partner = $relationship.patientB )
- <td>
- $encoder.htmlEncode( $relationship.relationshipType.BIsToA )
- </td>
- #elseif($relationship.patientB.id == $patient.id )
- #set( $partnerId = $relationship.patientA.id )
- #set ( $partner = $relationship.patientA )
- <td>
- $encoder.htmlEncode( $relationship.relationshipType.AIsToB )
- </td>
- #end
- <td>
- $encoder.htmlEncode( $partner.firstName )
- </td>
- <td>
- $encoder.htmlEncode( $partner.middleName )
- </td>
- <td>
- $encoder.htmlEncode( $partner.lastName )
- </td>
- <td>
- $encoder.htmlEncode( $partner.gender )
- </td>
-
- <td>
- $format.formatDate( $partner.birthDate )
- </td>
-
- <td >
- $encoder.htmlEncode( $partner.getAge() )
- </td>
-
- <td style="text-align:center">
- <a href="showProgramEnrollmentForm.action?id=$partner.id" title='$i18n.getString( "manage_program_enrollment" )'><img src="../images/enroll.png" alt='$i18n.getString( "manage_program_enrollment" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="showProgramUnEnrollmentForm.action?patientId=$patient.id" title='$i18n.getString( "manage_program_unenrollment" )'><img src="../images/unenroll.png" alt='$i18n.getString( "manage_program_unenrollment" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="showUpdatePatientForm.action?id=$patient.id" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="showUpdatePatientAttributeValueForm.action?id=$patient.id" title='$i18n.getString( "edit_attribute_values" )'><img src="../images/attribute.png" alt='$i18n.getString( "edit_attribute_values" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="showRelationshipList.action?id=$patient.id" title='$i18n.getString( "manage_relationship" )'><img src="../images/relationship.png" alt='$i18n.getString( "manage_relationship" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="showAddRelationshipPatient.action?id=$patient.id" title='$i18n.getString( "add_dependent" )'><img src="../images/add.png" alt='$i18n.getString( "add_dependent" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="javascript:removePatient( '$partner.id', '$encoder.jsEncode( $partner.getFullName() )' )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
- </td>
-
- <td style="text-align:center">
- <a href="javascript:showPatientDetails( $partner.id )" title='$i18n.getString( "show_details" )'><img src="../images/information.png" alt='$i18n.getString( "show_details" )'></a>
- </td>
- </tr>
- #end
+ #set( $mark = !$mark)
#end
</tbody>
@@ -221,23 +162,3 @@
<p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
<p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
</div>
-
-<script type="text/javascript">
-
- var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
- var i18n_adding_patient_failed = '$encoder.jsEscape( $i18n.getString( "adding_patient_failed" ), "'")';
- var i18n_updating_patient_failed = '$encoder.jsEscape( $i18n.getString( "updating_patient_failed" ), "'")';
- var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
-
- var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
- var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
- var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
- var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
- var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
- var i18n_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ), "'")';
-
- jQuery(document).ready(function(){
- tableSorter( 'listTable' );
- });
-
-</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patient.vm 2011-02-24 06:02:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patient.vm 2011-04-26 02:06:38 +0000
@@ -1,4 +1,3 @@
-
<h3>$i18n.getString( "patient_management" )</h3>
<table>
@@ -6,14 +5,12 @@
<td><label>$i18n.getString( "registering_unit" )</label></td>
<td><input type="text" readonly="readonly" #if( $organisationUnit ) value="$encoder.htmlEncode( $organisationUnit.name )" #else value="[$i18n.getString( "please_select_village" )]" #end style="min-width:22em"></td>
<td> </td>
- <td><input type="button" value="$i18n.getString( "list_all_patients" )" onclick="window.location.href='searchPatient.action?listAll=true'"></td>
+ <td><input type="button" value="$i18n.getString( "list_all_patients" )" onclick="loadAllPatients();"></td>
</tr>
</table>
<hr style="clear:both">
-<form id="searchPatientForm" action="searchPatient.action" method="post" onsubmit="return validateSearchPatient()">
-
<table>
<tr>
<td>
@@ -37,9 +34,9 @@
</select>
</td>
- <td><input type="submit" value="$i18n.getString( "search" )"</td>
+ <td><input type="button" value='$i18n.getString( "search" )' onclick='searchPatients();'></td>
<td> </td>
- <td><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientForm.action'"></td>
+ <td><input type="button" value='$i18n.getString( "add_new" )' onclick="window.location.href='showAddPatientForm.action'"></td>
</tr>
@@ -61,20 +58,14 @@
<p></p>
<p></p>
-</form>
-
-<script type="text/javascript">
+#parse( "dhis-web-commons/loader/loader.vm" )
+
+<div id='contentDiv'></div>
+
+<script type="text/javascript">
+
var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
- searchingAttributeOnChange();
-
- function selectPatientAttribute()
- {
-
- var patientAttributeLB = document.getElementById('patientAttributeId');
- var patientAttributeId = patientAttributeLB.options[patientAttributeLB.selectedIndex].value;
-
- window.location.href='listAllPatients.action?sortPatientAttributeId='+patientAttributeId;
- }
+ searchPatientsbyBackBtn();
</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentSelectForm.vm 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentSelectForm.vm 2011-04-26 02:06:38 +0000
@@ -1,5 +1,5 @@
<div>
- <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='patient.action'" style="width:10em">
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm 2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm 2011-04-26 02:06:38 +0000
@@ -23,7 +23,7 @@
</script>
<div>
- <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='patient.action'" style="width:10em">
</div>
<h3>$i18n.getString( "program_unenrollment" )</h3>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm 2010-09-27 10:55:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm 2011-04-26 02:06:38 +0000
@@ -1,5 +1,5 @@
<div>
- <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='patient.action'" style="width:10em">
</div>
<h3>$i18n.getString( "relationship_management" )</h3>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm 2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm 2011-04-26 02:06:38 +0000
@@ -1,5 +1,5 @@
<div>
- <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='patient.action'" style="width:10em">
</div>