← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11946: Remove displayProvidedOtherFacility property form program-stage. Display providedElsewhere column...

 

------------------------------------------------------------
revno: 11946
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-06 16:06:36 +0700
message:
  Remove displayProvidedOtherFacility property form program-stage. Display providedElsewhere column in entry form if there are at least on data element with allowProvidedElsewhere active in the stage.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataEntryService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.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/java/org/hisp/dhis/program/DefaultProgramDataEntryService.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm
  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/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/programStage.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/patient/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-09-06 08:24:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-09-06 09:06:36 +0000
@@ -51,7 +51,7 @@
 
     public static final String MALE = "M";
     public static final String FEMALE = "F";
-    public static final String TRANSGENDER = "M";
+    public static final String TRANSGENDER = "T";
 
     public static final char DOB_TYPE_VERIFIED = 'V';
     public static final char DOB_TYPE_DECLARED = 'D';

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataEntryService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataEntryService.java	2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramDataEntryService.java	2013-09-06 09:06:36 +0000
@@ -50,9 +50,8 @@
     // ProgramDataEntryService
     // --------------------------------------------------------------------------
 
-    String prepareDataEntryFormForEntry( String htmlCode, Collection<PatientDataValue> dataValues, String disabled,
-        I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance,
-        OrganisationUnit organisationUnit );
+    String prepareDataEntryFormForEntry( String htmlCode, Collection<PatientDataValue> dataValues, I18n i18n,
+        ProgramStage programStage, ProgramStageInstance programStageInstance, OrganisationUnit organisationUnit );
 
     String prepareDataEntryFormForAdd( String htmlCode, I18n i18n, ProgramStage programStage );
 

=== 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	2013-09-05 17:59:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2013-09-06 09:06:36 +0000
@@ -90,8 +90,6 @@
     private Boolean displayGenerateEventBox = true;
 
     private Boolean captureCoordinates = false;
-    
-    private Boolean displayProvidedOtherFacility;
 
     private Boolean blockEntryForm = false;
 
@@ -186,20 +184,7 @@
     {
         this.blockEntryForm = blockEntryForm;
     }
-
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public Boolean getDisplayProvidedOtherFacility()
-    {
-        return displayProvidedOtherFacility;
-    }
-
-    public void setDisplayProvidedOtherFacility( Boolean displayProvidedOtherFacility )
-    {
-        this.displayProvidedOtherFacility = displayProvidedOtherFacility;
-    }
-
+    
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )

=== 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-09-05 17:59:57 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-09-06 09:06:36 +0000
@@ -228,7 +228,6 @@
         executeSql( "update programstage set generatedByEnrollmentDate = false where generatedByEnrollmentDate is null ");
         executeSql( "update programstage set blockEntryForm = false where blockEntryForm is null ");
         executeSql( "update programstage set remindCompleted = false where remindCompleted is null ");
-        executeSql( "update programstage set displayProvidedOtherFacility = false where displayProvidedOtherFacility is null ");
         executeSql( "ALTER TABLE program DROP COLUMN generatedByEnrollmentDate" );
         executeSql( "ALTER TABLE program DROP COLUMN blockEntryForm" );
         executeSql( "ALTER TABLE program DROP COLUMN remindCompleted" );

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2013-09-06 09:06:36 +0000
@@ -102,7 +102,7 @@
 
     @Override
     public String prepareDataEntryFormForEntry( String htmlCode, Collection<PatientDataValue> dataValues,
-        String disabled, I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance,
+        I18n i18n, ProgramStage programStage, ProgramStageInstance programStageInstance,
         OrganisationUnit organisationUnit )
     {
         Map<String, Collection<PatientDataValue>> mapDataValue = new HashMap<String, Collection<PatientDataValue>>();
@@ -271,7 +271,7 @@
                 // If programStagsInstance is completed then disabled it
                 // -----------------------------------------------------------
 
-                disabled = "";
+                String disabled = "";
                 if ( !programStageUid.equals( programStage.getUid() ) )
                 {
                     disabled = "disabled=\"\"";

=== 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	2013-09-05 17:59:57 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2013-09-06 09:06:36 +0000
@@ -63,7 +63,5 @@
 
 		<property name="remindCompleted" />
 
-		<property name="displayProvidedOtherFacility" />
-
 	</class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2013-09-06 09:06:36 +0000
@@ -154,7 +154,7 @@
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
-    
+
     public void setProgramIndicatorService( ProgramIndicatorService programIndicatorService )
     {
         this.programIndicatorService = programIndicatorService;
@@ -297,8 +297,6 @@
         Collections.sort( programStageDataElements, new ProgramStageDataElementSortOrderComparator() );
 
         DataEntryForm dataEntryForm = programStage.getDataEntryForm();
-        Boolean displayProvidedOtherFacility = programStage.getDisplayProvidedOtherFacility() == null
-            || !programStage.getDisplayProvidedOtherFacility();
 
         if ( programStage.getDataEntryType().equals( ProgramStage.TYPE_SECTION ) )
         {
@@ -309,8 +307,7 @@
         else if ( programStage.getDataEntryType().equals( ProgramStage.TYPE_CUSTOM ) )
         {
             customDataEntryFormCode = programDataEntryService.prepareDataEntryFormForEntry(
-                dataEntryForm.getHtmlCode(), null, displayProvidedOtherFacility.toString(), i18n, programStage, null,
-                organisationUnit );
+                dataEntryForm.getHtmlCode(), null, i18n, programStage, null, organisationUnit );
         }
 
         if ( programStageInstance != null )
@@ -347,8 +344,8 @@
             if ( programStage.getDataEntryType().equals( ProgramStage.TYPE_CUSTOM ) )
             {
                 customDataEntryFormCode = programDataEntryService.prepareDataEntryFormForEntry(
-                    dataEntryForm.getHtmlCode(), patientDataValues, displayProvidedOtherFacility.toString(), i18n,
-                    programStage, programStageInstance, organisationUnit );
+                    dataEntryForm.getHtmlCode(), patientDataValues, i18n, programStage, programStageInstance,
+                    organisationUnit );
             }
 
             // -----------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2013-09-06 09:06:36 +0000
@@ -41,10 +41,8 @@
 import org.hisp.dhis.patient.PatientAudit;
 import org.hisp.dhis.patient.PatientAuditService;
 import org.hisp.dhis.patient.PatientIdentifier;
-import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramIndicatorService;
@@ -71,8 +69,6 @@
 
     private PatientService patientService;
 
-    private PatientAttributeValueService patientAttributeValueService;
-
     private RelationshipService relationshipService;
 
     private ProgramInstanceService programInstanceService;
@@ -138,11 +134,6 @@
         return attributeMap;
     }
 
-    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
-    {
-        this.patientAttributeValueService = patientAttributeValueService;
-    }
-
     public void setCurrentUserService( CurrentUserService currentUserService )
     {
         this.currentUserService = currentUserService;
@@ -218,45 +209,6 @@
         programs.addAll( programService.getProgramsByCurrentUser( Program.SINGLE_EVENT_WITH_REGISTRATION ) );
 
         // ---------------------------------------------------------------------
-        // Get patient-attribute-values
-        // ---------------------------------------------------------------------
-
-        Collection<PatientAttributeValue> _attributeValues = patientAttributeValueService
-            .getPatientAttributeValues( patient );
-        attributeValues = new HashSet<PatientAttributeValue>();
-
-        for ( Program program : programs )
-        {
-            Collection<PatientAttribute> atttributes = program.getPatientAttributes();
-            for ( PatientAttributeValue attributeValue : _attributeValues )
-            {
-                if ( atttributes.contains( attributeValue.getPatientAttribute() ) )
-                {
-                    attributeValues.add( attributeValue );
-                }
-            }
-        }
-
-        // ---------------------------------------------------------------------
-        // Get patient-identifiers
-        // ---------------------------------------------------------------------
-
-        Collection<PatientIdentifier> _identifiers = patient.getIdentifiers();
-        identifiers = new HashSet<PatientIdentifier>();
-
-        for ( Program program : programs )
-        {
-            Collection<PatientIdentifierType> identifierTypes = program.getPatientIdentifierTypes();
-            for ( PatientIdentifier identifier : _identifiers )
-            {
-                if ( !identifierTypes.contains( identifier.getIdentifierType() ) )
-                {
-                    identifiers.add( identifier );
-                }
-            }
-        }
-
-        // ---------------------------------------------------------------------
         // Get relationship
         // ---------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-09-06 07:54:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-09-06 09:06:36 +0000
@@ -1116,8 +1116,6 @@
 		class="org.hisp.dhis.caseentry.action.patient.PatientDashboardAction"
 		scope="prototype">
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-		<property name="patientAttributeValueService"
-			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 		<property name="relationshipService"
 			ref="org.hisp.dhis.relationship.RelationshipService" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm	2013-09-06 09:06:36 +0000
@@ -1,9 +1,16 @@
+#set($hasProvideElsewhere = false)
+#foreach( $programStageDataElement in $programStageDataElements )
+	#if($programStageDataElement.allowProvidedElsewhere == 'true')
+		#set($hasProvideElsewhere = true)
+	#end
+#end
+
 <table id="defaultEntryScreenContainer" class='entryScreen formSection'>
 	<colgroup>
 		<col id="deCol">
 		<col id="deCol">
 		<col id="entryCol">
-		#if( $!programStage.displayProvidedOtherFacility=='true')
+		#if( $hasProvideElsewhere=='true')
 		<col width="5%" />
 		#end
 	</colgroup>
@@ -11,7 +18,7 @@
 	<tr>
 		<th>$i18n.getString( "data_element" )</th>                   
 		<th>$i18n.getString( "value" )</th>
-		#if( $programStage.displayProvidedOtherFacility=='true')
+		#if( $hasProvideElsewhere=='true')
 		<th>$i18n.getString( "provided_elsewhere" )</th>
 		#end
 	</tr>
@@ -75,14 +82,12 @@
 					onkeypress="return keyPress(event, this)" tabindex="$tabIndex"/>
 			#end
 		</td> 
-		#if( $programStage.displayProvidedOtherFacility=='true' )
 		<td style='width:20px;' align='center'>
 			#set( $id = $programStageDataElement.programStage.uid + '-' + $programStageDataElement.dataElement.uid + '-facility' )
 			#if( $programStageDataElement.allowProvidedElsewhere == 'true')
 			<input class='provided-elsewhere' name="$id" id="$id" type="checkbox" onclick="updateProvidingFacility( '$programStageDataElement.dataElement.uid', this )" #if($patientDataValue.providedElsewhere == 'true') checked #end />
 			#end
 		</td>
-		#end
 	</tr>
 	#set( $tabIndex = $tabIndex + 1 )
 #end	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-09-06 07:54:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-09-06 09:06:36 +0000
@@ -1766,11 +1766,11 @@
 			
 			if( relationshipText != "")
 			{
-				setInnerHTML('patientRelatedStageSpan',"&#8226; <a href='javascript:showAddPatientForm( " + relatedProgramId + "," + patientId + "," + selectedProgram + " );' id='relatedPatient_$!programStageInstance.id' >" + relationshipText + "</a>");
+				setInnerHTML('patientRelatedStageSpan',"&#8226; <a href='javascript:showAddPatientForm( " + relatedProgramId + "," + patientId + "," + selectedProgram + " );' id='relatedPatient_$!programStageInstance.id' >" + relationshipText + "</a><br>&nbsp;");
 			}
 			else
 			{
-				setInnerHTML('patientRelatedStageSpan','');
+				setInnerHTML('patientRelatedStageSpan','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;');
 			}
 			
 			if(type=='2'){

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-09-05 17:59:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-09-06 09:06:36 +0000
@@ -25,14 +25,7 @@
 					<td>$encoder.htmlEncode($!patient.getFullName())</td>
 				</tr>
 				#end
-				#foreach( $identifier in $identifiers )
-				<tr>
-					#if($!identifier.identifierType)
-						<td>$identifier.identifierType.displayName</td>
-						<td id='dashboard_iden$identifier.identifierType.id'>$identifier.identifier</td>
-					#end
-				</tr>
-				#end
+				
 				<tr>
 					<td>$i18n.getString("location")</td>
 					<td>$encoder.htmlEncode($!patient.organisationUnit.name)</td>
@@ -114,6 +107,7 @@
 #end
 
 <td>
+
 	<div class="link-area" id="activeDiv" name="activeDiv">
 		<p class='header'>
 			$i18n.getString("active_programs")
@@ -184,6 +178,7 @@
 
 
 </td>
+
 <td>
 	
 	<div class="link-area" id="completedDiv" name="completedDiv" style="display:none;">
@@ -213,21 +208,17 @@
 	</div>
 	
 </td>
+
 <td>
 
-	<div class="link-area">
+	<div class="link-area" style="width:120%">
 		<p class='header'>
 			$i18n.getString("relationships")
 			
-			#if( $auth.hasAccess( "dhis-web-caseentry", "showRelationshipList" ) )
-				&#8226; <a href="javascript:setFieldValue( 'isShowPatientList', 'false' ); showRelationshipList( '$patient.id' );">$i18n.getString("management")</a>
-			#end
-			
 			#if( $auth.hasAccess( "dhis-web-caseentry", "showAddRelationshipPatient" ) )			
 				&#8226; <a href="javascript:showAddRelationshipPatient( '$patient.id', false, '' );">$i18n.getString("add_new_patient")</a>
-				<span id="patientRelatedStageSpan"><br>&nbsp;<span>
+				<span id="patientRelatedStageSpan">&nbsp;<span>
 			#end
-			
 		</p>
 		<div class="contentProviderTable">
 			<table>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm	2013-09-06 09:06:36 +0000
@@ -1,5 +1,10 @@
 #set( $tabIndex = 1 )
 #foreach( $section in $sections )
+	#foreach( $programStageDataElement in $section.programStageDataElements )
+		#if($programStageDataElement.allowProvidedElsewhere == 'true')
+			#set($hasProvideElsewhere = true)
+		#end
+	#end
 	<table class="formSection" width='80%' id='sec_$section.id' >
 		<tr>
 		  <td class='entryScreen'>
@@ -13,7 +18,7 @@
 						<colgroup>
 							<col id="deCol">
 							<col id="entryCol">
-							#if( $programStage.displayProvidedOtherFacility=='true')
+							#if( $hasProvideElsewhere=='true')
 							<col width="5%" />
 							#end
 						</colgroup>
@@ -24,7 +29,7 @@
 								<input type="text" class="sectionFilter" placeholder="$encoder.jsEscape( $i18n.getString( "filter_in_section" ) , "'")" onkeyup="filterInSection($(this));" >
 							</td>                   
 							<th>$i18n.getString( "value" )</th>
-							#if( $programStage.displayProvidedOtherFacility=='true')
+							#if( $hasProvideElsewhere=='true')
 							<th>$i18n.getString( "provided_elsewhere" )</th>
 							#end
 						</tr>
@@ -87,7 +92,7 @@
 										onkeypress="return keyPress(event, this)" tabindex="$tabIndex"/>
 								#end
 							</td> 
-							#if( $programStage.displayProvidedOtherFacility=='true' )
+							
 							<td style='width:20px;' align='center'>
 								#set( $id = $programStageDataElement.programStage.uid + '-' + $programStageDataElement.dataElement.uid + '-facility' )
 								#if( $programStageDataElement.allowProvidedElsewhere == 'true')
@@ -96,7 +101,6 @@
 									</div>
 								#end
 							</td>
-							#end
 						</tr>
 						#set( $tabIndex = $tabIndex + 1 )
 						#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm	2013-09-06 09:06:36 +0000
@@ -1,5 +1,11 @@
 #set( $sections = $programStage.programStageSections )
 #set( $program = $programStage.program )
+#set($hasProvideElsewhere = false)
+#foreach( $programStageDataElement in $programStageDataElements )
+	#if($programStageDataElement.allowProvidedElsewhere == 'true')
+		#set($hasProvideElsewhere = true)
+	#end
+#end
 
 #if( $customDataEntryFormCode )
 	$customDataEntryFormCode
@@ -32,7 +38,7 @@
 						<colgroup>
 							<col id="deCol">
 							<col id="entryCol">
-							#if( $programStage.displayProvidedOtherFacility=='true')
+							#if( $hasProvideElsewhere=='true')
 							<col width="5%" />
 							#end
 						</colgroup>
@@ -43,7 +49,7 @@
 								<input type="text" class="sectionFilter" placeholder="$encoder.jsEscape( $i18n.getString( "filter_in_section" ) , "'")" onkeyup="filterInSection($(this));" >
 							</td>                   
 							<th>$i18n.getString( "value" )</th>
-							#if( $programStage.displayProvidedOtherFacility=='true')
+							#if( $hasProvideElsewhere=='true')
 							<th>$i18n.getString( "provided_elsewhere" )</th>
 							#end
 						</tr>
@@ -121,14 +127,12 @@
 											</td>
 											
 										<td>
-										#if( $programStage.displayProvidedOtherFacility=='true' )
 											#set( $id = $programStageDataElement.programStage.uid + '_' + $programStageDataElement.dataElement.uid + '_facility' )
 											#if( $programStageDataElement.allowProvidedElsewhere == 'true')
 												<input class='provided-elsewhere' name="$id" id="$id" type="checkbox" title="$i18n.getString('provided_elsewhere') ?"/>
 											#else
 												<input class='provided-elsewhere' name="$id" id="$id" type="hidden" value="false";>
 											#end
-										#end
 										</td>
 								</tr>
 							#set( $tabIndex = $tabIndex + 1 )

=== 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	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm	2013-09-06 09:06:36 +0000
@@ -10,7 +10,6 @@
 	"blockEntryForm": "$!program.blockEntryForm",
 	"remindCompleted": "$!program.remindCompleted",
 	"generatedByEnrollmentDate": "$!program.generatedByEnrollmentDate",
-	"displayProvidedOtherFacility": "$!program.displayProvidedOtherFacility",
 	"patientReminders":[
 	#foreach($patientReminder in $programStage.patientReminders)
 	  {

=== 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	2013-09-05 17:59:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java	2013-09-06 09:06:36 +0000
@@ -257,13 +257,6 @@
         this.relatedPatient = relatedPatient;
     }
 
-    private Boolean displayProvidedOtherFacility;
-
-    public void setDisplayProvidedOtherFacility( Boolean displayProvidedOtherFacility )
-    {
-        this.displayProvidedOtherFacility = displayProvidedOtherFacility;
-    }
-
     private Boolean generatedByEnrollmentDate;
 
     public void setGeneratedByEnrollmentDate( Boolean generatedByEnrollmentDate )
@@ -299,7 +292,6 @@
         displayGenerateEventBox = (displayGenerateEventBox == null) ? false : displayGenerateEventBox;
         captureCoordinates = (captureCoordinates == null) ? false : captureCoordinates;
         relatedPatient = (relatedPatient == null) ? false : relatedPatient;
-        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? false : displayProvidedOtherFacility;
         generatedByEnrollmentDate = (generatedByEnrollmentDate == null) ? false : generatedByEnrollmentDate;
         blockEntryForm = (blockEntryForm == null) ? false : blockEntryForm;
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
@@ -318,7 +310,6 @@
         programStage.setValidCompleteOnly( validCompleteOnly );
         programStage.setAutoGenerateEvent( autoGenerateEvent );
         programStage.setCaptureCoordinates( captureCoordinates );
-        programStage.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
         programStage.setBlockEntryForm( blockEntryForm );
         programStage.setRemindCompleted( remindCompleted );
         programStage.setGeneratedByEnrollmentDate( generatedByEnrollmentDate );

=== 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	2013-09-05 17:59:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java	2013-09-06 09:06:36 +0000
@@ -249,13 +249,6 @@
         this.relatedPatient = relatedPatient;
     }
 
-    private Boolean displayProvidedOtherFacility;
-
-    public void setDisplayProvidedOtherFacility( Boolean displayProvidedOtherFacility )
-    {
-        this.displayProvidedOtherFacility = displayProvidedOtherFacility;
-    }
-
     private Boolean generatedByEnrollmentDate;
 
     public void setGeneratedByEnrollmentDate( Boolean generatedByEnrollmentDate )
@@ -292,7 +285,6 @@
         displayGenerateEventBox = (displayGenerateEventBox == null) ? false : displayGenerateEventBox;
         captureCoordinates = (captureCoordinates == null) ? false : captureCoordinates;
         relatedPatient = (relatedPatient == null) ? false : relatedPatient;
-        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? false : displayProvidedOtherFacility;
         generatedByEnrollmentDate = (generatedByEnrollmentDate == null) ? false : generatedByEnrollmentDate;
         blockEntryForm = (blockEntryForm == null) ? false : blockEntryForm;
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
@@ -307,7 +299,6 @@
         programStage.setIrregular( irregular );
         programStage.setMinDaysFromStart( minDaysFromStart );
         programStage.setDisplayGenerateEventBox( displayGenerateEventBox );
-        programStage.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
         programStage.setBlockEntryForm( blockEntryForm );
         programStage.setRemindCompleted( remindCompleted );
         programStage.setGeneratedByEnrollmentDate( generatedByEnrollmentDate );

=== 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	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2013-09-06 09:06:36 +0000
@@ -67,12 +67,6 @@
 	<tr><th colspan="2">$i18n.getString( "form_details" )</th></tr>
 	
 	<tr>
-		<td><label>$i18n.getString( "show_provided_provided_elsewhere" )</label></td>
-		<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true' checked></td>
-		<td></td>
-	</tr>
-	
-	<tr>
 		<td><label>$i18n.getString( "block_entry_form_after_completed" )</label></td>
 		<td><input type="checkbox" id="blockEntryForm" name="blockEntryForm" value='true'></td>
 		<td></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm	2013-09-06 09:06:36 +0000
@@ -68,7 +68,6 @@
 				<p><label class="bold">$i18n.getString( "standard_interval_days" ):</label><br><span id="standardIntervalField"></span></p>
 				<p><label class="bold">$i18n.getString( "block_entry_form_after_completed" ):</label><br><span id="blockEntryFormField"></span></p>
 				<p><label class="bold">$i18n.getString( "remind_completing_program_after_program_stage_completed" ):</label><br><span id="remindCompletedField"></span></p>
-				<p><label class="bold">$i18n.getString( "display_provided_other_facility_column" ):</label><br><span id="displayProvidedOtherFacilityField"></span></p>
 				<p><label class="bold">$i18n.getString( "generated_events_by_enrollment_date" ):</label><br><span id="generatedByEnrollmentDateField"></span></p>
 				<p><label class="bold">$i18n.getString( "capture_coordinates" ):</label><br><span id="captureCoordinatesField"></span></p>
 				<p><label class="bold">$i18n.getString( "complete_allowed_only_if_validation_passes" ):</label><br><span id="validCompleteOnlyField"></span></p>

=== 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	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2013-09-06 09:06:36 +0000
@@ -68,12 +68,6 @@
 			<tr><th colspan="2">$i18n.getString( "form_details" )</th></tr>
 			
 			<tr>
-				<td><label>$i18n.getString( "show_provided_provided_elsewhere" )</label></td>
-				<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true' #if( $programStage.displayProvidedOtherFacility=='true' ) checked #end ></td>
-				<td></td>
-			</tr>
-			
-			<tr>
 				<td><label>$i18n.getString( "block_entry_form_after_completed" )</label></td>
 				<td><input type="checkbox" id="blockEntryForm" name="blockEntryForm" value='true' #if( $programStage.blockEntryForm=='true' ) checked #end ></td>
 				<td></td>