dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20984
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9822: Only load persons who enrolled into the seleted program in Find/Add person function.
------------------------------------------------------------
revno: 9822
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-18 15:42:43 +0700
message:
Only load persons who enrolled into the seleted program in Find/Add person function.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
--
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-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-01-21 08:13:02 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-02-18 08:42:43 +0000
@@ -410,7 +410,7 @@
}
else if ( keys[0].equals( Patient.PREFIX_PROGRAM ) )
{
- sql += "(select programid from patient_programs where patientid=p.patientid and programid=" + keys[1]
+ sql += "(select programid from patient_programs where patientid=p.patientid and programid=" + id
+ " ) as " + Patient.PREFIX_PROGRAM + "_" + id + ",";
otherWhere += operator + Patient.PREFIX_PROGRAM + "_" + id + "=" + id;
operator = " and ";
=== 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 2013-02-02 10:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2013-02-18 08:42:43 +0000
@@ -32,15 +32,33 @@
jQuery('#loaderDiv').show();
contentDiv = 'listPatientDiv';
- jQuery('#listPatientDiv').load('searchRegistrationPatient.action',{
- listAll:true
- },
- function(){
- setTableStyles();
- statusSearching = 0;
- showById('listPatientDiv');
- jQuery('#loaderDiv').hide();
- });
+ if( getFieldValue('programIdAddPatient')=='')
+ {
+ jQuery('#listPatientDiv').load('searchRegistrationPatient.action',{
+ listAll:true
+ },
+ function(){
+ setTableStyles();
+ statusSearching = 0;
+ showById('listPatientDiv');
+ jQuery('#loaderDiv').hide();
+ });
+ }
+ else
+ {
+ jQuery('#listPatientDiv').load('searchRegistrationPatient.action',{
+ listAll:false,
+ searchBySelectedOrgunit: true,
+ programIds: getFieldValue('programIdAddPatient'),
+ searchTexts: 'prg_' + getFieldValue('programIdAddPatient')
+ },
+ function(){
+ setTableStyles();
+ statusSearching = 0;
+ showById('listPatientDiv');
+ jQuery('#loaderDiv').hide();
+ });
+ }
hideLoader();
}