dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20953
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9798: minor cleanup
------------------------------------------------------------
revno: 9798
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-02-13 10:00:36 +0700
message:
minor cleanup
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.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-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java 2013-01-01 19:53:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataentryform/DataEntryForm.java 2013-02-13 03:00:36 +0000
@@ -44,7 +44,7 @@
/**
* @author Bharath Kumar
*/
-@JacksonXmlRootElement( localName = "dataEntryForm", namespace = Dxf2Namespace.NAMESPACE )
+@JacksonXmlRootElement(localName = "dataEntryForm", namespace = Dxf2Namespace.NAMESPACE)
public class DataEntryForm
implements Serializable, ImportableObject
{
@@ -52,9 +52,9 @@
public static final String STYLE_REGULAR = "regular";
public static final String STYLE_COMPACT = "compact";
public static final String STYLE_NONE = "none";
-
+
public static final int CURRENT_FORMAT = 2;
-
+
/**
* Determines if a de-serialized file is compatible with this class.
*/
@@ -72,7 +72,7 @@
* Name of DataEntryForm. Required and unique.
*/
private String name;
-
+
/**
* The display style to use to render the form.
*/
@@ -82,7 +82,7 @@
* HTML Code of DataEntryForm
*/
private String htmlCode;
-
+
/**
* The format of the DataEntryForm.
*/
@@ -165,7 +165,7 @@
throw new IllegalArgumentException( message );
}
}
-
+
// -------------------------------------------------------------------------
// hashCode and equals
// -------------------------------------------------------------------------
@@ -214,8 +214,8 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+ @JsonView({ DetailedView.class, ExportView.class })
+ @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
public String getName()
{
return name;
@@ -227,8 +227,8 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+ @JsonView({ DetailedView.class, ExportView.class })
+ @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
public String getStyle()
{
return style;
@@ -240,8 +240,8 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+ @JsonView({ DetailedView.class, ExportView.class })
+ @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
public String getHtmlCode()
{
return htmlCode;
@@ -253,8 +253,8 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+ @JsonView({ DetailedView.class, ExportView.class })
+ @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
public int getFormat()
{
return format;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java 2013-02-13 03:00:36 +0000
@@ -27,15 +27,15 @@
package org.hisp.dhis.patient;
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.Dxf2Namespace;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.hisp.dhis.common.BaseIdentifiableObject;
-import org.hisp.dhis.common.Dxf2Namespace;
-
-@XmlRootElement( name = "patientIdentifierType", namespace = Dxf2Namespace.NAMESPACE )
-@XmlAccessorType( value = XmlAccessType.NONE )
+@XmlRootElement(name = "patientIdentifierType", namespace = Dxf2Namespace.NAMESPACE)
+@XmlAccessorType(value = XmlAccessType.NONE)
public class PatientIdentifierType
extends BaseIdentifiableObject
{
@@ -63,7 +63,7 @@
private String type;
private Boolean personDisplayName;
-
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -194,5 +194,5 @@
{
this.personDisplayName = personDisplayName;
}
-
+
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java 2012-09-18 09:13:01 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java 2013-02-13 03:00:36 +0000
@@ -31,7 +31,6 @@
/**
* @author Chau Thu Tran
- *
* @version PatientReminder.java 1:07:58 PM Sep 18, 2012 $
*/
public class PatientReminder
@@ -40,7 +39,7 @@
private static final long serialVersionUID = 3101502417481903219L;
private int id;
-
+
private String name;
private Integer daysAllowedSendMessage;
@@ -50,7 +49,7 @@
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
-
+
public PatientReminder()
{
@@ -66,7 +65,7 @@
// -------------------------------------------------------------------------
// Getter && Setter
// -------------------------------------------------------------------------
-
+
public int getId()
{
return id;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java 2012-07-10 06:06:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java 2013-02-13 03:00:36 +0000
@@ -27,12 +27,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.program.ProgramStageInstance;
+
import java.io.Serializable;
import java.util.Date;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.program.ProgramStageInstance;
-
/**
* @author Abyot Asalefew Gizaw
* @version $Id$
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2013-01-23 04:48:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2013-02-13 03:00:36 +0000
@@ -27,10 +27,6 @@
package org.hisp.dhis.program;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
import org.apache.commons.lang.StringUtils;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -39,6 +35,10 @@
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.validation.ValidationCriteria;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
/**
* @author Abyot Asalefew
*/
@@ -79,13 +79,13 @@
private Set<ProgramStage> programStages = new HashSet<ProgramStage>();
private Set<ValidationCriteria> patientValidationCriteria = new HashSet<ValidationCriteria>();
-
+
private Integer type;
private Boolean displayProvidedOtherFacility;
private Boolean displayIncidentDate;
-
+
private Boolean generatedByEnrollmentDate;
private Boolean ignoreOverdueEvents;
@@ -93,9 +93,9 @@
private List<PatientIdentifierType> patientIdentifierTypes;
private List<PatientAttribute> patientAttributes;
-
+
private Boolean blockEntryForm = false;
-
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -216,7 +216,7 @@
{
this.dateOfEnrollmentDescription = dateOfEnrollmentDescription;
}
-
+
public String getDateOfIncidentDescription()
{
return dateOfIncidentDescription;
@@ -291,7 +291,7 @@
return null;
}
- @SuppressWarnings( "unchecked" )
+ @SuppressWarnings("unchecked")
public ValidationCriteria isValid( Patient patient )
{
try
@@ -347,7 +347,7 @@
{
this.generatedByEnrollmentDate = generatedByEnrollmentDate;
}
-
+
public Boolean getIgnoreOverdueEvents()
{
return ignoreOverdueEvents;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java 2012-05-23 19:48:53 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java 2013-02-13 03:00:36 +0000
@@ -26,13 +26,13 @@
*/
package org.hisp.dhis.program;
+import org.hisp.dhis.patient.Patient;
+
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
-import org.hisp.dhis.patient.Patient;
-
/**
* @author Abyot Asalefew
* @version $Id$
@@ -99,12 +99,12 @@
{
final int prime = 31;
int result = 1;
-
- result = prime * result + ( ( dateOfIncident == null) ? 0 : dateOfIncident.hashCode() );
- result = prime * result + ( ( enrollmentDate == null) ? 0 : enrollmentDate.hashCode() );
- result = prime * result + ( ( patient == null) ? 0 : patient.hashCode() );
- result = prime * result + ( ( program == null) ? 0 : program.hashCode() );
-
+
+ result = prime * result + ((dateOfIncident == null) ? 0 : dateOfIncident.hashCode());
+ result = prime * result + ((enrollmentDate == null) ? 0 : enrollmentDate.hashCode());
+ result = prime * result + ((patient == null) ? 0 : patient.hashCode());
+ result = prime * result + ((program == null) ? 0 : program.hashCode());
+
return result;
}
@@ -115,19 +115,19 @@
{
return true;
}
-
+
if ( obj == null )
{
return false;
}
-
+
if ( getClass() != obj.getClass() )
{
return false;
}
-
+
final ProgramInstance other = (ProgramInstance) obj;
-
+
if ( dateOfIncident == null )
{
if ( other.dateOfIncident != null )
@@ -139,7 +139,7 @@
{
return false;
}
-
+
if ( enrollmentDate == null )
{
if ( other.enrollmentDate != null )
@@ -151,7 +151,7 @@
{
return false;
}
-
+
if ( patient == null )
{
if ( other.patient != null )
@@ -163,7 +163,7 @@
{
return false;
}
-
+
if ( program == null )
{
if ( other.program != null )
@@ -175,7 +175,7 @@
{
return false;
}
-
+
return true;
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2013-02-13 03:00:36 +0000
@@ -26,13 +26,13 @@
*/
package org.hisp.dhis.program;
-import java.util.HashSet;
-import java.util.Set;
-
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.dataentryform.DataEntryForm;
import org.hisp.dhis.patient.PatientReminder;
+import java.util.HashSet;
+import java.util.Set;
+
/**
* @author Abyot Asalefew
*/
@@ -85,9 +85,9 @@
private Boolean autoGenerateEvent = true;
private Boolean validCompleteOnly = false;
-
+
private Boolean displayGenerateEventBox = true;
-
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2012-11-08 04:13:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2013-02-13 03:00:36 +0000
@@ -26,13 +26,12 @@
*/
package org.hisp.dhis.program;
+import org.hisp.dhis.dataelement.DataElement;
+
import java.io.Serializable;
-import org.hisp.dhis.dataelement.DataElement;
-
/**
* @author Viet Nguyen
- *
* @version $Id$
*/
public class ProgramStageDataElement
@@ -62,7 +61,7 @@
private Boolean allowProvidedElsewhere;
private Integer sortOrder;
-
+
private Boolean displayInReports;
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-01-11 09:00:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-02-13 03:00:36 +0000
@@ -26,16 +26,16 @@
*/
package org.hisp.dhis.program;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patientcomment.PatientComment;
+import org.hisp.dhis.sms.outbound.OutboundSms;
+
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Set;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.patientcomment.PatientComment;
-import org.hisp.dhis.sms.outbound.OutboundSms;
-
/**
* @author Abyot Asalefew
* @version $Id$
@@ -57,8 +57,7 @@
public static final int LATE_VISIT_STATUS = 4;
public static final int SKIPPED_STATUS = 5;
-
-
+
private int id;
private ProgramInstance programInstance;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java 2012-08-16 15:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java 2013-02-13 03:00:36 +0000
@@ -27,6 +27,7 @@
package org.hisp.dhis.caseentry.action.caseentry;
+import com.opensymphony.xwork2.Action;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
@@ -35,11 +36,8 @@
import org.hisp.dhis.program.ProgramStageInstanceService;
import org.hisp.dhis.program.ProgramStageService;
-import com.opensymphony.xwork2.Action;
-
/**
* @author Chau Thu Tran
- *
* @version $Id: AddIrregularEncounterAction.java Oct 27, 2011 10:58:23 AM $
*/
public class RegisterIrregularEncounterAction
@@ -50,14 +48,14 @@
// -------------------------------------------------------------------------
private ProgramInstanceService programInstanceService;
-
+
public void setProgramInstanceService( ProgramInstanceService programInstanceService )
{
this.programInstanceService = programInstanceService;
}
private ProgramStageService programStageService;
-
+
public void setProgramStageService( ProgramStageService programStageService )
{
this.programStageService = programStageService;
@@ -69,7 +67,7 @@
{
this.programStageInstanceService = programStageInstanceService;
}
-
+
private I18nFormat format;
public void setFormat( I18nFormat format )
@@ -118,17 +116,16 @@
throws Exception
{
ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
-
- ProgramStage progamStage = programStageService.getProgramStage( programStageId );
-
+
+ ProgramStage programStage = programStageService.getProgramStage( programStageId );
+
ProgramStageInstance programStageInstance = new ProgramStageInstance();
programStageInstance.setProgramInstance( programInstance );
- programStageInstance.setProgramStage( progamStage );
+ programStageInstance.setProgramStage( programStage );
programStageInstance.setDueDate( format.parseDate( dueDate ) );
- int id = programStageInstanceService.addProgramStageInstance( programStageInstance );
- message = id + "";
-
+ message = Integer.toString( programStageInstanceService.addProgramStageInstance( programStageInstance ) );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2012-07-10 06:06:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2013-02-13 03:00:36 +0000
@@ -27,8 +27,7 @@
package org.hisp.dhis.caseentry.action.caseentry;
-import java.util.Date;
-
+import com.opensymphony.xwork2.Action;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataelement.DataElement;
@@ -39,7 +38,7 @@
import org.hisp.dhis.program.ProgramStageInstanceService;
import org.hisp.dhis.user.CurrentUserService;
-import com.opensymphony.xwork2.Action;
+import java.util.Date;
/**
* @author Abyot Asalefew Gizaw
@@ -149,7 +148,7 @@
// ---------------------------------------------------------------------
// Save value
// ---------------------------------------------------------------------
-
+
if ( programStageInstance.getExecutionDate() == null )
{
programStageInstance.setExecutionDate( new Date() );
@@ -158,6 +157,7 @@
providedElsewhere = (providedElsewhere == null) ? false : providedElsewhere;
String storedBy = currentUserService.getCurrentUsername();
+
if ( patientDataValue == null && value != null )
{
LOG.debug( "Adding PatientDataValue, value added" );
@@ -168,11 +168,12 @@
patientDataValueService.savePatientDataValue( patientDataValue );
}
- if( patientDataValue != null && value == null )
+
+ if ( patientDataValue != null && value == null )
{
patientDataValueService.deletePatientDataValue( patientDataValue );
}
- else if( patientDataValue != null && value != null )
+ else if ( patientDataValue != null && value != null )
{
LOG.debug( "Updating PatientDataValue, value added/changed" );
@@ -180,7 +181,7 @@
patientDataValue.setTimestamp( new Date() );
patientDataValue.setProvidedElsewhere( providedElsewhere );
patientDataValue.setStoredBy( storedBy );
-
+
patientDataValueService.updatePatientDataValue( patientDataValue );
}