dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24932
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12268: Fix build error.
------------------------------------------------------------
revno: 12268
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-27 12:05:59 +0700
message:
Fix build error.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java
dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java
--
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/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-09-27 04:43:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-09-27 05:05:59 +0000
@@ -382,11 +382,6 @@
executeSql( "ALTER TABLE programinstance DROP COLUMN completed" );
}
- private void updateProgramPatientProperties()
- {
-
- }
-
private int executeSql( String sql )
{
try
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java 2013-09-27 05:05:59 +0000
@@ -31,12 +31,14 @@
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
+import java.util.HashSet;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientAttribute;
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramPatientProperty;
import org.hisp.dhis.program.ProgramService;
import com.opensymphony.xwork2.Action;
@@ -126,7 +128,7 @@
this.now = now;
}
- private Collection<PatientIdentifierType> patientIdentifierTypes;
+ private Collection<PatientIdentifierType> patientIdentifierTypes = new HashSet<PatientIdentifierType>();
public Collection<PatientIdentifierType> getPatientIdentifierTypes()
{
@@ -138,7 +140,7 @@
this.patientIdentifierTypes = patientIdentifierTypes;
}
- private Collection<PatientAttribute> patientAttributes;
+ private Collection<PatientAttribute> patientAttributes = new HashSet<PatientAttribute>();
public Collection<PatientAttribute> getPatientAttributes()
{
@@ -164,8 +166,18 @@
return REDIRECT;
}
- patientAttributes = program.getPatientAttributes();
- patientIdentifierTypes = program.getPatientIdentifierTypes();
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ patientIdentifierTypes.add( programPatientProperty.getPatientIdentifierType() );
+ }
+ else if(programPatientProperty.isAttribute() )
+ {
+ patientAttributes.add( programPatientProperty.getPatientAttribute() );
+ }
+ }
+
now = new SimpleDateFormat( "yyyy-MM-dd" ).format( new Date() );
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java 2013-09-18 07:25:37 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java 2013-09-27 05:05:59 +0000
@@ -55,6 +55,7 @@
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramPatientProperty;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
@@ -301,9 +302,19 @@
{
patient = patientService.getPatient( patientId );
program = programService.getProgram( programId );
- patientAttributes = program.getPatientAttributes();
- patientIdentifierTypes = program.getPatientIdentifierTypes();
-
+
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ patientIdentifierTypes.add( programPatientProperty.getPatientIdentifierType() );
+ }
+ else if(programPatientProperty.isAttribute() )
+ {
+ patientAttributes.add( programPatientProperty.getPatientAttribute() );
+ }
+ }
+
List<PatientAttributeValue> patientAttributeValues = new ArrayList<PatientAttributeValue>();
HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get( StrutsStatics.HTTP_REQUEST );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2013-09-27 05:05:59 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientIdentifierTypeService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramPatientProperty;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.setting.SystemSettingManager;
@@ -181,8 +182,17 @@
for ( Program program : programs )
{
- patientIdentifierTypes.removeAll( program.getPatientIdentifierTypes() );
- patientAttributes.removeAll( program.getPatientAttributes() );
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ patientIdentifierTypes.remove( programPatientProperty.getPatientIdentifierType() );
+ }
+ else if ( programPatientProperty.isAttribute() )
+ {
+ patientAttributes.remove( programPatientProperty.getPatientAttribute() );
+ }
+ }
}
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2013-09-19 05:40:02 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2013-09-27 05:05:59 +0000
@@ -30,6 +30,7 @@
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
+
import org.apache.commons.lang.math.NumberUtils;
import org.apache.struts2.StrutsStatics;
import org.hisp.dhis.light.utils.FormUtils;
@@ -47,6 +48,7 @@
import org.hisp.dhis.patient.util.PatientIdentifierGenerator;
import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramPatientProperty;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.util.ContextUtils;
import org.joda.time.DateTime;
@@ -54,6 +56,7 @@
import org.joda.time.format.ISODateTimeFormat;
import javax.servlet.http.HttpServletRequest;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -343,8 +346,17 @@
for ( Program program : programs )
{
- patientIdentifierTypes.removeAll( program.getPatientIdentifierTypes() );
- patientAttributes.removeAll( program.getPatientAttributes() );
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ patientIdentifierTypes.remove( programPatientProperty.getPatientIdentifierType() );
+ }
+ else if(programPatientProperty.isAttribute() )
+ {
+ patientAttributes.remove( programPatientProperty.getPatientAttribute() );
+ }
+ }
}
patient.setOrganisationUnit( organisationUnitService.getOrganisationUnit( orgUnitId ) );
@@ -408,8 +420,17 @@
for ( Program program : programs )
{
- patientIdentifierTypes.removeAll( program.getPatientIdentifierTypes() );
- patientAttributes.removeAll( program.getPatientAttributes() );
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ patientIdentifierTypes.remove( programPatientProperty.getPatientIdentifierType() );
+ }
+ else if(programPatientProperty.isAttribute() )
+ {
+ patientAttributes.remove( programPatientProperty.getPatientAttribute() );
+ }
+ }
}
for ( PatientIdentifierType patientIdentifierType : patientIdentifierTypes )
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2013-09-11 13:46:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java 2013-09-27 05:05:59 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramPatientProperty;
import org.hisp.dhis.program.ProgramService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -172,7 +173,13 @@
for ( Integer programId : programIds )
{
Program program = programService.getProgram( programId );
- identifierTypes.addAll( program.getPatientIdentifierTypes() );
+ for ( ProgramPatientProperty programPatientProperty : program.getProgramPatientProperties() )
+ {
+ if ( programPatientProperty.isIdentifierType() )
+ {
+ identifierTypes.add( programPatientProperty.getPatientIdentifierType() );
+ }
+ }
}
}
}