← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7024: (patient) Removed program attribute.

 

------------------------------------------------------------
revno: 7024
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-24 10:10:00 +0700
message:
  (patient) Removed program attribute.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.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/patient/hibernate/PatientAttribute.hbm.xml
  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/updatePatientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java
  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/addPatientAttributeForm.vm
  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/updatePatientAttibuteForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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/PatientAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2012-05-24 03:10:00 +0000
@@ -69,8 +69,6 @@
 
     private boolean inheritable;
 
-    private Integer noChars;
-
     private Boolean groupBy;
 
     private PatientAttributeGroup patientAttributeGroup;
@@ -147,16 +145,6 @@
         attributeOptions.add( option );
     }
 
-    public Integer getNoChars()
-    {
-        return noChars;
-    }
-
-    public void setNoChars( Integer noChars )
-    {
-        this.noChars = noChars;
-    }
-
     public Boolean isGroupBy()
     {
         return groupBy;

=== 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	2012-05-23 19:48:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2012-05-24 03:10:00 +0000
@@ -88,10 +88,13 @@
         executeSql( "ALTER TABLE program DROP COLUMN singleevent" );
         executeSql( "ALTER TABLE program DROP COLUMN anonymous" ); 
         executeSql( "UPDATE program SET type=1 where type is null" );
+        
         executeSql( "DROP TABLE programattributevalue" );
         executeSql( "DROP TABLE programinstance_attributes");
         executeSql( "DROP TABLE programattributeoption" );
         executeSql( "DROP TABLE programattribute" );
+        
+        executeSql( "ALTER TABLE patientattribute DROP COLUMN noChars" );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml	2012-05-24 03:10:00 +0000
@@ -22,8 +22,6 @@
 
     <property name="inheritable" column="inheritable" />
 
-    <property name="noChars" />
-
     <property name="groupBy" column="groupby" />
 
     <many-to-one name="patientAttributeGroup" column="patientattributegroupid" class="org.hisp.dhis.patient.PatientAttributeGroup"

=== 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	2012-04-27 07:40:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-05-24 03:10:00 +0000
@@ -142,7 +142,7 @@
 						#end
 					</select>
 				#else 
-					<input type="text" id="attr$attribute.id" name="attr$attribute.id" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" />
+					<input type="text" id="attr$attribute.id" name="attr$attribute.id" class="{validate:{required:$attribute.mandatory #if($attribute.valueType=='NUMBER'),number:true #end }}" />
 				#end
 			</td>		
 		</tr>
@@ -180,7 +180,7 @@
 						#end
 					</select>
 				#else 
-					<input type="text" id="attr$attribute.id" name="attr$attribute.id" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" />
+					<input type="text" id="attr$attribute.id" name="attr$attribute.id" class="{validate:{required:$attribute.mandatory #if($attribute.valueType=='NUMBER'),number:true #end }}" />
 				#end
 			</td>		
 		</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-04-17 04:39:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-05-24 03:10:00 +0000
@@ -144,7 +144,7 @@
 	<tr>
 		<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
 		<td class="input-column">
-			<input type="text" id="phoneNumber" name="phoneNumber" style='width:25px' value="$!patient.phoneNumber" />
+			<input type="text" id="phoneNumber" name="phoneNumber" value="$!patient.phoneNumber" />
 		</td>
 	</tr>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java	2012-05-24 03:10:00 +0000
@@ -95,16 +95,16 @@
         this.valueType = valueType;
     }
 
-    private boolean mandatory;
+    private Boolean mandatory;
 
-    public void setMandatory( boolean mandatory )
+    public void setMandatory( Boolean mandatory )
     {
         this.mandatory = mandatory;
     }
 
-    private boolean inheritable;
+    private Boolean inheritable;
 
-    public void setInheritable( boolean inheritable )
+    public void setInheritable( Boolean inheritable )
     {
         this.inheritable = inheritable;
     }
@@ -116,20 +116,6 @@
         this.attrOptions = attrOptions;
     }
 
-    private Integer noChars;
-
-    public void setNoChars( Integer noChars )
-    {
-        this.noChars = noChars;
-    }
-
-    private boolean groupBy;
-
-    public void setGroupBy( boolean groupBy )
-    {
-        this.groupBy = groupBy;
-    }
-
     private Integer programId;
 
     public void setProgramId( Integer programId )
@@ -149,24 +135,16 @@
         patientAttribute.setName( name );
         patientAttribute.setDescription( description );
         patientAttribute.setValueType( valueType );
+        
+        mandatory = (mandatory == null) ? false : true;
         patientAttribute.setMandatory( mandatory );
+        
+        inheritable = (inheritable == null) ? false : true;
         patientAttribute.setInheritable( inheritable );
-        patientAttribute.setNoChars( noChars );
-
+        
         Program program = (programId != null) ? programService.getProgram( programId ) : null;
         patientAttribute.setProgram( program );
 
-        patientAttribute.setGroupBy( groupBy );
-        if ( groupBy )
-        {
-            PatientAttribute patientAtt = patientAttributeService.getPatientAttributeByGroupBy( true );
-            if ( patientAtt != null )
-            {
-                patientAtt.setGroupBy( false );
-                patientAttributeService.updatePatientAttribute( patientAtt );
-            }
-            patientAttribute.setMandatory( true );
-        }
         patientAttributeService.savePatientAttribute( patientAttribute );
 
         if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( valueType ) )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java	2012-05-24 03:10:00 +0000
@@ -117,16 +117,16 @@
         this.valueType = valueType;
     }
 
-    private boolean mandatory;
+    private Boolean mandatory;
 
-    public void setMandatory( boolean mandatory )
+    public void setMandatory( Boolean mandatory )
     {
         this.mandatory = mandatory;
     }
 
-    private boolean inheritable;
+    private Boolean inheritable;
 
-    public void setInheritable( boolean inheritable )
+    public void setInheritable( Boolean inheritable )
     {
         this.inheritable = inheritable;
     }
@@ -137,21 +137,7 @@
     {
         this.attrOptions = attrOptions;
     }
-
-    private Integer noChars;
-
-    public void setNoChars( Integer noChars )
-    {
-        this.noChars = noChars;
-    }
-
-    private boolean groupBy;
-
-    public void setGroupBy( boolean groupBy )
-    {
-        this.groupBy = groupBy;
-    }
-
+    
     private Integer programId;
 
     public void setProgramId( Integer programId )
@@ -171,24 +157,16 @@
         patientAttribute.setName( name );
         patientAttribute.setDescription( description );
         patientAttribute.setValueType( valueType );
+        
+        mandatory = (mandatory == null) ? false : true;
         patientAttribute.setMandatory( mandatory );
+        
+        inheritable = (inheritable == null) ? false : true;
         patientAttribute.setInheritable( inheritable );
-        patientAttribute.setNoChars( noChars );
+        
         Program program = (programId != null) ? programService.getProgram( programId ) : null;
         patientAttribute.setProgram( program );
 
-        if ( groupBy )
-        {
-            PatientAttribute patientAtt = patientAttributeService.getPatientAttributeByGroupBy( true );
-            if ( patientAtt != null )
-            {
-                patientAtt.setGroupBy( false );
-                patientAttributeService.updatePatientAttribute( patientAtt );
-            }
-            patientAttribute.setMandatory( true );
-        }
-        patientAttribute.setGroupBy( groupBy );
-
         HttpServletRequest request = ServletActionContext.getRequest();
 
         Collection<PatientAttributeOption> attributeOptions = patientAttributeOptionService.get( patientAttribute );

=== 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	2012-05-23 19:48:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2012-05-24 03:10:00 +0000
@@ -144,8 +144,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">
 				/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm</param>
-			<param name="javascripts">javascript/patientAttribute.js
-				,../dhis-web-commons/javascripts/jQuery/ui/jquery.cluetip.min.js</param>
+			<param name="javascripts">javascript/patientAttribute.js</param>
 			<param name="stylesheets">style/basic.css</param>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
 		</action>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2012-05-24 03:10:00 +0000
@@ -24,10 +24,7 @@
     <tr>
 		<td><label for="mandatory">$i18n.getString( "mandatory" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td>
-			<select id="mandatory" name="mandatory">
-				<option value="true" >$i18n.getString( "yes" )</option>
-				<option value="false" selected="selected">$i18n.getString( "no" )</option>
-			</select>
+			<input type='checkbox' id="mandatory" name="mandatory" value='true'>
 		</td>		
 		<td></td>				
 	</tr>
@@ -35,17 +32,7 @@
     <tr>
     	<td><label for="inheritable">$i18n.getString( "inheritable" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td>
-			<select id="inheritable" name="inheritable">
-				<option value="true" >$i18n.getString( "yes" )</option>
-				<option value="false" selected="selected">$i18n.getString( "no" )</option>
-			</select>
-		</td>		
-		<td></td>				
-	</tr>
-    <tr>
-		<td><label for="noChar">$i18n.getString( "no_of_char" )</label></td>
-		<td>
-			<input type="text" name="noChars" id="noChars" class="{validate:{required:false, number:true}}" />
+			<input type='checkbox' id="inheritable" name="inheritable" value='true'>
 		</td>		
 		<td></td>				
 	</tr>
@@ -83,10 +70,6 @@
 		<td></td>				
 	</tr> 
 	
-	<tr>
-    	<td><label for="groupBy">$i18n.getString( "groupBy" )</td>
-    	<td><input type="checkbox" name="groupBy" value="true"/></td>
-    </tr>
     </tbody>
 	<tr>
 		<td></td>

=== 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	2012-05-23 16:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-05-24 03:10:00 +0000
@@ -39,7 +39,7 @@
 		
 		<tr>
 			<td><label>$i18n.getString( "show_provided_provided_elsewhere" )</label></td>
-			<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='false'></td>
+			<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true'></td>
 			<td></td>
 		</tr>
 		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2012-05-24 03:10:00 +0000
@@ -27,10 +27,7 @@
       <tr>
 		<td><label for="mandatory">$i18n.getString( "mandatory" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td>
-			<select id="mandatory" name="mandatory">
-				<option value="true" #if( $patientAttribute.mandatory ) selected="selected" #end>$i18n.getString( "yes" )</option>
-				<option value="false" #if( !$patientAttribute.mandatory ) selected="selected" #end>$i18n.getString( "no" )</option>
-			</select>
+			<input type='checkbox' id="mandatory" name="mandatory" value='true' #if( $patientAttribute.mandatory ) checked #end>
 		</td>		
 		<td></td>				
 	</tr>
@@ -38,17 +35,7 @@
 	<tr>
 		<td><label for="inheritable">$i18n.getString( "inheritable" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td>
-			<select id="inheritable" name="inheritable">
-				<option value="true" #if( $patientAttribute.inheritable) selected="selected" #end>$i18n.getString( "yes" )</option>
-				<option value="false" #if( !$patientAttribute.inheritable) selected="selected" #end>$i18n.getString( "no" )</option>
-			</select>
-		</td>		
-		<td></td>				
-	</tr>
-	<tr>
-		<td><label for="noChar">$i18n.getString( "no_of_char" )</label></td>
-		<td>
-			<input type="text" name="noChars" id="noChars" class="{validate:{required:false, number:true}}" value="$!patientAttribute.noChars">
+			<input type='checkbox' id="inheritable" name="inheritable" value='true' #if( $patientAttribute.inheritable) checked #end>		
 		</td>		
 		<td></td>				
 	</tr>
@@ -93,10 +80,6 @@
 		<td></td>				
 	</tr> 
 	
-	<tr>
-    	<td><label for="groupBy">$i18n.getString( "groupBy" )</td>
-    	<td><input type="checkbox" name="groupBy" value="true" #if( $patientAttribute.groupBy == 'true' ) checked #end></td>
-    </tr>
     </tbody>
 	
 	<tr>

=== 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	2012-05-23 16:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-05-24 03:10:00 +0000
@@ -38,7 +38,7 @@
 		
 	<tr>
 		<td><label>$i18n.getString( "show_provided_provided_elsewhere" )</label></td>
-		<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='false' #if( $program.displayProvidedOtherFacility=='false' ) checked #end ></td>
+		<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true' #if( $program.displayProvidedOtherFacility=='false' ) checked #end ></td>
 		<td></td>
 	</tr>