dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09492
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2532: Cannot run Case Aggregation Builder into case-entry-form.
------------------------------------------------------------
revno: 2532
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-01-12 09:22:10 +0700
message:
Cannot run Case Aggregation Builder into case-entry-form.
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/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
--
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 2010-11-25 22:22:10 +0000
+++ 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
@@ -70,7 +70,6 @@
public String execute()
throws Exception
{
-
datasets = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
Iterator<DataSet> dataSetListIterator = datasets.iterator();
=== 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 2010-12-30 10:02:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2011-01-12 02:22:10 +0000
@@ -38,6 +38,7 @@
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
+import org.hisp.dhis.caseentry.state.PeriodGenericManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataset.DataSet;
@@ -50,7 +51,9 @@
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.period.CalendarPeriodType;
import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.user.CurrentUserService;
import com.opensymphony.xwork2.Action;
@@ -61,9 +64,10 @@
Log log = LogFactory.getLog( getClass() );
- // ---------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Dependencies
- // ---------------------------------------------------------------
+ // -------------------------------------------------------------------------
+
private SelectionTreeManager selectionTreeManager;
public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
@@ -99,6 +103,13 @@
this.currentUserService = currentUserService;
}
+ private PeriodGenericManager periodGenericManager;
+
+ public void setPeriodGenericManager( PeriodGenericManager periodGenericManager )
+ {
+ this.periodGenericManager = periodGenericManager;
+ }
+
private I18nFormat format;
public void setFormat( I18nFormat format )
@@ -113,9 +124,9 @@
this.i18n = i18n;
}
- // ---------------------------------------------------------------
+ // -------------------------------------------------------------------------
// Input & Output Parameters
- // ---------------------------------------------------------------
+ // -------------------------------------------------------------------------
private int sDateLB;
@@ -138,18 +149,6 @@
this.facilityLB = facilityLB;
}
- private List<Period> periods;
-
- public List<Period> getPeriods()
- {
- return periods;
- }
-
- public void setPeriods( List<Period> periods )
- {
- this.periods = periods;
- }
-
private Integer dataSetId;
public void setDataSetId( Integer dataSetId )
@@ -174,6 +173,7 @@
mapDataValues = new HashMap<DataValue, String>();
String storedBy = currentUserService.getCurrentUsername() + "_CAE";
+
// ---------------------------------------------------------------------
// Get selected orgunits
// ---------------------------------------------------------------------
@@ -216,11 +216,23 @@
List<Period> periodList = new ArrayList<Period>();
+ periodGenericManager.setSelectedPeriodIndex( PeriodGenericManager.SESSION_KEY_SELECTED_PERIOD_INDEX_START,
+ sDateLB );
+ Period startPeriod = periodGenericManager.getSelectedPeriod(
+ PeriodGenericManager.SESSION_KEY_SELECTED_PERIOD_INDEX_START,
+ PeriodGenericManager.SESSION_KEY_BASE_PERIOD_START );
+
+ periodGenericManager.setSelectedPeriodIndex( PeriodGenericManager.SESSION_KEY_SELECTED_PERIOD_INDEX_END,
+ eDateLB );
+ Period endPeriod = periodGenericManager.getSelectedPeriod(
+ PeriodGenericManager.SESSION_KEY_SELECTED_PERIOD_INDEX_END,
+ PeriodGenericManager.SESSION_KEY_BASE_PERIOD_END );
+
if ( sDateLB != -1 && eDateLB != -1 )
{
- periodList = periods.subList( sDateLB, eDateLB + 1 );
+ periodList = getPeriodList( (CalendarPeriodType)selectedDataSet.getPeriodType(), startPeriod, endPeriod );
}
-
+
// ---------------------------------------------------------------------
// Aggregation
// ---------------------------------------------------------------------
@@ -282,8 +294,12 @@
return SUCCESS;
}
+ // -------------------------------------------------------------------------
+ // Support methods
+ // -------------------------------------------------------------------------
+
// Returns the OrgUnitTree for which Root is the orgUnit
- public List<OrganisationUnit> getChildOrgUnitTree( OrganisationUnit orgUnit )
+ private List<OrganisationUnit> getChildOrgUnitTree( OrganisationUnit orgUnit )
{
List<OrganisationUnit> orgUnitTree = new ArrayList<OrganisationUnit>();
orgUnitTree.add( orgUnit );
@@ -298,4 +314,24 @@
return orgUnitTree;
}
+ private List<Period> getPeriodList( CalendarPeriodType periodType, Period startPeriod, Period endPeriod )
+ {
+ Period period = periodType.createPeriod( startPeriod.getStartDate());
+
+ List<Period> periods = new ArrayList<Period>();
+
+ periods.add( period );
+
+ while ( period.getEndDate().before( endPeriod.getEndDate() ))
+ {
+ period = periodType.getNextPeriod( period ) ;
+ periods.add( period );
+ }
+
+ period = periodType.createPeriod( endPeriod.getStartDate() ) ;
+ periods.add( period );
+
+ return periods;
+ }
+
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2011-01-06 16:37:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2011-01-12 02:22:10 +0000
@@ -361,6 +361,7 @@
ref="org.hisp.dhis.caseaggregation.CaseAggregationConditionService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ <property name="periodGenericManager" ref="org.hisp.dhis.caseentry.state.PeriodGenericManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.state.PeriodGenericManager"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2011-01-05 01:13:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2011-01-12 02:22:10 +0000
@@ -228,11 +228,11 @@
<result name="success" type="velocity-json">/dhis-web-caseentry/responsePeriods.vm</result>
</action>
- <action name="caseAggregationResult" class="org.hisp.dhis.caseentry.action.caseaggregation.LoadPeriodsAction">
+ <!-- <action name="caseAggregationResult" class="org.hisp.dhis.caseentry.action.caseaggregation.LoadPeriodsAction">
<result name="success" type="chain">caseAggregationResultChain</result>
- </action>
+ </action> -->
- <action name="caseAggregationResultChain" class="org.hisp.dhis.caseentry.action.caseaggregation.CaseAggregationResultAction">
+ <action name="caseAggregationResult" class="org.hisp.dhis.caseentry.action.caseaggregation.CaseAggregationResultAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-caseentry/caseAggregationResult.vm</param>
<param name="menu">/dhis-web-caseentry/menu.vm</param>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-01-11 16:52:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-01-12 02:22:10 +0000
@@ -450,7 +450,7 @@
condition = Condition
condition_detail = Condition details
update_case_aggregation_condition = Update Beneficiary Aggregation QueryBuilder
-enrolldate_minus_incidentdate = Enroll Date - Incident Date
+enrolldate_minus_incidentdate = Date of Enrollment - Date of Incident
program_properties = Program properties
not_enough_mandatory_identifier = Not enough data for the mandatory identifier(s)
not_enough_madatory_attribute = Not enough data for the mandatory attribute(s)
@@ -462,3 +462,5 @@
orgunit = Organisation Unit
please_enter_a_valid_full_name = Please enter a valid full name.
program_unenrollment = Program UnEnrollment
+death_date = Death date
+is_dead = isDead