dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14651
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5049: Add a property Irregular Encounter into program-stage.
------------------------------------------------------------
revno: 5049
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-27 10:12:50 +0700
message:
Add a property Irregular Encounter into program-stage.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
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/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm
--
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/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2011-10-27 03:12:50 +0000
@@ -53,6 +53,8 @@
private int minDaysFromStart;
+ private Boolean irregular;
+
private Program program;
private Set<ProgramStageDataElement> programStageDataElements = new HashSet<ProgramStageDataElement>();
@@ -175,6 +177,16 @@
this.description = description;
}
+ public Boolean getIrregular()
+ {
+ return irregular;
+ }
+
+ public void setIrregular( Boolean irregular )
+ {
+ this.irregular = irregular;
+ }
+
/**
* @return the stageInProgram
*/
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2011-10-27 03:12:50 +0000
@@ -107,6 +107,8 @@
executeSql( "UPDATE dataset SET version = 1 WHERE version is null" );
executeSql( "UPDATE program SET singleevent = false WHERE singleevent is null" );
+
+ executeSql( "UPDATE programstage SET irregular = false WHERE irregular is null" );
updateSingleProgramValidation();
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2011-08-26 05:09:51 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2011-10-27 03:12:50 +0000
@@ -20,6 +20,8 @@
<many-to-one name="program" class="org.hisp.dhis.program.Program" column="programid" foreign-key="fk_programstage_program" />
+ <property name="irregular" column="irregular" />
+
<set name="programStageDataElements" order-by="sort_order" >
<key column="programstageid" />
<one-to-many class="org.hisp.dhis.program.ProgramStageDataElement" />
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2011-06-28 04:00:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2011-10-27 03:12:50 +0000
@@ -132,6 +132,13 @@
this.compulsories = compulsories;
}
+ private Boolean irregular;
+
+ public void setIrregular( Boolean irregular )
+ {
+ this.irregular = irregular;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -148,6 +155,9 @@
programStage.setDescription( description );
programStage.setStageInProgram( program.getProgramStages().size() + 1 );
programStage.setProgram( program );
+
+ irregular = irregular ? irregular : false;
+ programStage.setIrregular(irregular);
minDaysFromStart = (minDaysFromStart == null) ? 0 : minDaysFromStart;
programStage.setMinDaysFromStart( minDaysFromStart );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2011-06-28 04:00:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2011-10-27 03:12:50 +0000
@@ -127,6 +127,13 @@
return programId;
}
+ private Boolean irregular;
+
+ public void setIrregular( Boolean irregular )
+ {
+ this.irregular = irregular;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -135,14 +142,16 @@
throws Exception
{
ProgramStage programStage = programStageService.getProgramStage( id );
-
+
programStage.setName( name );
-
programStage.setDescription( description );
minDaysFromStart = (minDaysFromStart == null) ? 0 : minDaysFromStart;
programStage.setMinDaysFromStart( minDaysFromStart );
+ irregular = irregular ? irregular : false;
+ programStage.setIrregular( irregular );
+
programStageService.updateProgramStage( programStage );
Set<ProgramStageDataElement> programStageDataElements = new HashSet<ProgramStageDataElement>( programStage
@@ -177,7 +186,7 @@
{
programStageDataElementService.deleteProgramStageDataElement( psdeDelete );
}
-
+
programId = programStage.getProgram().getId();
return SUCCESS;
=== 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-10-17 04:04:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-10-27 03:12:50 +0000
@@ -383,4 +383,5 @@
test_condition = Test condition
run_success = Run successful
run_fail = Run failed
-patients_registered = The number of beneficiaries registered
\ No newline at end of file
+patients_registered = The number of beneficiaries registered
+irregular_encounter = Irregular encounter
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-10-05 09:19:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-10-27 03:12:50 +0000
@@ -387,6 +387,7 @@
/dhis-web-maintenance-patient/addProgramStageForm.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
<param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
+ <param name="stylesheets">/dhis-web-maintenance-patient/style/basic.css</param>
<param name="requiredAuthorities">F_PROGRAMSTAGE_ADD</param>
</action>
@@ -420,6 +421,7 @@
/dhis-web-maintenance-patient/updateProgramStageForm.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
<param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
+ <param name="stylesheets">/dhis-web-maintenance-patient/style/basic.css</param>
<param name="requiredAuthorities">F_PROGRAMSTAGE_UPDATE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2011-09-29 04:17:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2011-10-27 03:12:50 +0000
@@ -53,7 +53,12 @@
<tr>
<td><label>$i18n.getString( "program" )</label></td>
<td><input type="text" id="program" name="program" maxlength="30" value="$encoder.htmlEncode( $program.name )" style="width:30em" disabled="disabled"/></td>
- </tr>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "irregular_encounter" )</label></td>
+ <td><input type="checkbox" id="irregular" name="irregular" value='true' /></td>
+ </tr>
<tr><td> </td><td> </td></tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2011-09-29 04:17:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2011-10-27 03:12:50 +0000
@@ -67,7 +67,12 @@
<td><label>$i18n.getString( "program" )</label></td>
<td><input type="text" id="program" name="program" maxlength="30" value="$encoder.htmlEncode( $programStage.program.name )" style="width:30em" disabled="disabled"/></td>
</tr>
-
+
+ <tr>
+ <td><label>$i18n.getString( "irregular_encounter" )</label></td>
+ <td><input type="checkbox" id="irregular" name="irregular" value='true' #if( $programStage.irregular=='true' ) checked #end/></td>
+ </tr>
+
<tr><td> </td><td> </td></tr>
</tbody>