dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16428
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6249: (patient) Minor fix for tabular report; put validation on max 100 years for age of patient.
------------------------------------------------------------
revno: 6249
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-03-12 17:20:25 +0700
message:
(patient) Minor fix for tabular report; put validation on max 100 years for age of patient.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.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/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-03-12 10:20:25 +0000
@@ -174,7 +174,7 @@
patient.setUnderAge( underAge );
patient.setOrganisationUnit( organisationUnit );
- if ( birthDate != null && !birthDate.isEmpty() )
+ if ( dobType == Patient.DOB_TYPE_VERIFIED || dobType == Patient.DOB_TYPE_DECLARED )
{
birthDate = birthDate.trim();
patient.setBirthDate( format.parseDate( birthDate ) );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java 2012-03-08 08:39:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java 2012-03-12 10:20:25 +0000
@@ -132,6 +132,18 @@
return INPUT;
}
+ if ( dobType != null && dobType == Patient.DOB_TYPE_APPROXIATED )
+ {
+ Patient patient = new Patient();
+ patient.setBirthDateFromAge( age.intValue(), ageType );
+
+ if( patient.getIntegerValueOfAge() > 100 )
+ {
+ message = i18n.getString( "age_of_patient_must_be_less_or_equals_to_100" );
+ return INPUT;
+ }
+ }
+
if ( dobType != null && (dobType == Patient.DOB_TYPE_VERIFIED || dobType == Patient.DOB_TYPE_DECLARED) )
{
birthDate = birthDate.trim();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-12 07:03:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-12 10:20:25 +0000
@@ -278,4 +278,5 @@
order_by_orgunit = Order by organisation unit
order_by_report_date = Order by report date
clear_filter = Clear filter
-selected_orgunit_no_have_any_child = Selected organisation unit no have any child
\ No newline at end of file
+selected_orgunit_no_have_any_child = Selected organisation unit no have any child
+age_of_patient_must_be_less_or_equals_to_100 = Age of beneficiary must be less or equals to 100
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-03-08 04:56:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-03-12 10:20:25 +0000
@@ -189,13 +189,12 @@
function validateUpdatePatient()
{
$("#editPatientDiv :input").attr("disabled", true);
- $.postUTF8( 'validatePatient.action?' + getIdParams( ),
- {
- id: jQuery( '#patientForm [id=id]' ).val(),
- fullName: jQuery( '#patientForm [id=fullName]' ).val(),
- gender: jQuery( '#patientForm [id=gender]' ).val(),
- birthDate: jQuery( '#patientForm [id=birthDate]' ).val()
- }, updateValidationCompleted );
+ $.ajax({
+ type: "POST",
+ url: 'validatePatient.action',
+ data: getParamsForDiv('editPatientDiv'),
+ success:updateValidationCompleted
+ });
}
function updateValidationCompleted( messageElement )