← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11302: Add age option in design registration form.

 

------------------------------------------------------------
revno: 11302
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-07-02 10:54:01 +0700
message:
  Add age option in design registration form.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.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/patientForm.vm
  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/viewPatientRegistationForm.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/patient/PatientRegistrationForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-02-01 08:40:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-07-02 03:54:01 +0000
@@ -40,6 +40,7 @@
     public static String FIXED_ATTRIBUTE_FULLNAME = "fullName";
     public static String FIXED_ATTRIBUTE_GENDER = "gender";
     public static String FIXED_ATTRIBUTE_BIRTHDATE = "birthDate";
+    public static String FIXED_ATTRIBUTE_AGE = "age";
     public static String FIXED_ATTRIBUTE_PHONE_NUMBER = "phoneNumber";
     public static String FIXED_ATTRIBUTE_DEATH_DATE = "deathDate";
     public static String FIXED_ATTRIBUTE_REGISTRATION_DATE = "registrationDate";

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java	2013-05-24 09:10:42 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java	2013-07-02 03:54:01 +0000
@@ -29,14 +29,8 @@
 import static org.hisp.dhis.i18n.I18nUtils.i18n;
 
 import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
 
 import org.hisp.dhis.i18n.I18nService;
-import org.hisp.dhis.period.CalendarPeriodType;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodType;
 import org.springframework.transaction.annotation.Transactional;
 
 /**

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-07-02 02:25:30 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-07-02 03:54:01 +0000
@@ -395,7 +395,13 @@
         {
             inputHtml += " class=\"{validate:{phone:true}}\" " + hidden + " " + TAG_CLOSE;
         }
-
+        
+        // Age fields
+        else if ( fixedAttr.equals( PatientRegistrationForm.FIXED_ATTRIBUTE_AGE ) )
+        {
+            inputHtml += " class=\"{validate:{number:true}}\" " + hidden + " " + TAG_CLOSE;
+        }
+        
         // Gender selector
         if ( fixedAttr.equals( PatientRegistrationForm.FIXED_ATTRIBUTE_GENDER ) )
         {

=== 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	2013-06-20 08:49:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-07-02 03:54:01 +0000
@@ -658,4 +658,5 @@
 section = Section
 orgunit_registered = Organisation registered
 users_in_orgunit_registered = Users in organisation registered
-message_is_sent = Message is sent.
\ No newline at end of file
+message_is_sent = Message is sent.
+enter_age_in_years = Enter age in years...
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-05-29 09:41:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-07-02 03:54:01 +0000
@@ -50,7 +50,7 @@
 				<option value="A" #if($patient.dobType=='A') selected #end >$i18n.getString( "approximated" )</option>
 			</select>
 			<input type="text" id="birthDate" name="birthDate" value='$!format.formatDate($!patient.birthDate)' style='width:136px;' />
-			<input type="text" id="age" name="age" placeholder="Enter age in years..." value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:136px;' />
+			<input type="text" id="age" name="age" placeholder="$i18n.getString('enter_age_in_years')" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:136px;' />
 		</td>
 	</tr>
 

=== 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	2013-06-21 05:12:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-07-02 03:54:01 +0000
@@ -415,4 +415,5 @@
 patient = Person
 orgunit_registered = Organisation unit registered
 all_users_in_orgunit_registered = All users in organisation unit registered
-date_in_future = Date in future
\ No newline at end of file
+date_in_future = Date in future
+age_years = Age(years)
\ 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/viewPatientRegistationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-07-02 02:25:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-07-02 03:54:01 +0000
@@ -131,6 +131,7 @@
 					<option value="gender">$i18n.getString('gender') #if($disableRegistrationFields=='false')*#end</option>
 					<option value="dobType">$i18n.getString('dob_type') #if($disableRegistrationFields=='false')*#end</option>
 					<option value="birthDate">$i18n.getString('birth_date') #if($disableRegistrationFields=='false')*#end</option>
+					<option value="age">$i18n.getString('age_year') #if($disableRegistrationFields=='false')*#end</option>
 					<option value="phoneNumber">$i18n.getString('phone_number')</option>
 					<option value="deathDate">$i18n.getString('death_date')</option>
 					<option value="isDead">$i18n.getString('is_dead')</option>