← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13457: Remove useBirthDateAsIncidentDate and useBirthDateAsEnrollmentDate properties of Program object.

 

------------------------------------------------------------
revno: 13457
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-12-28 22:15:11 +0700
message:
  Remove useBirthDateAsIncidentDate and useBirthDateAsEnrollmentDate properties of Program object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.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/Program.hbm.xml
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm
  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/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2013-12-28 15:15:11 +0000
@@ -129,10 +129,6 @@
      */
     private Boolean displayOnAllOrgunit = true;
 
-    private Boolean useBirthDateAsIncidentDate = false;
-
-    private Boolean useBirthDateAsEnrollmentDate = false;
-
     private Boolean selectEnrollmentDatesInFuture = false;
 
     private Boolean selectIncidentDatesInFuture = false;
@@ -520,33 +516,7 @@
     {
         this.displayOnAllOrgunit = displayOnAllOrgunit;
     }
-
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public Boolean getUseBirthDateAsIncidentDate()
-    {
-        return useBirthDateAsIncidentDate;
-    }
-
-    public void setUseBirthDateAsIncidentDate( Boolean useBirthDateAsIncidentDate )
-    {
-        this.useBirthDateAsIncidentDate = useBirthDateAsIncidentDate;
-    }
-
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public Boolean getUseBirthDateAsEnrollmentDate()
-    {
-        return useBirthDateAsEnrollmentDate;
-    }
-
-    public void setUseBirthDateAsEnrollmentDate( Boolean useBirthDateAsEnrollmentDate )
-    {
-        this.useBirthDateAsEnrollmentDate = useBirthDateAsEnrollmentDate;
-    }
-
+    
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java	2013-12-19 08:23:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/PersonServiceTest.java	2013-12-28 15:15:11 +0000
@@ -90,9 +90,6 @@
         femaleB = createPatient( 'D',  organisationUnitB );
 
         programA = createProgram( 'A', new HashSet<ProgramStage>(), organisationUnitA );
-        programA.setUseBirthDateAsEnrollmentDate( true );
-        programA.setUseBirthDateAsIncidentDate( true );
-
         manager.save( organisationUnitA );
         manager.save( organisationUnitB );
         manager.save( maleA );

=== 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	2013-12-22 14:25:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-12-28 15:15:11 +0000
@@ -286,6 +286,10 @@
         updateCoordinatesProgramStageInstance();
 
         addPatientAttributes();
+        
+
+        executeSql( "ALTER TABLE program DROP COLUMN useBirthDateAsIncidentDate" );
+        executeSql( "ALTER TABLE program DROP COLUMN useBirthDateAsEnrollmentDate" );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2013-09-27 17:04:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2013-12-28 15:15:11 +0000
@@ -81,10 +81,6 @@
 
 		<property name="displayOnAllOrgunit" />
 
-		<property name="useBirthDateAsIncidentDate" />
-
-		<property name="useBirthDateAsEnrollmentDate" />
-
 		<property name="selectEnrollmentDatesInFuture" />
 
 		<property name="selectIncidentDatesInFuture" />

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2013-12-28 15:15:11 +0000
@@ -14,8 +14,6 @@
 	"noIdentifierTypes": "$!program.patientIdentifierTypes.size()",
 	"onlyEnrollOnce": "$!program.onlyEnrollOnce",
 	"displayOnAllOrgunit": "$!program.displayOnAllOrgunit",
-	"useBirthDateAsIncidentDate": "$!program.useBirthDateAsIncidentDate",
-	"useBirthDateAsEnrollmentDate": "$!program.useBirthDateAsEnrollmentDate",
 	"selectEnrollmentDatesInFuture": "$!program.selectEnrollmentDatesInFuture",
 	"selectIncidentDatesInFuture": "$!program.selectIncidentDatesInFuture"
   }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2013-11-04 03:13:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2013-12-28 15:15:11 +0000
@@ -226,20 +226,6 @@
         this.displayOnAllOrgunit = displayOnAllOrgunit;
     }
 
-    private Boolean useBirthDateAsIncidentDate;
-
-    public void setUseBirthDateAsIncidentDate( Boolean useBirthDateAsIncidentDate )
-    {
-        this.useBirthDateAsIncidentDate = useBirthDateAsIncidentDate;
-    }
-
-    private Boolean useBirthDateAsEnrollmentDate;
-
-    public void setUseBirthDateAsEnrollmentDate( Boolean useBirthDateAsEnrollmentDate )
-    {
-        this.useBirthDateAsEnrollmentDate = useBirthDateAsEnrollmentDate;
-    }
-
     private List<Integer> userGroup = new ArrayList<Integer>();
 
     public void setUserGroup( List<Integer> userGroup )
@@ -321,8 +307,6 @@
         ignoreOverdueEvents = (ignoreOverdueEvents == null) ? false : ignoreOverdueEvents;
         onlyEnrollOnce = (onlyEnrollOnce == null) ? false : onlyEnrollOnce;
         displayOnAllOrgunit = (displayOnAllOrgunit == null) ? false : displayOnAllOrgunit;
-        useBirthDateAsIncidentDate = (useBirthDateAsIncidentDate == null) ? false : useBirthDateAsIncidentDate;
-        useBirthDateAsEnrollmentDate = (useBirthDateAsEnrollmentDate == null) ? false : useBirthDateAsEnrollmentDate;
         selectEnrollmentDatesInFuture = (selectEnrollmentDatesInFuture == null) ? false : selectEnrollmentDatesInFuture;
         selectIncidentDatesInFuture = (selectIncidentDatesInFuture == null) ? false : selectIncidentDatesInFuture;
         dataEntryMethod = (dataEntryMethod == null) ? false : dataEntryMethod;
@@ -338,8 +322,6 @@
         program.setDisplayIncidentDate( displayIncidentDate );
         program.setOnlyEnrollOnce( onlyEnrollOnce );
         program.setDisplayOnAllOrgunit( displayOnAllOrgunit );
-        program.setUseBirthDateAsIncidentDate( useBirthDateAsIncidentDate );
-        program.setUseBirthDateAsEnrollmentDate( useBirthDateAsEnrollmentDate );
         program.setSelectEnrollmentDatesInFuture( selectEnrollmentDatesInFuture );
         program.setSelectIncidentDatesInFuture( selectIncidentDatesInFuture );
         program.setDataEntryMethod( dataEntryMethod );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2013-11-14 08:17:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2013-12-28 15:15:11 +0000
@@ -264,20 +264,6 @@
         this.messageType = messageType;
     }
 
-    private Boolean useBirthDateAsIncidentDate;
-
-    public void setUseBirthDateAsIncidentDate( Boolean useBirthDateAsIncidentDate )
-    {
-        this.useBirthDateAsIncidentDate = useBirthDateAsIncidentDate;
-    }
-
-    private Boolean useBirthDateAsEnrollmentDate;
-
-    public void setUseBirthDateAsEnrollmentDate( Boolean useBirthDateAsEnrollmentDate )
-    {
-        this.useBirthDateAsEnrollmentDate = useBirthDateAsEnrollmentDate;
-    }
-
     private List<Integer> userGroup = new ArrayList<Integer>();
 
     public void setUserGroup( List<Integer> userGroup )
@@ -348,8 +334,6 @@
         blockEntryForm = (blockEntryForm == null) ? false : blockEntryForm;
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
         displayOnAllOrgunit = (displayOnAllOrgunit == null) ? false : displayOnAllOrgunit;
-        useBirthDateAsIncidentDate = (useBirthDateAsIncidentDate == null) ? false : useBirthDateAsIncidentDate;
-        useBirthDateAsEnrollmentDate = (useBirthDateAsEnrollmentDate == null) ? false : useBirthDateAsEnrollmentDate;
         selectEnrollmentDatesInFuture = (selectEnrollmentDatesInFuture == null) ? false : selectEnrollmentDatesInFuture;
         selectIncidentDatesInFuture = (selectIncidentDatesInFuture == null) ? false : selectIncidentDatesInFuture;
         dataEntryMethod = (dataEntryMethod == null) ? false : dataEntryMethod;
@@ -364,8 +348,6 @@
         program.setDisplayIncidentDate( displayIncidentDate );
         program.setOnlyEnrollOnce( onlyEnrollOnce );
         program.setDisplayOnAllOrgunit( displayOnAllOrgunit );
-        program.setUseBirthDateAsIncidentDate( useBirthDateAsIncidentDate );
-        program.setUseBirthDateAsEnrollmentDate( useBirthDateAsEnrollmentDate );
         program.setSelectEnrollmentDatesInFuture( selectEnrollmentDatesInFuture );
         program.setSelectIncidentDatesInFuture( selectIncidentDatesInFuture );
         program.setDataEntryMethod( dataEntryMethod );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-12-17 01:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2013-12-28 15:15:11 +0000
@@ -152,19 +152,7 @@
 			<td><input type="checkbox" id="selectIncidentDatesInFuture" name="selectIncidentDatesInFuture" value='true' ></td>
 			<td></td>
 		</tr>
-
-        <tr name='nonAnonymous'>
-            <td><label>$i18n.getString( "use_birth_date_as_incident_date" )</label></td>
-            <td><input type="checkbox" id="useBirthDateAsIncidentDate" name="useBirthDateAsIncidentDate" value='true'></td>
-            <td></td>
-        </tr>
-
-        <tr name='nonAnonymous'>
-            <td><label>$i18n.getString( "use_birth_date_as_enrollment_date" )</label></td>
-            <td><input type="checkbox" id="useBirthDateAsEnrollmentDate" name="useBirthDateAsEnrollmentDate" value='true' ></td>
-            <td></td>
-        </tr>
-
+		
         <tr name='nonAnonymous'>
             <td><label>$i18n.getString( "only_enroll_once" )</label></td>
             <td><input type="checkbox" id="onlyEnrollOnce" name="onlyEnrollOnce" value='true'></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-12-28 15:15:11 +0000
@@ -63,12 +63,6 @@
     var displayOnAllOrgunit = ( json.program.displayOnAllOrgunit == 'true') ? i18n_yes : i18n_no;
     setInnerHTML('displayOnAllOrgunitField', displayOnAllOrgunit);
 
-    var useBirthDateAsIncidentDate = ( json.program.useBirthDateAsIncidentDate == 'true') ? i18n_yes : i18n_no;
-    setInnerHTML('useBirthDateAsIncidentDateField', useBirthDateAsIncidentDate);
-
-    var useBirthDateAsEnrollmentDate = ( json.program.useBirthDateAsEnrollmentDate == 'true') ? i18n_yes : i18n_no;
-    setInnerHTML('useBirthDateAsEnrollmentDateField', useBirthDateAsEnrollmentDate);
-
     var selectEnrollmentDatesInFuture = ( json.program.selectEnrollmentDatesInFuture == 'true') ? i18n_yes : i18n_no;
     setInnerHTML('selectEnrollmentDatesInFutureField', selectEnrollmentDatesInFuture);
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2013-12-28 15:15:11 +0000
@@ -65,10 +65,8 @@
 				<p><label class="bold">$i18n.getString( "skip_to_generate_overdue_events" ):</label><br><span id="ignoreOverdueEventsField"></span></p>
 				<p><label class="bold">$i18n.getString( "only_enroll_once" ):</label><br><span id="onlyEnrollOnceField"></span></p>
 				<p><label class="bold">$i18n.getString( "allow_enrollment_at_all_orgunits" ):</label><br><span id="displayOnAllOrgunitField"></span></p>
-				<p><label class="bold">$i18n.getString( "use_birth_date_as_incident_date" ):</label><br><span id="useBirthDateAsIncidentDate"></span></p>                              
 				<p><label class="bold">$i18n.getString( "show_incident_date" ):</label><br><span id="displayIncidentDate"></span></p>                              
 				<p><label class="bold">$i18n.getString( "date_of_incident_description" ):</label><br><span id="dateOfIncidentDescriptionField"></span></p>                              
-				<p><label class="bold">$i18n.getString( "use_birth_date_as_enrollment_date" ):</label><br><span id="useBirthDateAsEnrollmentDate"></span></p>                              
 				<p><label class="bold">$i18n.getString( "date_of_enrollment_description" ):</label><br><span id="dateOfEnrollmentDescriptionField"></span></p>                          
 				<p><label class="bold">$i18n.getString( "number_of_attributes" ):</label><br><span id="noAttributesField"></span></p>
 				<p><label class="bold">$i18n.getString( "number_of_identifier_types" ):</label><br><span id="noIdentifierTypesField"></span></p>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-12-17 01:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2013-12-28 15:15:11 +0000
@@ -158,20 +158,7 @@
 			<td><input type="checkbox" id="selectIncidentDatesInFuture" name="selectIncidentDatesInFuture" value='true' #if($program.selectIncidentDatesInFuture=='true') checked #end ></td>
 			<td></td>
 		</tr>
-
-        <tr name='nonAnonymous'>
-            <td><label>$i18n.getString( "use_birth_date_as_incident_date" )</label></td>
-            <td><input type="checkbox" id="useBirthDateAsIncidentDate" name="useBirthDateAsIncidentDate" value='true' #if($program.useBirthDateAsIncidentDate=='true') checked #end /></td>
-            <td></td>
-        </tr>
-
-        <tr name='nonAnonymous'>
-            <td><label>$i18n.getString( "use_birth_date_as_enrollment_date" )</label></td>
-            <td><input type="checkbox" id="useBirthDateAsEnrollmentDate" name="useBirthDateAsEnrollmentDate" value='true' #if($program.useBirthDateAsEnrollmentDate=='true') checked #end  ></td>
-            <td></td>
-        </tr>
-
-
+		
 		<tr name='nonAnonymous'>
 			<td><label>$i18n.getString( "only_enroll_once" )</label></td>
 			<td><input type="checkbox" id="onlyEnrollOnce" name="onlyEnrollOnce" value='true' onchange='programOnChange();' #if( $program.type!='1' ) disabled #end #if($program.onlyEnrollOnce=='true') checked #end></td>

=== 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-12-18 06:05:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-12-28 15:15:11 +0000
@@ -175,9 +175,9 @@
 		<tr>
 			<td>
 				<select id="programAttrSelector" multiple="multiple" style="width:450px;height:270px" ondblclick="insertElement( 'prg' )">
-					<option value="enrollmentDate" #if($program.useBirthDateAsEnrollmentDate=='false') mandatory='true' #end >$encoder.htmlEncode($program.dateOfEnrollmentDescription) #if($program.useBirthDateAsEnrollmentDate=='false') * #end</option>
+					<option value="enrollmentDate" >$encoder.htmlEncode($program.dateOfEnrollmentDescription)</option>
 					#if($program.displayIncidentDate=='true')
-					<option value="dateOfIncident" #if($program.useBirthDateAsIncidentDate=='false') mandatory='true' #end>$encoder.htmlEncode($program.dateOfIncidentDescription) #if($program.useBirthDateAsIncidentDate=='false') * #end</option>
+					<option value="dateOfIncident" >$encoder.htmlEncode($program.dateOfIncidentDescription)</option>
 					#end
 				</select>
 			</td>