dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25365
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12566: Fixed bug - Search persons by id function doesn't work properly.
------------------------------------------------------------
revno: 12566
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-11 10:57:57 +0700
message:
Fixed bug - Search persons by id function doesn't work properly.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/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 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2013-10-07 11:19:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2013-10-11 03:57:57 +0000
@@ -204,7 +204,7 @@
else if ( searchTexts.size() > 0 )
{
// selected orgunit
- if ( facilityLB == null || facilityLB.trim().isEmpty() )
+ if ( facilityLB == null || facilityLB.isEmpty() )
{
orgunits.add( organisationUnit );
}
@@ -230,7 +230,7 @@
patients = patientService.searchPatients( searchTexts, orgunits, null, null, statusEnrollment,
paging.getStartPos(), paging.getPageSize() );
- if ( facilityLB != null )
+ if ( facilityLB != null && !facilityLB.isEmpty())
{
for ( Patient patient : patients )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-10-10 05:29:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-10-11 03:57:57 +0000
@@ -225,6 +225,7 @@
if( getFieldValue('programIdAddPatient') != '' ) {
params += "&programId=" + getFieldValue('programIdAddPatient');
params += "&searchTexts=prg_" + getFieldValue('programIdAddPatient');
+ params += '&statusEnrollment=' + getFieldValue('statusEnrollment');
}
var programStageId = jQuery('#programStageAddPatient').val();
@@ -286,7 +287,6 @@
});
params += '&listAll=false';
- params += '&statusEnrollment=' + getFieldValue('statusEnrollment');
params += '&facilityLB=';
if( byId('searchInAllFacility').checked ) {
@@ -2356,14 +2356,17 @@
function searchByIdsOnclick()
{
- var params = "searchText=" + getFieldValue("searchByIds");
+ var params = "searchTexts=iden_" + getFieldValue("searchPatientByIds") + "_" + getFieldValue("orgunitId");
params += "&listAll=false";
+ params += "&facilityLB=";
- if( getFieldValue('programIdAddPatient')=="" ){
+ if( getFieldValue('programIdAddPatient')!="" ){
params += "&programIds=" + getFieldValue('programIdAddPatient');
params += "&searchText=prg_" + getFieldValue('programIdAddPatient');
}
+ hideById( 'listPatientDiv');
+ jQuery( "#loaderDiv" ).show();
$.ajax({
url: 'searchRegistrationPatient.action',
type:"POST",
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-10-09 06:40:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-10-11 03:57:57 +0000
@@ -71,6 +71,7 @@
#set($personDisplayName='true')
#end
#end
+
#if( $personDisplayName=='false' )
<th>$i18n.getString( "full_name" )</th>
#end
@@ -98,70 +99,56 @@
$nr
</td>
- #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
-
- #foreach( $attribute in $patientAttributes )
- #if( $attribute )
- #set ( $key = $patient.id + '-' + $attribute.id )
- <td>
- #if( $attribute.valueType == 'bool')
- $i18n.getString( $mapPatientPatientAttr.get($key) )
+ #foreach( $attribute in $patientAttributes )
+ #if( $attribute )
+ #set ( $key = $patient.id + '-' + $attribute.id )
+ <td>
+ #if( $attribute.valueType == 'bool')
+ $i18n.getString( $mapPatientPatientAttr.get($key) )
+ #else
+ $mapPatientPatientAttr.get($key)
+ #end
+ </td>
+ #end
+ #end
+
+ #set($value="")
+ #foreach( $identifierType in $identifierTypes)
+ #set($value="")
+ #if($identifierType.personDisplayName=='true')
+ <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
+ #foreach( $identifier in $patient.identifiers)
+ #if($!identifier.identifierType.id==$identifierType.id)
+ #set($value=$identifier.identifier)
#else
- $mapPatientPatientAttr.get($key)
+ #set($systemId=$identifier.identifier)
#end
- </td>
- #end
- #end
-
- #set($value="")
- #foreach( $identifierType in $identifierTypes)
- #set($value="")
- #if($identifierType.personDisplayName=='true')
- <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
- #foreach( $identifier in $patient.identifiers)
- #if($!identifier.identifierType.id==$identifierType.id)
- #set($value=$identifier.identifier)
- #else
- #set($systemId=$identifier.identifier)
- #end
- #end
- <a>$encoder.htmlEncode($value)</a>
- </td>
- #end
- #end
-
- #if($value=="")
- #set($value=$!patient.name)
- #end
- #if($value=="")
- #set($value=$systemId)
- #end
- #if($personDisplayName=='false')
- <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
- <a>$encoder.htmlEncode($value)</a>
- </td>
- #end
-
- <td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
-
- <td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
-
- <td>#if($!patient.birthDate) $!patient.getAge() #end</td>
-
- <td>$!patient.phoneNumber</td>
- #else
- #set($value="")
- #foreach( $identifier in $patient.identifiers)
- #if($!identifier.identifierType)
- #else
- #set($value=$identifier.identifier)
- #end
- #end
+ #end
+ <a>$encoder.htmlEncode($value)</a>
+ </td>
+ #end
+ #end
+
+ #if($value=="")
+ #set($value=$!patient.name)
+ #end
+ #if($value=="")
+ #set($value=$systemId)
+ #end
+ #if($personDisplayName=='false')
<td style="cursor:pointer;" onclick="javascript:isDashboard=true;showPatientDashboardForm( '$patient.id' )">
- <a>$value</a>
+ <a>$encoder.htmlEncode($value)</a>
</td>
#end
+ <td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
+
+ <td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
+
+ <td>#if($!patient.birthDate) $!patient.getAge() #end</td>
+
+ <td>$!patient.phoneNumber</td>
+
#if($mapPatientOrgunit.size()!=0)
<td>$!mapPatientOrgunit.get($patient.id)</td>
#end