dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18875
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8022: Automatic SMS reminders (WIP).
------------------------------------------------------------
revno: 8022
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-09-10 09:46:35 +0700
message:
Automatic SMS reminders (WIP).
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.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-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm
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/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/javascript/programStage.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2012-09-10 02:46:35 +0000
@@ -43,6 +43,13 @@
public static final String TYPE_SECTION = "section";
public static final String TYPE_CUSTOM = "custom";
+
+ public static final String TEMPLATE_MESSSAGE_PATIENT_NAME = "patient-name";
+ public static final String TEMPLATE_MESSSAGE_PROGRAM_NAME = "program-name";
+ public static final String TEMPLATE_MESSSAGE_PROGAM_STAGE_NAME = "program-stage-name";
+ public static final String TEMPLATE_MESSSAGE_DUE_DATE = "due-date";
+ public static final String TEMPLATE_MESSSAGE_ORGUNIT_NAME = "orgunit-name";
+ public static final String TEMPLATE_MESSSAGE_DAYS_SINCE_DUE_DATE = "days-since-due-date";
/**
* Determines if a de-serialized file is compatible with this class.
@@ -69,6 +76,10 @@
private String reportDateDescription;
+ private Integer daysAllowedSendMessage;
+
+ private String templateMessage;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -152,6 +163,26 @@
this.programStageSections = programStageSections;
}
+ public Integer getDaysAllowedSendMessage()
+ {
+ return daysAllowedSendMessage;
+ }
+
+ public void setDaysAllowedSendMessage( Integer daysAllowedSendMessage )
+ {
+ this.daysAllowedSendMessage = daysAllowedSendMessage;
+ }
+
+ public String getTemplateMessage()
+ {
+ return templateMessage;
+ }
+
+ public void setTemplateMessage( String templateMessage )
+ {
+ this.templateMessage = templateMessage;
+ }
+
public Integer getStandardInterval()
{
return standardInterval;
@@ -241,4 +272,9 @@
return TYPE_DEFAULT;
}
+
+ public String getDefaultTemplateMessage()
+ {
+ return "Dear {person-name}, please come to your appointment on {program-stage-name} at {due-date}";
+ }
}
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2012-09-10 02:46:35 +0000
@@ -41,5 +41,9 @@
<property name="reportDateDescription" />
+ <property name="daysAllowedSendMessage" />
+
+ <property name="templateMessage" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm 2012-09-10 02:46:35 +0000
@@ -8,6 +8,8 @@
"dataElementCount": "${programStageDataElements.size()}",
"standardInterval": "$!programStage.standardInterval",
"reportDateDescription": "$!programStage.reportDateDescription",
+ "daysAllowedSendMessage": "$!programStage.daysAllowedSendMessage",
+ "templateMessage": "$!encoder.jsonEncode($!programStage.templateMessage)",
#set( $size = ${programStageDataElements.size()} )
"dataElement": [
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2012-09-10 02:46:35 +0000
@@ -160,6 +160,20 @@
this.reportDateDescription = reportDateDescription;
}
+ private Integer daysAllowedSendMessage;
+
+ public void setDaysAllowedSendMessage( Integer daysAllowedSendMessage )
+ {
+ this.daysAllowedSendMessage = daysAllowedSendMessage;
+ }
+
+ private String templateMessage;
+
+ public void setTemplateMessage( String templateMessage )
+ {
+ this.templateMessage = templateMessage;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -178,6 +192,8 @@
programStage.setProgram( program );
programStage.setStandardInterval( standardInterval );
programStage.setReportDateDescription( reportDateDescription );
+ programStage.setDaysAllowedSendMessage( daysAllowedSendMessage );
+ programStage.setTemplateMessage( templateMessage );
irregular = (irregular == null) ? false : irregular;
programStage.setIrregular( irregular );
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2012-09-10 02:46:35 +0000
@@ -154,7 +154,21 @@
{
this.reportDateDescription = reportDateDescription;
}
-
+
+ private Integer daysAllowedSendMessage;
+
+ public void setDaysAllowedSendMessage( Integer daysAllowedSendMessage )
+ {
+ this.daysAllowedSendMessage = daysAllowedSendMessage;
+ }
+
+ private String templateMessage;
+
+ public void setTemplateMessage( String templateMessage )
+ {
+ this.templateMessage = templateMessage;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -168,6 +182,8 @@
programStage.setDescription( description );
programStage.setStandardInterval( standardInterval );
programStage.setReportDateDescription( reportDateDescription );
+ programStage.setDaysAllowedSendMessage( daysAllowedSendMessage );
+ programStage.setTemplateMessage( templateMessage );
minDaysFromStart = (minDaysFromStart == null) ? 0 : minDaysFromStart;
programStage.setMinDaysFromStart( minDaysFromStart );
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-09-10 02:46:35 +0000
@@ -268,4 +268,13 @@
select_identifiers_and_attributes = Select identifiers / attributes
identifiers_and_attributes = Identifiers / Attributes
displayed_in_list = Displayed in list
-report_date_description = Description of report date
\ No newline at end of file
+report_date_description = Description of report date
+days_allowed_send_message = Days allowed send message
+template_message = Template message
+params = Parameters
+patient_name = Patient name
+program_name = Program name
+program_stage_name = Program stage name
+due_date = Due date
+orgunit_name = Organisation unit name
+days_since_due_date = Days since due date
\ No newline at end of file
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2012-09-10 02:46:35 +0000
@@ -40,7 +40,35 @@
<td><label>$i18n.getString( "report_date_description" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td><input type="text" id="reportDateDescription" name="reportDateDescription" class="{validate:{required:true}}" /></td>
</tr>
-
+
+ <tr>
+ <th colspan='2'>$i18n.getString( "template_message" )</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "days_allowed_send_message" )</label></td>
+ <td><input type="text" id="daysAllowedSendMessage" name="daysAllowedSendMessage" class="{validate:{number:true}}"/></td>
+ </tr>
+
+ <tr>
+ <td>$i18n.getString( "params" )</td>
+ <td>
+ <select multiple size='6' ondblclick="insertParams(this.value);">
+ <option value="{patient-name}">$i18n.getString("patient_name")</option>
+ <option value="{program-name}">$i18n.getString("program_name")</option>
+ <option value="{program-stage-name}">$i18n.getString("program_stage_name")</option>
+ <option value="{due-date}">$i18n.getString("due_date")</option>
+ <option value="{orgunit-name}">$i18n.getString("orgunit_name")</option>
+ <option value="{days-since-due-date}">$i18n.getString("days_since_due_date")</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "template_message" )</label></td>
+ <td><textarea id="templateMessage" name="templateMessage"></textarea></td>
+ </tr>
+
<tr><td> </td><td> </td></tr>
</thead>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2012-09-10 02:46:35 +0000
@@ -62,6 +62,8 @@
setInnerHTML( 'standardIntervalField', json.programStage.standardInterval );
setInnerHTML( 'reportDateDescriptionField', json.programStage.reportDateDescription );
setInnerHTML( 'dataElementCountField', json.programStage.dataElementCount );
+ setInnerHTML( 'daysAllowedSendMessageField', json.programStage.daysAllowedSendMessage );
+ setInnerHTML( 'templateMessageField', json.programStage.templateMessage );
showDetails();
});
@@ -221,4 +223,10 @@
disable('standardInterval');
setFieldValue('standardInterval', '0');
}
+}
+
+function insertParams( paramValue )
+{
+ var templateMessage = paramValue;
+ insertTextCommon('templateMessage', templateMessage);
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm 2012-09-10 02:46:35 +0000
@@ -47,8 +47,11 @@
<p><label class="bold">$i18n.getString( "scheduled_days_from_start" ):</label><br><span id="scheduledDaysFromStartField"></span></p>
<p><label class="bold">$i18n.getString( "irregular" ):</label><br><span id="irregularField"></span></p>
<p><label class="bold">$i18n.getString( "standard_interval_days" ):</label><br><span id="standardIntervalField"></span></p>
- <p><label class="bold">$i18n.getString( "report_date_description" ):</label><br><span id="reportDateDescriptionField">reportDateDescription</span></p>
- <p><label class="bold">$i18n.getString( "no_of_dataelements" ):</label><br><span id="dataElementCountField"></span></p>
+ <p><label class="bold">$i18n.getString( "report_date_description" ):</label><br><span id="reportDateDescriptionField"></span></p>
+ <p><label class="bold">$i18n.getString( "no_of_dataelements" ):</label><br><span id="dataElementCountField"></span></p>
+ <p><label class="bold">$i18n.getString( "days_allowed_send_message" ):</label><br><span id="daysAllowedSendMessageField"></span></p>
+ <p><label class="bold">$i18n.getString( "template_message" ):</label><br><span id="templateMessageField"></span></p>
+
</div>
</td>
</tr>
=== 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 2012-09-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2012-09-10 02:46:35 +0000
@@ -42,6 +42,35 @@
<td><input type="text" id="reportDateDescription" name="reportDateDescription" value='$!programStage.reportDateDescription' class="{validate:{required:true}}" /></td>
</tr>
+
+ <tr>
+ <th colspan='2'>$i18n.getString( "template_message" )</th>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "days_allowed_send_message" )</label></td>
+ <td><input type="text" id="daysAllowedSendMessage" name="daysAllowedSendMessage" class="{validate:{number:true}}" value="$!programStage.daysAllowedSendMessage"/></td>
+ </tr>
+
+ <tr>
+ <td>$i18n.getString( "params" )</td>
+ <td>
+ <select multiple size='6' ondblclick="insertParams(this.value);">
+ <option value="{patient-name}">$i18n.getString("patient_name")</option>
+ <option value="{program-name}">$i18n.getString("program_name")</option>
+ <option value="{program-stage-name}">$i18n.getString("program_stage_name")</option>
+ <option value="{due-date}">$i18n.getString("due_date")</option>
+ <option value="{orgunit-name}">$i18n.getString("orgunit_name")</option>
+ <option value="{days-since-due-date}">$i18n.getString("days_since_due_date")</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "template_message" )</label></td>
+ <td><textarea id="templateMessage" name="templateMessage">$!programStage.templateMessage</textarea></td>
+ </tr>
+
<tr><td> </td></tr>
</tbody>