dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11376
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3222: Clean up code into dhis-web-caseentry and add copyright into files.
------------------------------------------------------------
revno: 3222
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-03-31 08:49:21 +0700
message:
Clean up code into dhis-web-caseentry and add copyright into files.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultDetailsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/LoadPeriodsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/ValidationCaseAggregationAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CustomDataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntrySelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java
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/SearchPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientFormAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateSearchAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ValidateReportParametersAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ViewRecordsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DataEntryScreenManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DefaultDataEntryScreenManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultPeriodGenericManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/NextPeriodsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/PeriodGenericManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java 2011-01-12 02:22:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationFormAction.java 2011-03-31 01:49:21 +0000
@@ -64,7 +64,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2011-03-24 03:34:53 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2011-03-31 01:49:21 +0000
@@ -60,7 +60,6 @@
public class CaseAggregationResultAction
implements Action
{
-
Log log = LogFactory.getLog( getClass() );
// -------------------------------------------------------------------------
@@ -124,7 +123,7 @@
}
// -------------------------------------------------------------------------
- // Input & Output Parameters
+ // Input/Output
// -------------------------------------------------------------------------
private String facilityLB;
@@ -147,7 +146,7 @@
{
return mapDataValues;
}
-
+
private Map<DataValue, CaseAggregationCondition> mapCaseAggCondition;
public Map<DataValue, CaseAggregationCondition> getMapCaseAggCondition()
@@ -164,7 +163,7 @@
{
mapDataValues = new HashMap<DataValue, String>();
mapCaseAggCondition = new HashMap<DataValue, CaseAggregationCondition>();
-
+
String storedBy = currentUserService.getCurrentUsername() + "_CAE";
// ---------------------------------------------------------------------
@@ -177,7 +176,7 @@
{
return SUCCESS;
}
-
+
List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>();
if ( facilityLB.equals( "children" ) )
{
@@ -245,7 +244,7 @@
double resultValue = aggregationConditionService.parseConditition( condition, orgUnit, period );
DataValue dataValue = dataValueService.getDataValue( orgUnit, dElement, period, optionCombo );
-
+
if ( resultValue != 0 )
{
if ( dataValue == null )
@@ -266,7 +265,7 @@
mapDataValues.put( dataValue, i18n.getString( "updated" ) + " " + message );
}
-
+
mapCaseAggCondition.put( dataValue, condition );
}
@@ -281,12 +280,12 @@
mapDataValues.put( dvalue, i18n.getString( "deleted" ) + " " + message );
}
- }// PeriodList end
-
- }// OptionComboList end
- }// DataElementList end
-
- }// Orgunit for loop end
+ }
+
+ }
+ }
+
+ }
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultDetailsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultDetailsAction.java 2011-03-24 03:34:53 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultDetailsAction.java 2011-03-31 01:49:21 +0000
@@ -46,7 +46,6 @@
/**
* @author Chau Thu Tran
- *
* @version CaseAggregationResultDetailsAction.java Mar 23, 2011 10:42:51 AM $
*/
public class CaseAggregationResultDetailsAction
@@ -65,7 +64,7 @@
private PatientDataValueService patientDataValueService;
// -------------------------------------------------------------------------
- // Input and Output
+ // Input/Output
// -------------------------------------------------------------------------
private Integer orgunitId;
@@ -77,7 +76,7 @@
private Map<Patient, Collection<PatientDataValue>> mapPatients;
// -------------------------------------------------------------------------
- // Getters && Setters
+ // Getter/Setter
// -------------------------------------------------------------------------
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -121,7 +120,7 @@
}
// -------------------------------------------------------------------------
- // Action Implementation
+ // Implementation Action
// -------------------------------------------------------------------------
@Override
@@ -129,9 +128,9 @@
throws Exception
{
mapPatients = new HashMap<Patient, Collection<PatientDataValue>>();
-
+
OrganisationUnit orgunit = organisationUnitService.getOrganisationUnit( orgunitId );
-
+
Period period = periodService.getPeriod( periodId );
CaseAggregationCondition aggCondition = aggregationConditionService
@@ -146,9 +145,10 @@
Collection<PatientDataValue> dataValues = patientDataValueService.getPatientDataValues( patient,
dataElements, period.getStartDate(), period.getEndDate() );
-
+
mapPatients.put( patient, dataValues );
}
+
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/LoadPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/LoadPeriodsAction.java 2011-01-05 01:13:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/LoadPeriodsAction.java 2011-03-31 01:49:21 +0000
@@ -74,7 +74,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/ValidationCaseAggregationAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/ValidationCaseAggregationAction.java 2011-03-22 02:17:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/ValidationCaseAggregationAction.java 2011-03-31 01:49:21 +0000
@@ -37,7 +37,6 @@
/**
* @author Chau Thu Tran
- *
* @version ValidationCaseAggregationAction.java Mar 21, 2011 8:50:06 PM $
*/
public class ValidationCaseAggregationAction
@@ -54,7 +53,7 @@
private I18n i18n;
// -------------------------------------------------------------------------
- // Input / Output
+ // Input/Output
// -------------------------------------------------------------------------
private String message;
@@ -64,7 +63,7 @@
private int eDateLB;
// -------------------------------------------------------------------------
- // Getters && Setters
+ // Getters/Setters
// -------------------------------------------------------------------------
public void setPeriodGenericManager( PeriodGenericManager periodGenericManager )
@@ -98,7 +97,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java 2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java 2011-03-31 01:49:21 +0000
@@ -115,7 +115,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CustomDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CustomDataEntryAction.java 2011-01-06 16:37:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CustomDataEntryAction.java 2011-03-31 01:49:21 +0000
@@ -148,24 +148,6 @@
}
// -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private String customDataEntryFormCode = null;
-
- public String getCustomDataEntryFormCode()
- {
- return this.customDataEntryFormCode;
- }
-
- private Collection<ProgramStageDataElement> programStageDataElements;
-
- public Collection<ProgramStageDataElement> getProgramStageDataElements()
- {
- return programStageDataElements;
- }
-
- // -------------------------------------------------------------------------
// Input / Output
// -------------------------------------------------------------------------
@@ -307,16 +289,30 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Output
+ // -------------------------------------------------------------------------
+
+ private String customDataEntryFormCode = null;
+
+ public String getCustomDataEntryFormCode()
+ {
+ return this.customDataEntryFormCode;
+ }
+
+ private Collection<ProgramStageDataElement> programStageDataElements;
+
+ public Collection<ProgramStageDataElement> getProgramStageDataElements()
+ {
+ return programStageDataElements;
+ }
+
+ // -------------------------------------------------------------------------
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Get the min/max values
- // ---------------------------------------------------------------------
-
Collection<MinMaxDataElement> minMaxDataElements = minMaxDataElementService.getMinMaxDataElements(
organisationUnit, dataElements );
@@ -370,22 +366,18 @@
boolean cdeFormExists = (dataEntryForm != null);
- // --------------------------------------------------------------
String disabled = "";
Map<CalculatedDataElement, Integer> calculatedValueMap = dataEntryScreenManager
.populateValuesForCalculatedDataElements( organisationUnit, programStage, programStageInstance );
- // -----------------------------------------------------------
if ( cdeFormExists )
{
customDataEntryFormCode = dataEntryScreenManager.populateCustomDataEntryScreenForMultiDimensional(
- dataEntryForm.getHtmlCode(), patientDataValues, calculatedValueMap, minMaxMap, disabled,
- i18n, programStage, programStageInstance, organisationUnit );
+ dataEntryForm.getHtmlCode(), patientDataValues, calculatedValueMap, minMaxMap, disabled, i18n,
+ programStage, programStageInstance, organisationUnit );
+ }
- //programStageDataElements = dataEntryScreenManager.getProgramStageDataElements( dataEntryForm.getHtmlCode() );
- }
return SUCCESS;
-
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntryAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntryAction.java 2011-03-31 01:49:21 +0000
@@ -234,13 +234,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
-
organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
patient = selectedStateManager.getSelectedPatient();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntrySelectAction.java 2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataEntrySelectAction.java 2011-03-31 01:49:21 +0000
@@ -64,16 +64,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Validate selected OrganisationUnit
- // ---------------------------------------------------------------------
-
organisationUnit = selectionManager.getSelectedOrganisationUnit();
if ( organisationUnit == null )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java 2010-11-10 02:11:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java 2011-03-31 01:49:21 +0000
@@ -216,7 +216,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2011-03-01 08:15:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2011-03-31 01:49:21 +0000
@@ -136,8 +136,8 @@
return programInstances;
}
- private Map<ProgramInstance, List<ProgramStageInstance>> programStageInstanceMap = new HashMap<ProgramInstance,List<ProgramStageInstance>>();
-
+ private Map<ProgramInstance, List<ProgramStageInstance>> programStageInstanceMap = new HashMap<ProgramInstance, List<ProgramStageInstance>>();
+
public Map<ProgramInstance, List<ProgramStageInstance>> getProgramStageInstanceMap()
{
return programStageInstanceMap;
@@ -193,7 +193,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
@@ -223,16 +223,16 @@
// ---------------------------------------------------------------------
// Program instances for the selected program
// ---------------------------------------------------------------------
-
+
Collection<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
-
+
total = patientService.countGetPatientsByOrgUnitProgram( organisationUnit, program );
-
+
this.paging = createPaging( total );
-
+
patientListByOrgUnit = new ArrayList<Patient>( patientService.getPatients( organisationUnit, program, paging
.getStartPos(), paging.getPageSize() ) );
-
+
for ( Patient patient : patientListByOrgUnit )
{
Collection<ProgramInstance> _programInstances = programInstanceService.getProgramInstances( patient,
@@ -255,9 +255,10 @@
patinetAttributeValueMap.put( patient, patientAttributeValue );
- List<ProgramStageInstance> programStageInstanceList = new ArrayList<ProgramStageInstance>( programInstance.getProgramStageInstances() );
+ List<ProgramStageInstance> programStageInstanceList = new ArrayList<ProgramStageInstance>(
+ programInstance.getProgramStageInstances() );
Collections.sort( programStageInstanceList, new ProgramStageInstanceComparator() );
-
+
programStageInstanceMap.put( programInstance, programStageInstanceList );
programStageInstances.addAll( programStageInstanceList );
}
@@ -267,13 +268,12 @@
// ---------------------------------------------------------------------
// Sorting PatientList by selected Patient Attribute
// ---------------------------------------------------------------------
-
+
if ( sortPatientAttributeId != null )
{
sortingAttribute = patientAttributeService.getPatientAttribute( sortPatientAttributeId );
- patientListByOrgUnit = patientService.sortPatientsByAttribute( patientListByOrgUnit,
- sortingAttribute );
+ patientListByOrgUnit = patientService.sortPatientsByAttribute( patientListByOrgUnit, sortingAttribute );
}
colorMap = programStageInstanceService.colorProgramStageInstances( programStageInstances );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetPatientAction.java 2009-11-19 19:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetPatientAction.java 2011-03-31 01:49:21 +0000
@@ -121,13 +121,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
-
patient = patientService.getPatient( id );
patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );
@@ -148,6 +147,5 @@
programs = programService.getAllPrograms();
return SUCCESS;
-
}
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java 2010-08-05 12:32:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java 2011-03-31 01:49:21 +0000
@@ -12,7 +12,8 @@
import com.opensymphony.xwork2.Action;
-public class MultiDataEntrySelectAction implements Action
+public class MultiDataEntrySelectAction
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
@@ -40,7 +41,7 @@
}
// -------------------------------------------------------------------------
- // Input/output
+ // Input/Output
// -------------------------------------------------------------------------
private OrganisationUnit organisationUnit;
@@ -68,26 +69,23 @@
{
return programs;
}
-
+
private Collection<PatientAttribute> patientAttributes = new ArrayList<PatientAttribute>();
-
+
public Collection<PatientAttribute> getPatientAttributes()
{
return patientAttributes;
}
-
+
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Patient Attribute Service
- // ---------------------------------------------------------------------
patientAttributes = patientAttributeService.getAllPatientAttributes();
-
+
// ---------------------------------------------------------------------
// Validate selected OrganisationUnit
// ---------------------------------------------------------------------
@@ -127,7 +125,7 @@
if ( selectedProgram != null && programs.contains( selectedProgram ) )
{
programId = selectedProgram.getId();
-
+
selectedStateManager.setSelectedProgram( selectedProgram );
}
else
@@ -138,9 +136,8 @@
return SUCCESS;
}
-
+
return SUCCESS;
}
-
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java 2011-01-06 16:37:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java 2011-03-31 01:49:21 +0000
@@ -215,7 +215,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
@@ -269,12 +269,10 @@
boolean cdeFormExists = (dataEntryForm != null);
- // --------------------------------------------------------------
String disabled = "";
Map<CalculatedDataElement, Integer> calculatedValueMap = dataEntryScreenManager
.populateValuesForCalculatedDataElements( organisationUnit, programStage, programStageInstance );
- // -----------------------------------------------------------
if ( cdeFormExists )
{
customDataEntryFormExists = true;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java 2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java 2011-03-31 01:49:21 +0000
@@ -148,21 +148,21 @@
}
private String message;
-
+
public String getMessage()
{
return message;
}
-
+
private I18n i18n;
-
+
public void setI18n( I18n i18n )
{
this.i18n = i18n;
}
-
+
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
@@ -195,7 +195,7 @@
{
value = null;
}
-
+
if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_DATE ) && value != null )
{
Date dateValue = format.parseDate( value );
@@ -206,55 +206,59 @@
return SUCCESS;
}
-
- // -----------------------------------------------------------------
- // Check inputed value :
- // value >= DueDate - program.minDaysAllowedInputData
- // value <= DueDate + program.maxDaysAllowedInputData
- // -----------------------------------------------------------------
-
+
+ // -----------------------------------------------------------------
+ // Check inputed value :
+ // value >= DueDate - program.minDaysAllowedInputData
+ // value <= DueDate + program.maxDaysAllowedInputData
+ // -----------------------------------------------------------------
+
Date dueDate = programStageInstance.getDueDate();
-
- if(dateValue.before(dueDate)){
-
- long diffMillis = dueDate.getTime()-dateValue.getTime();
-
- long diffMinDays = diffMillis/86400000;
-
- if(diffMinDays > program.getMinDaysAllowedInputData() )
+
+ if ( dateValue.before( dueDate ) )
+ {
+
+ long diffMillis = dueDate.getTime() - dateValue.getTime();
+
+ long diffMinDays = diffMillis / 86400000;
+
+ if ( diffMinDays > program.getMinDaysAllowedInputData() )
{
statusCode = 2;
-
- message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" ) + " "
- + " ( " + i18n.getString( "min_days") + " : ( " + program.getMinDaysAllowedInputData() + i18n.getString("days") + " )"
- + "\n"
- + "- " + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " "
- + " ( "+ i18n.getString( "max_days") + " : " + program.getMaxDaysAllowedInputData() + i18n.getString("days") + " )";
-
-
+
+ message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" )
+ + " " + " ( " + i18n.getString( "min_days" ) + " : ( " + program.getMinDaysAllowedInputData()
+ + i18n.getString( "days" ) + " )" + "\n" + "- "
+ + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " " + " ( "
+ + i18n.getString( "max_days" ) + " : " + program.getMaxDaysAllowedInputData()
+ + i18n.getString( "days" ) + " )";
+
return SUCCESS;
}
-
- }else{
-
+
+ }
+ else
+ {
+
long diffMillis = dateValue.getTime() - dueDate.getTime();
-
- long diffMaxDays = diffMillis/86400000;
-
- if(diffMaxDays > program.getMaxDaysAllowedInputData() )
+
+ long diffMaxDays = diffMillis / 86400000;
+
+ if ( diffMaxDays > program.getMaxDaysAllowedInputData() )
{
statusCode = 2;
-
- message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" ) + " "
- + " ( " + i18n.getString( "min_days") + " : ( " + program.getMinDaysAllowedInputData() + i18n.getString("days") + " )"
- + "\n"
- + "- " + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " "
- + " ( "+ i18n.getString( "max_days") + " : " + program.getMaxDaysAllowedInputData() + i18n.getString("days") + " )";
-
+
+ message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" )
+ + " " + " ( " + i18n.getString( "min_days" ) + " : ( " + program.getMinDaysAllowedInputData()
+ + i18n.getString( "days" ) + " )" + "\n" + "- "
+ + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " " + " ( "
+ + i18n.getString( "max_days" ) + " : " + program.getMaxDaysAllowedInputData()
+ + i18n.getString( "days" ) + " )";
+
return SUCCESS;
}
}
-
+
}
if ( programStageInstance.getExecutionDate() == null )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java 2009-11-24 15:39:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java 2011-03-31 01:49:21 +0000
@@ -99,13 +99,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
-
ProgramStageInstance programStageInstance = programStageInstanceService
.getProgramStageInstance( programStageInstanceId );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java 2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java 2011-03-31 01:49:21 +0000
@@ -72,7 +72,7 @@
{
this.programInstanceService = programInstanceService;
}
-
+
private ProgramStageInstanceService programStageInstanceService;
public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
@@ -92,18 +92,18 @@
public void setPatientDataValueService( PatientDataValueService patientDataValueService )
{
this.patientDataValueService = patientDataValueService;
- }
+ }
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
-
+
private boolean providedByAnotherFacility;
public void setProvidedByAnotherFacility( boolean providedByAnotherFacility )
{
this.providedByAnotherFacility = providedByAnotherFacility;
- }
+ }
private int dataElementId;
@@ -125,47 +125,42 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
-
OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
-
-
+
Patient patient = selectedStateManager.getSelectedPatient();
-
Program program = selectedStateManager.getSelectedProgram();
-
ProgramStage programStage = selectedStateManager.getSelectedProgramStage();
-
- Collection<ProgramInstance> progamInstances = programInstanceService
- .getProgramInstances( patient, program, false );
+ Collection<ProgramInstance> progamInstances = programInstanceService.getProgramInstances( patient, program,
+ false );
ProgramInstance programInstance = progamInstances.iterator().next();
-
-
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( programInstance, programStage );
-
- DataElement dataElement = dataElementService.getDataElement( dataElementId );
+
+ ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
+ programInstance, programStage );
+
+ DataElement dataElement = dataElementService.getDataElement( dataElementId );
PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( programStageInstance,
dataElement, organisationUnit );
-
+
if ( patientDataValue != null )
{
LOG.debug( "Updating PatientDataValue, value added/changed" );
-
+
patientDataValue.setProvidedByAnotherFacility( providedByAnotherFacility );
-
+
patientDataValueService.updatePatientDataValue( patientDataValue );
- }
-
+ }
+
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 2011-03-24 14:41:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2011-03-31 01:49:21 +0000
@@ -64,6 +64,7 @@
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
+
private SelectedStateManager selectedStateManager;
public void setSelectedStateManager( SelectedStateManager selectedStateManager )
@@ -112,7 +113,7 @@
{
this.format = format;
}
-
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -163,12 +164,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
+
public String execute()
throws Exception
{
-
OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
Patient patient = selectedStateManager.getSelectedPatient();
@@ -186,7 +187,7 @@
programInstance, programStage );
DataElement dataElement = dataElementService.getDataElement( dataElementId );
-
+
if ( value != null && value.trim().length() == 0 )
{
value = null;
@@ -196,7 +197,7 @@
{
value = value.trim();
}
-
+
if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_DATE ) && value != null )
{
Date dateValue = format.parseDate( value );
@@ -218,7 +219,7 @@
else
{
Set<DataElementCategoryOptionCombo> options = dataElement.getCategoryCombo().getOptionCombos();
- if ( options != null)
+ if ( options != null )
{
for ( DataElementCategoryOptionCombo tmpOption : options )
{
@@ -244,7 +245,7 @@
}
if ( patientDataValue == null )
- {
+ {
LOG.debug( "Adding PatientDataValue, value added" );
@@ -275,7 +276,6 @@
patientDataValue.setTimestamp( new Date() );
patientDataValueService.updatePatientDataValue( patientDataValue );
-
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientAction.java 2010-10-20 13:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientAction.java 2011-03-31 01:49:21 +0000
@@ -145,16 +145,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Validate selected OrganisationUnit
- // ---------------------------------------------------------------------
-
organisationUnit = selectionManager.getSelectedOrganisationUnit();
patientAttributes = patientAttributeService.getAllPatientAttributes();
@@ -206,7 +202,7 @@
}
listAll = selectedStateManager.getListAll();
-
+
if ( listAll )
{
patients = patientService.getPatients( organisationUnit );
@@ -216,13 +212,13 @@
return SUCCESS;
}
-
+
searchingAttributeId = selectedStateManager.getSearchingAttributeId();
searchText = selectedStateManager.getSearchText();
-
+
if ( searchingAttributeId != null && searchText != null )
{
-
+
PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( searchingAttributeId );
Collection<PatientAttributeValue> matching = patientAttributeValueService.searchPatientAttributeValue(
@@ -235,9 +231,9 @@
return SUCCESS;
}
-
- patients = patientService.getPatients( searchText );
-
+
+ patients = patientService.getPatients( searchText );
+
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientFormAction.java 2009-11-19 19:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SearchPatientFormAction.java 2011-03-31 01:49:21 +0000
@@ -80,16 +80,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Validate selected OrganisationUnit
- // ---------------------------------------------------------------------
-
organisationUnit = selectionManager.getSelectedOrganisationUnit();
patientAttributes = patientAttributeService.getAllPatientAttributes();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateSearchAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateSearchAction.java 2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateSearchAction.java 2011-03-31 01:49:21 +0000
@@ -80,13 +80,12 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Implementation Action
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
-
if ( selectionManager.getSelectedOrganisationUnit() == null )
{
message = i18n.getString( "please_select_a_registering_unit" );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java 2011-02-22 23:17:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java 2011-03-31 01:49:21 +0000
@@ -58,7 +58,6 @@
public class ValidateValueAction
implements Action
{
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -233,13 +232,11 @@
return INPUT;
}
- // end Check validation for dataElement into the Stage
-
return SUCCESS;
}
// -------------------------------------------------------------------------
- // Support metho
+ // Support methods
// -------------------------------------------------------------------------
@SuppressWarnings( "unchecked" )
@@ -334,7 +331,6 @@
}
return value;
-
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java 2010-11-20 08:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java 2011-03-31 01:49:21 +0000
@@ -181,14 +181,14 @@
// ---------------------------------------------------------------------
// Program instances for the selected program
// ---------------------------------------------------------------------
- System.out.println("\n\n =============== \n 1.. ");
+
int total = programInstanceService.countProgramInstances( program, organisationUnit );
-System.out.println("\n total 2 : " + total);
+
this.paging = createPaging( total );
-System.out.println("\n 3.. ");
+
Collection<ProgramInstance> selectedProgramInstances = programInstanceService.getProgramInstances( program,
- organisationUnit, paging.getStartPos(), paging.getPageSize());
-System.out.println("\n 4 selectedProgramInstances : " + selectedProgramInstances );
+ organisationUnit, paging.getStartPos(), paging.getPageSize() );
+
Collection<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
for ( ProgramInstance programInstance : selectedProgramInstances )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java 2010-07-06 09:34:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java 2011-03-31 01:49:21 +0000
@@ -21,7 +21,8 @@
import com.opensymphony.xwork2.Action;
-public class GetPatientDetailsAction implements Action
+public class GetPatientDetailsAction
+ implements Action
{
// -------------------------------------------------------------------------
// Dependencies
@@ -66,7 +67,7 @@
private String childContactName;
private String childContactType;
-
+
private String systemIdentifier;
private String benicode;
@@ -84,7 +85,6 @@
public String execute()
throws Exception
{
-
patient = patientService.getPatient( id );
patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );
@@ -96,38 +96,41 @@
PatientIdentifierType idType = null;
Patient representative = patient.getRepresentative();
- if( patient.isUnderAge() && representative != null )
+ if ( patient.isUnderAge() && representative != null )
{
- for( PatientIdentifier representativeIdentifier : representative.getIdentifiers() )
+ for ( PatientIdentifier representativeIdentifier : representative.getIdentifiers() )
{
- if( representativeIdentifier.getIdentifierType() != null && representativeIdentifier.getIdentifierType().isRelated() )
+ if ( representativeIdentifier.getIdentifierType() != null
+ && representativeIdentifier.getIdentifierType().isRelated() )
{
- identiferMap.put( representativeIdentifier.getIdentifierType().getId(), representativeIdentifier.getIdentifier() );
- //System.out.println( "if patient uderage "+representativeIdentifier.getIdentifierType().getId()+ representativeIdentifier.getIdentifier() );
+ identiferMap.put( representativeIdentifier.getIdentifierType().getId(), representativeIdentifier
+ .getIdentifier() );
}
}
}
-
+
for ( PatientIdentifier identifier : patient.getIdentifiers() )
{
idType = identifier.getIdentifierType();
if ( idType != null )
{
identiferMap.put( identifier.getIdentifierType().getId(), identifier.getIdentifier() );
- //System.out.println( "if type is not null "+identifier.getIdentifierType().getId()+ identifier.getIdentifier() );
- if(idType.getFormat().equals("State Format"))
+
+ if ( idType.getFormat().equals( "State Format" ) )
{
- String iden = identifier.getIdentifier();
- benicode = iden.substring( 12,16 );//abcdefghi1121111
- yearcode = iden.substring( 10, 12 );
- progcode = iden.substring( 9, 10 );
- orgunitcode = iden.substring( 0, 9);
+ String iden = identifier.getIdentifier();
+ benicode = iden.substring( 12, 16 );// abcdefghi1121111
+ yearcode = iden.substring( 10, 12 );
+ progcode = iden.substring( 9, 10 );
+ orgunitcode = iden.substring( 0, 9 );
}
}
- else
+ else
+ {
systemIdentifier = identifier.getIdentifier();
+ }
}
-
+
for ( PatientAttribute patientAttribute : patient.getAttributes() )
{
patientAttributeValueMap.put( patientAttribute.getId(), PatientAttributeValue.UNKNOWN );
@@ -138,14 +141,17 @@
for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
{
- if( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttributeValue.getPatientAttribute().getValueType() ) )
- {
- patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue
- .getPatientAttributeOption().getName() );
- }else{
- patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue
- .getValue() );
- }
+ if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttributeValue.getPatientAttribute()
+ .getValueType() ) )
+ {
+ patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
+ patientAttributeValue.getPatientAttributeOption().getName() );
+ }
+ else
+ {
+ patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
+ patientAttributeValue.getValue() );
+ }
}
programs = programService.getAllPrograms();
@@ -257,7 +263,8 @@
return systemIdentifier;
}
- public String getBenicode() {
+ public String getBenicode()
+ {
return benicode;
}
@@ -275,5 +282,5 @@
{
return yearcode;
}
-
+
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ValidateReportParametersAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ValidateReportParametersAction.java 2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ValidateReportParametersAction.java 2011-03-31 01:49:21 +0000
@@ -103,7 +103,6 @@
public String execute()
throws Exception
{
-
if ( selectedStateManager.getSelectedOrganisationUnit() == null )
{
message = i18n.getString( "please_select_a_reporting_unit" );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ViewRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ViewRecordsAction.java 2009-11-11 00:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ViewRecordsAction.java 2011-03-31 01:49:21 +0000
@@ -49,7 +49,6 @@
public class ViewRecordsAction
implements Action
{
-
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -121,7 +120,6 @@
public String execute()
throws Exception
{
-
programStageInstance = programStageInstanceService.getProgramStageInstance( id );
patient = programStageInstance.getProgramInstance().getPatient();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java 2010-10-25 07:05:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java 2011-03-31 01:49:21 +0000
@@ -29,11 +29,13 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
+import org.hisp.dhis.activityplan.Activity;
+import org.hisp.dhis.activityplan.ActivityPlanService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.patient.Patient;
@@ -43,8 +45,6 @@
import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
import org.hisp.dhis.program.ProgramStageInstance;
-import org.hisp.dhis.activityplan.Activity;
-import org.hisp.dhis.activityplan.ActivityPlanService;
import com.opensymphony.xwork2.Action;
@@ -71,7 +71,7 @@
public void setPatientService( PatientService patientService )
{
this.patientService = patientService;
- }
+ }
private PatientAttributeValueService patientAttributeValueService;
@@ -86,7 +86,7 @@
{
this.patientAttributeService = patientAttributeService;
}
-
+
private ActivityPlanService activityPlanService;
public void setActivityPlanService( ActivityPlanService activityPlanService )
@@ -171,7 +171,7 @@
// ---------------------------------------------------------------------
attributes = patientAttributeService.getAllPatientAttributes();
-
+
// ---------------------------------------------------------------------
// Get the facility planning to do a visit
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java 2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java 2011-03-31 01:49:21 +0000
@@ -70,10 +70,6 @@
public String execute()
throws Exception
{
- // ---------------------------------------------------------------------
- // Validate selected OrganisationUnit
- // ---------------------------------------------------------------------
-
organisationUnit = selectionManager.getSelectedOrganisationUnit();
if ( organisationUnit == null )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DataEntryScreenManager.java 2011-03-22 05:49:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DataEntryScreenManager.java 2011-03-31 01:49:21 +0000
@@ -43,25 +43,25 @@
* @author Abyot Asalefew
* @version $Id$
*/
-public interface DataEntryScreenManager
+public interface DataEntryScreenManager
{
- String getScreenType(ProgramStage programStage);
-
- boolean hasMixOfDimensions(ProgramStage programStage);
-
- boolean hasMultiDimensionalDataElement(ProgramStage programStage);
-
- Collection<Integer> getAllCalculatedDataElements(ProgramStage programStage);
-
- Map<CalculatedDataElement, Map<DataElement, Double>> getNonSavedCalculatedDataElements(ProgramStage programStage);
-
- Map<CalculatedDataElement, Integer> populateValuesForCalculatedDataElements(OrganisationUnit organisationUnit,
- ProgramStage programStage, ProgramStageInstance programStageInstance);
-
- String populateCustomDataEntryScreenForMultiDimensional(String dataEntryFormCode, Collection<PatientDataValue> dataValues,
- Map<CalculatedDataElement, Integer> calculatedValueMap, Map<Integer, MinMaxDataElement> minMaxMap, String disabled,
- I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit);
-
-
+ String getScreenType( ProgramStage programStage );
+
+ boolean hasMixOfDimensions( ProgramStage programStage );
+
+ boolean hasMultiDimensionalDataElement( ProgramStage programStage );
+
+ Collection<Integer> getAllCalculatedDataElements( ProgramStage programStage );
+
+ Map<CalculatedDataElement, Map<DataElement, Double>> getNonSavedCalculatedDataElements( ProgramStage programStage );
+
+ Map<CalculatedDataElement, Integer> populateValuesForCalculatedDataElements( OrganisationUnit organisationUnit,
+ ProgramStage programStage, ProgramStageInstance programStageInstance );
+
+ String populateCustomDataEntryScreenForMultiDimensional( String dataEntryFormCode,
+ Collection<PatientDataValue> dataValues, Map<CalculatedDataElement, Integer> calculatedValueMap,
+ Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n, ProgramStage programStage,
+ ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit );
+
Collection<ProgramStageDataElement> getProgramStageDataElements( String htmlCode );
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DefaultDataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DefaultDataEntryScreenManager.java 2011-03-25 08:20:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/screen/DefaultDataEntryScreenManager.java 2011-03-31 01:49:21 +0000
@@ -115,8 +115,9 @@
}
// -------------------------------------------------------------------------
- // DataEntryScreenManager implementation
+ // Implementation methods
// -------------------------------------------------------------------------
+
public boolean hasMixOfDimensions( ProgramStage programStage )
{
Collection<DataElement> dataElements = programStageDataElementService.getListDataElement( programStage );
@@ -209,82 +210,29 @@
{
Map<CalculatedDataElement, Integer> calculatedValueMap = new HashMap<CalculatedDataElement, Integer>();
- // -------------------------------------------------------------------
- // populateValuesForCalculatedDataElements(...)
- // Will work on this later.
- // -------------------------------------------------------------------
-
- /*
- * CalculatedDataElement cde;
- *
- * Map<String, Integer> factorMap;
- *
- * PatientDataValue dataValue; int factor; int value = 0;
- *
- * Collection<String> operandIds = new ArrayList<String>();
- *
- * for (DataElement dataElement : programStage.getDataElements()) { if
- * (!(dataElement instanceof CalculatedDataElement)) { continue; }
- *
- * cde = (CalculatedDataElement) dataElement;
- *
- * if (cde.isSaved()) { continue; }
- *
- * factorMap = dataElementService.getOperandFactors(cde);
- *
- * operandIds = dataElementService.getOperandIds(cde);
- *
- * for (String operandId : operandIds) { factor =
- * factorMap.get(operandId);
- *
- * String dataElementIdString = operandId.substring(0,
- * operandId.indexOf(SEPARATOR)); String optionComboIdString =
- * operandId.substring(operandId.indexOf(SEPARATOR) + 1,
- * operandId.length());
- *
- * DataElement element =
- * dataElementService.getDataElement(Integer.parseInt
- * (dataElementIdString)); DataElementCategoryOptionCombo optionCombo =
- * categoryService
- * .getDataElementCategoryOptionCombo(Integer.parseInt(optionComboIdString
- * ));
- *
- * dataValue = patientDataValueService.getPatientDataValue(
- * programStageInstance, dataElement, organisationUnit );
- *
- * if (dataValue != null) { value +=
- * Integer.parseInt(dataValue.getValue()) * factor; } }
- *
- * calculatedValueMap.put(cde, value);
- *
- * value = 0; }
- */
return calculatedValueMap;
}
public String populateCustomDataEntryScreenForMultiDimensional( String dataEntryFormCode,
Collection<PatientDataValue> dataValues, Map<CalculatedDataElement, Integer> calculatedValueMap,
- Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n,
- ProgramStage programStage, ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit )
+ Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n, ProgramStage programStage,
+ ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit )
{
- // ---------------------------------------------------------------------
- // Populating Custom Value data
- // ---------------------------------------------------------------------
Map<Integer, Collection<PatientDataValue>> mapDataValue = new HashMap<Integer, Collection<PatientDataValue>>();
String result = "";
- result = populateCustomDataEntryForTextBox( dataEntryFormCode, dataValues, calculatedValueMap, disabled,
- i18n, programStage, programStageInstance, organisationUnit, mapDataValue );
+ result = populateCustomDataEntryForTextBox( dataEntryFormCode, dataValues, calculatedValueMap, disabled, i18n,
+ programStage, programStageInstance, organisationUnit, mapDataValue );
- result = populateCustomDataEntryForBoolean( result, dataValues, calculatedValueMap, minMaxMap, disabled,
- i18n, programStage, programStageInstance, organisationUnit, mapDataValue );
+ result = populateCustomDataEntryForBoolean( result, dataValues, calculatedValueMap, minMaxMap, disabled, i18n,
+ programStage, programStageInstance, organisationUnit, mapDataValue );
result = populateCustomDataEntryForMutiDimentionalString( result, dataValues, calculatedValueMap, minMaxMap,
disabled, i18n, programStage, programStageInstance, organisationUnit, mapDataValue );
- result = populateCustomDataEntryForDate( result, dataValues, calculatedValueMap, minMaxMap, disabled,
- i18n, programStage, programStageInstance, organisationUnit, mapDataValue );
+ result = populateCustomDataEntryForDate( result, dataValues, calculatedValueMap, minMaxMap, disabled, i18n,
+ programStage, programStageInstance, organisationUnit, mapDataValue );
result = populateI18nStrings( result, i18n );
@@ -293,28 +241,21 @@
private String populateCustomDataEntryForTextBox( String dataEntryFormCode,
Collection<PatientDataValue> dataValues, Map<CalculatedDataElement, Integer> calculatedValueMap,
- String disabled, I18n i18n, ProgramStage programStage,
- ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
- Map<Integer, Collection<PatientDataValue>> mapDataValue )
+ String disabled, I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance,
+ OrganisationUnit organisationUnit, Map<Integer, Collection<PatientDataValue>> mapDataValue )
{
// ---------------------------------------------------------------------
// Inline Javascript to add to HTML before outputting
// ---------------------------------------------------------------------
final String jsCodeForInputs = " $DISABLED onchange=\"saveValueCustom( this )\" data=\"{compulsory:$COMPULSORY, optionComboId:$OPTIONCOMBOID, dataElementId:$DATAELEMENTID, dataElementName:'$DATAELEMENTNAME', dataElementType:'$DATAELEMENTTYPE', programStageId:$PROGRAMSTAGEID, programStageName: '$PROGRAMSTAGENAME', orgUnitName:'$ORGUNITNAME'}\" onkeypress=\"return keyPress(event, this)\" ";
- // final String historyCode =
- // " ondblclick='javascript:viewHistory( $DATAELEMENTID, $OPTIONCOMBOID, true )' ";
+
final String calDataElementCode = " class=\"calculated\" disabled ";
// ---------------------------------------------------------------------
// Metadata code to add to HTML before outputting
// ---------------------------------------------------------------------
- // final String metaDataCode =
- // "<span id=\"value[$DATAELEMENTID].name\" title=\"$DATAELEMENTID].name\" style=\"display:none\">$DATAELEMENTNAME</span>"
- // +
- // "<span id=\"value[$DATAELEMENTID].type\" style=\"display:none\">$DATAELEMENTTYPE</span>";
-
StringBuffer sb = new StringBuffer();
// ---------------------------------------------------------------------
@@ -342,6 +283,7 @@
// -----------------------------------------------------------------
// Get HTML input field code
// -----------------------------------------------------------------
+
String compulsory = "null";
String dataElementCode = dataElementMatcher.group( 1 );
@@ -349,7 +291,6 @@
if ( identifierMatcher.find() && identifierMatcher.groupCount() > 0 )
{
-
// -------------------------------------------------------------
// Get data element ID of data element
// -------------------------------------------------------------
@@ -416,7 +357,7 @@
}
patientDataValue = getValue( patientDataValues, dataElementId, optionComboId );
- // logger.info( "patientDataValue: " + patientDataValue );
+
dataElementValue = patientDataValue != null ? patientDataValue.getValue() : dataElementValue;
}
else
@@ -481,8 +422,6 @@
appendCode += " />";
- // appendCode += metaDataCode;
-
// -----------------------------------------------------------
// Check if this dataElement is from another programStage then
// disable
@@ -495,6 +434,7 @@
// -----------------------------------------------------------
// Add ProvidedByOtherFacility checkbox
// -----------------------------------------------------------
+
appendCode = addProvidedByOtherFacilityCheckbox( appendCode, patientDataValue );
}
@@ -529,7 +469,6 @@
appendCode = appendCode.replace( "$DISABLED", disabled );
appendCode = appendCode.replace( "$COMPULSORY", compulsory );
appendCode = appendCode.replace( "$SAVEMODE", "false" );
- // logger.info( "after add js : " + appendCode );
dataElementMatcher.appendReplacement( sb, appendCode );
}
@@ -542,8 +481,8 @@
private String populateCustomDataEntryForBoolean( String dataEntryFormCode,
Collection<PatientDataValue> dataValues, Map<CalculatedDataElement, Integer> calculatedValueMap,
- Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n,
- ProgramStage programStage, ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
+ Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n, ProgramStage programStage,
+ ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
Map<Integer, Collection<PatientDataValue>> mapDataValue )
{
@@ -807,8 +746,8 @@
private String populateCustomDataEntryForMutiDimentionalString( String dataEntryFormCode,
Collection<PatientDataValue> dataValues, Map<CalculatedDataElement, Integer> calculatedValueMap,
- Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n,
- ProgramStage programStage, ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
+ Map<Integer, MinMaxDataElement> minMaxMap, String disabled, I18n i18n, ProgramStage programStage,
+ ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
Map<Integer, Collection<PatientDataValue>> mapDataValue )
{
@@ -1061,9 +1000,8 @@
private String populateCustomDataEntryForDate( String dataEntryFormCode, Collection<PatientDataValue> dataValues,
Map<CalculatedDataElement, Integer> calculatedValueMap, Map<Integer, MinMaxDataElement> minMaxMap,
- String disabled, I18n i18n, ProgramStage programStage,
- ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit,
- Map<Integer, Collection<PatientDataValue>> mapDataValue )
+ String disabled, I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance,
+ OrganisationUnit organisationUnit, Map<Integer, Collection<PatientDataValue>> mapDataValue )
{
// ---------------------------------------------------------------------
@@ -1074,16 +1012,14 @@
// final String historyCode =
// " ondblclick='javascript:viewHistory( $DATAELEMENTID, $OPTIONCOMBOID, true )' ";
// final String calDataElementCode = " class=\"calculated\" disabled ";
-
-
-
+
// ---------------------------------------------------------------------
// Metadata code to add to HTML before outputting
- // ---------------------------------------------------------------------
-
- final String jQueryCalendar = "<script> " +
- "datePicker(\"value\\\\\\\\[$PROGRAMSTAGEID\\\\\\\\]\\\\\\\\.date\\\\\\\\:value\\\\\\\\[$DATAELEMENTID\\\\\\\\]\\\\\\\\.date\", false)" +
- ";</script>";
+ // ---------------------------------------------------------------------
+
+ final String jQueryCalendar = "<script> "
+ + "datePicker(\"value\\\\\\\\[$PROGRAMSTAGEID\\\\\\\\]\\\\\\\\.date\\\\\\\\:value\\\\\\\\[$DATAELEMENTID\\\\\\\\]\\\\\\\\.date\", false)"
+ + ";</script>";
final String metaDataCode = "<span id=\"value[$DATAELEMENTID].name\" style=\"display:none\">$DATAELEMENTNAME</span>"
+ "<span id=\"value[$DATAELEMENTID].type\" style=\"display:none\">$DATAELEMENTTYPE</span>";
@@ -1228,7 +1164,7 @@
// -------------------------------------------------------------
// Remove placeholder view attribute from input field
// -------------------------------------------------------------
-
+
dataElementCode = dataElementCode.replaceAll( "view=\".*?\"", "" );
// -------------------------------------------------------------
// Append Javascript code and meta data (type/min/max) for
@@ -1238,10 +1174,9 @@
String appendCode = dataElementCode + "/>";
appendCode = appendCode.replace( "name=\"entryfield\"", jsCodeForDate );
- //appendCode += "</script>";
+ // appendCode += "</script>";
appendCode += metaDataCode;
-
// -----------------------------------------------------------
// Check if this dataElement is from another programStage then
@@ -1256,14 +1191,13 @@
else
{
appendCode += jQueryCalendar;
-
+
// -----------------------------------------------------------
// Add ProvidedByOtherFacility checkbox
// -----------------------------------------------------------
appendCode = addProvidedByOtherFacilityCheckbox( appendCode, patientDataValue );
-
- }
-
+
+ }
// -----------------------------------------------------------
// Get Org Unit name
@@ -1280,27 +1214,27 @@
orgUnitName = patientDataValue.getOrganisationUnit().getName();
}
}
-
+
appendCode = appendCode.replace( "$DATAELEMENTID", String.valueOf( dataElementId ) );
-
+
appendCode = appendCode.replace( "$PROGRAMSTAGEID", String.valueOf( programStageId ) );
-
+
appendCode = appendCode.replace( "$PROGRAMSTAGENAME", programStageName );
-
+
appendCode = appendCode.replace( "$ORGUNITNAME", orgUnitName );
-
+
appendCode = appendCode.replace( "$DATAELEMENTNAME", dataElement.getName() );
-
+
appendCode = appendCode.replace( "$DATAELEMENTTYPE", dataElementType );
-
+
appendCode = appendCode.replace( "$DISABLED", disabled );
-
+
appendCode = appendCode.replace( "$COMPULSORY", compulsory );
-
+
appendCode = appendCode.replace( "$SAVEMODE", "false" );
-
+
appendCode = appendCode.replaceAll( "\\$", "\\\\\\$" );
-
+
dataElementMatcher.appendReplacement( sb, appendCode );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultPeriodGenericManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultPeriodGenericManager.java 2011-01-05 01:13:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultPeriodGenericManager.java 2011-03-31 01:49:21 +0000
@@ -48,12 +48,10 @@
public class DefaultPeriodGenericManager
implements PeriodGenericManager
{
-
private static final Log log = LogFactory.getLog( DefaultPeriodGenericManager.class );
-
public static final String SESSION_KEY_SELECTED_PERIOD_TYPE = "SESSION_KEY_SELECTED_PERIOD_TYPE";
-
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -64,12 +62,11 @@
{
this.periodService = periodService;
}
-
-
- // -------------------------------------------------------------------------
- // Period
- // -------------------------------------------------------------------------
-
+
+ // -------------------------------------------------------------------------
+ // Implementation methodss
+ // -------------------------------------------------------------------------
+
public void setSelectedPeriodIndex( String key, Integer index )
{
getSession().put( key, index );
@@ -108,7 +105,7 @@
public List<Period> getPeriodList( String key, String baseKey )
{
Period basePeriod = getBasePeriod( baseKey );
-
+
CalendarPeriodType periodType = (CalendarPeriodType) getPeriodType();
List<Period> periods = periodType.generatePeriods( basePeriod );
@@ -116,7 +113,7 @@
Date now = new Date();
Iterator<Period> iterator = periods.iterator();
-
+
while ( iterator.hasNext() )
{
if ( iterator.next().getStartDate().after( now ) )
@@ -124,10 +121,10 @@
iterator.remove();
}
}
-
+
return periods;
}
-
+
public void nextPeriodSpan( String key, String baseKey )
{
List<Period> periods = getPeriodList( key, baseKey );
@@ -136,7 +133,9 @@
Period basePeriod = periods.get( periods.size() - 1 );
Period newBasePeriod = periodType.getNextPeriod( basePeriod );
- if ( newBasePeriod.getStartDate().before( new Date() ) ) // Future periods not allowed
+ if ( newBasePeriod.getStartDate().before( new Date() ) ) // Future
+ // periods not
+ // allowed
{
getSession().put( baseKey, newBasePeriod );
}
@@ -144,7 +143,7 @@
public void previousPeriodSpan( String key, String baseKey )
{
- List<Period> periods = getPeriodList(key, baseKey);
+ List<Period> periods = getPeriodList( key, baseKey );
CalendarPeriodType periodType = (CalendarPeriodType) getPeriodType();
Period basePeriod = periods.get( 0 );
@@ -154,7 +153,7 @@
}
// -------------------------------------------------------------------------
- // Support methods
+ // Supporting methods
// -------------------------------------------------------------------------
private PeriodType getPeriodType()
@@ -165,7 +164,7 @@
private Period getBasePeriod( String baseKey )
{
Period basePeriod = (Period) getSession().get( baseKey );
-
+
PeriodType periodType = getPeriodType();
if ( basePeriod == null )
@@ -196,8 +195,8 @@
{
getSession().put( SESSION_KEY_SELECTED_PERIOD_TYPE, periodService.getPeriodTypeByName( periodTypeName ) );
}
-
- public void clearBasePeriod( )
+
+ public void clearBasePeriod()
{
getSession().remove( SESSION_KEY_BASE_PERIOD_START );
getSession().remove( SESSION_KEY_BASE_PERIOD_END );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java 2011-02-22 23:17:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java 2011-03-31 01:49:21 +0000
@@ -87,7 +87,7 @@
}
// -------------------------------------------------------------------------
- // SelectedStateManager implementation
+ // Implementation methods
// -------------------------------------------------------------------------
public OrganisationUnit getSelectedOrganisationUnit()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/NextPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/NextPeriodsAction.java 2011-01-05 01:13:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/NextPeriodsAction.java 2011-03-31 01:49:21 +0000
@@ -77,7 +77,7 @@
{
this.index = index;
}
-
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -98,11 +98,11 @@
selectedPeriodKey = PeriodGenericManager.SESSION_KEY_SELECTED_PERIOD_INDEX_END;
basePeriodKey = PeriodGenericManager.SESSION_KEY_BASE_PERIOD_END;
}
-
+
periodGenericManager.setSelectedPeriodIndex( selectedPeriodKey, index );
- periodGenericManager.nextPeriodSpan(selectedPeriodKey, basePeriodKey);
+ periodGenericManager.nextPeriodSpan( selectedPeriodKey, basePeriodKey );
- periods = periodGenericManager.getPeriodList(selectedPeriodKey, basePeriodKey);
+ periods = periodGenericManager.getPeriodList( selectedPeriodKey, basePeriodKey );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/PeriodGenericManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/PeriodGenericManager.java 2011-01-05 01:13:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/PeriodGenericManager.java 2011-03-31 01:49:21 +0000
@@ -36,31 +36,32 @@
* @version $Id$
*/
public interface PeriodGenericManager
-{
-
+{
public static final String SESSION_KEY_BASE_PERIOD_START = "SESSION_KEY_BASE_PERIOD_START";
+
public static final String SESSION_KEY_BASE_PERIOD_END = "SESSION_KEY_BASE_PERIOD_END";
public static final String SESSION_KEY_SELECTED_PERIOD_INDEX_START = "SESSION_KEY_SELECTED_PERIOD_INDEX_START";
+
public static final String SESSION_KEY_SELECTED_PERIOD_INDEX_END = "SESSION_KEY_SELECTED_PERIOD_INDEX_END";
-
+
public void setSelectedPeriodIndex( String key, Integer index );
public Integer getSelectedPeriodIndex( String key );
-
- public Period getSelectedPeriod( String key, String baseKey );
-
+
+ public Period getSelectedPeriod( String key, String baseKey );
+
public void setPeriodType( String periodTypeName );
- public void clearSelectedPeriod( );
-
- public void clearBasePeriod( );
+ public void clearSelectedPeriod();
+
+ public void clearBasePeriod();
public List<Period> getPeriodList( String key, String baseKey );
public void nextPeriodSpan( String key, String baseKey );
public void previousPeriodSpan( String key, String baseKey );
-
+
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java 2011-03-31 01:49:21 +0000
@@ -38,41 +38,41 @@
*/
public interface SelectedStateManager
{
- OrganisationUnit getSelectedOrganisationUnit();
-
+ OrganisationUnit getSelectedOrganisationUnit();
+
void setSelectedPatient( Patient patient );
Patient getSelectedPatient();
void clearSelectedPatient();
-
+
void setSelectedProgram( Program program );
Program getSelectedProgram();
void clearSelectedProgram();
-
- void setSelectedProgramStage( ProgramStage programStage );
-
- ProgramStage getSelectedProgramStage();
+
+ void setSelectedProgramStage( ProgramStage programStage );
+
+ ProgramStage getSelectedProgramStage();
void clearSelectedProgramStage();
-
+
void setListAll( boolean listAll );
-
+
boolean getListAll();
-
+
void clearListAll();
-
+
void setSearchingAttributeId( int searchingAttributeId );
-
+
Integer getSearchingAttributeId();
-
+
void clearSearchingAttributeId();
-
+
void setSearchText( String searchText );
-
+
String getSearchText();
-
- void clearSearchTest();
+
+ void clearSearchTest();
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2011-03-24 03:34:53 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2011-03-31 01:49:21 +0000
@@ -83,7 +83,6 @@
addOption('eDateLB', item.name , i );
});
}
-
function validationCaseAggregation( )
{
@@ -129,4 +128,4 @@
width: 800,
height: 400
});
-}
+