=== 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' ) $i18n.getString( "full_name" ) #end @@ -98,70 +99,56 @@ $nr - #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) ) - - #foreach( $attribute in $patientAttributes ) - #if( $attribute ) - #set ( $key = $patient.id + '-' + $attribute.id ) - - #if( $attribute.valueType == 'bool') - $i18n.getString( $mapPatientPatientAttr.get($key) ) + #foreach( $attribute in $patientAttributes ) + #if( $attribute ) + #set ( $key = $patient.id + '-' + $attribute.id ) + + #if( $attribute.valueType == 'bool') + $i18n.getString( $mapPatientPatientAttr.get($key) ) + #else + $mapPatientPatientAttr.get($key) + #end + + #end + #end + + #set($value="") + #foreach( $identifierType in $identifierTypes) + #set($value="") + #if($identifierType.personDisplayName=='true') + + #foreach( $identifier in $patient.identifiers) + #if($!identifier.identifierType.id==$identifierType.id) + #set($value=$identifier.identifier) #else - $mapPatientPatientAttr.get($key) + #set($systemId=$identifier.identifier) #end - - #end - #end - - #set($value="") - #foreach( $identifierType in $identifierTypes) - #set($value="") - #if($identifierType.personDisplayName=='true') - - #foreach( $identifier in $patient.identifiers) - #if($!identifier.identifierType.id==$identifierType.id) - #set($value=$identifier.identifier) - #else - #set($systemId=$identifier.identifier) - #end - #end - $encoder.htmlEncode($value) - - #end - #end - - #if($value=="") - #set($value=$!patient.name) - #end - #if($value=="") - #set($value=$systemId) - #end - #if($personDisplayName=='false') - - $encoder.htmlEncode($value) - - #end - - #if($!patient.gender) $i18n.getString($!patient.gender) #end - - #if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end - - #if($!patient.birthDate) $!patient.getAge() #end - - $!patient.phoneNumber - #else - #set($value="") - #foreach( $identifier in $patient.identifiers) - #if($!identifier.identifierType) - #else - #set($value=$identifier.identifier) - #end - #end + #end + $encoder.htmlEncode($value) + + #end + #end + + #if($value=="") + #set($value=$!patient.name) + #end + #if($value=="") + #set($value=$systemId) + #end + #if($personDisplayName=='false') - $value + $encoder.htmlEncode($value) #end + #if($!patient.gender) $i18n.getString($!patient.gender) #end + + #if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end + + #if($!patient.birthDate) $!patient.getAge() #end + + $!patient.phoneNumber + #if($mapPatientOrgunit.size()!=0) $!mapPatientOrgunit.get($patient.id) #end