=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-06-14 07:44:15 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-06-14 07:52:04 +0000 @@ -616,19 +616,30 @@ if( getFieldValue('searchPatientByAttributes')==''){ return; } - - jQuery('#listEntityInstanceDiv').load( - 'searchTrackedEntityInstance.action', { - orgunitId: getFieldValue('orgunitId'), - attributeValue: getFieldValue('searchPatientByAttributes'), - programId: getFieldValue('program') - }, function() { - setInnerHTML('orgunitInfor', getFieldValue('orgunitName')); - if( getFieldValue('program')!= ''){ - var programName = jQuery('#programIdAddTrackedEntity option:selected').text(); - setInnerHTML('enrollmentInfor', i18n_enrollments_in + " " + programName + " " + i18n_program); - } + var params = "ou=" + getFieldValue("orgunitId"); + params += "&page=1"; + if (getFieldValue('program') != '') { + params += "&program=" + getFieldValue('program'); + if( getFieldValue('programStatus')!=""){ + params += "&programStatus=" + getFieldValue('programStatus'); + } + } + + params += "&query=" + getFieldValue('searchPatientByAttributes'); + + $('#attributeIds option').each(function(i, item) { + params += "&attribute=" + item.value; + }); + + $.ajax({ + url : '../api/trackedEntityInstances.json', + type : "GET", + data : params, + success : function(json) { + setInnerHTML('listEntityInstanceDiv', displayTEIList(json, 1)); showById('listEntityInstanceDiv'); jQuery('#loaderDiv').hide(); - }); + setTableStyles(); + } + }); }