← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13270: Replace fixed attributes to dynamic attributes(WIP)

 

------------------------------------------------------------
revno: 13270
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-17 10:31:30 +0700
message:
  Replace fixed attributes to dynamic attributes(WIP)
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/PatientMobileSetting.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  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/caseAggregationForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/jsonParamsByProgram.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/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-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/PatientMobileSetting.hbm.xml'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/PatientMobileSetting.hbm.xml	2012-08-22 07:08:08 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/PatientMobileSetting.hbm.xml	2013-12-17 03:31:30 +0000
@@ -9,15 +9,7 @@
     <id name="id" column="patientmobilesettingid">
       <generator class="native" />
     </id>
-
-    <property name="gender" column="gender" not-null="true" />
-
-    <property name="dobtype" column="dobtype" not-null="true" />
-
-    <property name="birthdate" column="birthdate" not-null="true" />
-
-    <property name="registrationdate" column="registrationdate" not-null="true" />
-    
+   
     <property name="autoUpdateClient" column="autoUpdateClient" not-null="false" />
     
     <property name="versionToUpdate" column="versionToUpdate" not-null="false" />

=== 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-16 04:45:10 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-12-17 03:31:30 +0000
@@ -278,11 +278,11 @@
         executeSql( "ALTER TABLE patientaggregatereport DROP COLUMN facilityLB" );
         executeSql( "update programstage_dataelements set allowDateInFuture=false where allowDateInFuture is null" );
         executeSql( "update programstage set autoGenerateEvent=true where programid in ( select programid from program where type=2 )" );
-        executeSql( "alter table patient alter column organisationunitid set not null" );        
+        executeSql( "alter table patient alter column organisationunitid set not null" );
 
         executeSql( "ALTER TABLE patientdatavalue ALTER COLUMN timestamp TYPE timestamp" );
         executeSql( "ALTER TABLE programstageinstance ALTER COLUMN executiondate TYPE timestamp" );
-        
+
         updateCoordinatesProgramStageInstance();
 
         addPatientAttributes();
@@ -454,169 +454,190 @@
 
     private void addPatientAttributes()
     {
-        int max = jdbcTemplate.queryForInt( "select max(patientattributeid) from patientattribute" );
-
-        // ---------------------------------------------------------------------
-        // Gender
-        // ---------------------------------------------------------------------
-        
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Gender', 'Gender','" + PatientAttribute.TYPE_COMBO + "', false, false, false)" );
-
-        int maxOpt = jdbcTemplate.queryForInt( "select max(patientattributeoptionid) from patientattributeoption" );
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'F'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'F'," + maxOpt + " from patient where gender='F'" );
-
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'M'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'M'," + maxOpt + " from patient where gender='M'" );
-
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'T'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'T'," + maxOpt + " from patient where gender='T'" );
-
-        // Update Case Aggregate Query Builder
-        String source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "gender]";
-        String target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE
-            + CaseAggregationCondition.SEPARATOR_OBJECT + max + "]";
-        updateFixedAttributeInCaseAggregate( source, target );
-
-        // ---------------------------------------------------------------------
-        // Death date
-        // ---------------------------------------------------------------------
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Death date', 'Death date','" + PatientAttribute.TYPE_DATE + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",deathDate from patient where deathDate is not null" );
-
-        // ---------------------------------------------------------------------
-        // registrationDate
-        // ---------------------------------------------------------------------
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Registration date', 'Registration date','" + PatientAttribute.TYPE_DATE + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",registrationDate from patient where registrationDate is not null" );
-
-        // ---------------------------------------------------------------------
-        // isDead
-        // ---------------------------------------------------------------------
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Is Dead', 'Is Dead','" + PatientAttribute.TYPE_TRUE_ONLY + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",isDead from patient where isDead is not null" );
-
-        // ---------------------------------------------------------------------
-        // underAge
-        // ---------------------------------------------------------------------
-
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, description, name, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Is under age', 'Is under age','" + PatientAttribute.TYPE_TRUE_ONLY + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",isDead from patient where underAge=true" );
-
-        // ---------------------------------------------------------------------
-        // DobType
-        // ---------------------------------------------------------------------
-
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, description, name, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','DOB type', 'DOB type','" + PatientAttribute.TYPE_COMBO + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",dobType from patient where dobType is not null" );
-
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'A'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'A'," + maxOpt + " from patient where dobType='A'" );
-
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'D'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'D'," + maxOpt + " from patient where dobType='D'" );
-
-        maxOpt++;
-        executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
-            + maxOpt + "', 'V'," + max + ")" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
-            + max + ",'V'," + maxOpt + " from patient where dobType='V'" );
-
-        // Update Case Aggregate Query Builder
-        source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "dobType]";
-        target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE + CaseAggregationCondition.SEPARATOR_OBJECT
-            + max + "]";
-        updateFixedAttributeInCaseAggregate( source, target );
-
-        // ---------------------------------------------------------------------
-        // Birthdate
-        // ---------------------------------------------------------------------
-
-        max++;
-        executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
-            + max
-            + ",'"
-            + CodeGenerator.generateCode()
-            + "','"
-            + DateUtils.getMediumDateString()
-            + "','Birth date', 'Birth date','" + PatientAttribute.TYPE_DATE + "', false, false, false)" );
-        executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid," + max
-            + ",birthdate from patient where birthdate is not null" );
-
-        // Update Case Aggregate Query Builder
-        source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "age]";
-        target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE + CaseAggregationCondition.SEPARATOR_OBJECT
-            + max + ".age]";
-        updateFixedAttributeInCaseAggregate( source, target );
-
-         executeSql( "ALTER TABLE patient DROP COLUMN deathDate" );
-         executeSql( "ALTER TABLE patient DROP COLUMN registrationDate" );
-         executeSql( "ALTER TABLE patient DROP COLUMN isDead" );
-         executeSql( "ALTER TABLE patient DROP COLUMN underAge" );
-         executeSql( "ALTER TABLE patient DROP COLUMN dobType" );
-         executeSql( "ALTER TABLE patient DROP COLUMN birthdate" );
+        StatementHolder holder = statementManager.getHolder();
+
+        try
+        {
+            Statement statement = holder.getStatement();
+
+            ResultSet resultSet = statement.executeQuery( "SELECT gender1 FROM patient" );
+
+            if ( resultSet.next() )
+            {System.out.println("\n\n 1");
+
+                int max = jdbcTemplate.queryForInt( "select max(patientattributeid) from patientattribute" );
+
+                // ---------------------------------------------------------------------
+                // Gender
+                // ---------------------------------------------------------------------
+
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Gender', 'Gender','" + PatientAttribute.TYPE_COMBO + "', false, false, false)" );
+
+                int maxOpt = jdbcTemplate
+                    .queryForInt( "select max(patientattributeoptionid) from patientattributeoption" );
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'F'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'F'," + maxOpt + " from patient where gender='F'" );
+
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'M'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'M'," + maxOpt + " from patient where gender='M'" );
+
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'T'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'T'," + maxOpt + " from patient where gender='T'" );
+
+                // Update Case Aggregate Query Builder
+                String source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "gender]";
+                String target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE
+                    + CaseAggregationCondition.SEPARATOR_OBJECT + max + "]";
+                updateFixedAttributeInCaseAggregate( source, target );
+
+                // ---------------------------------------------------------------------
+                // Death date
+                // ---------------------------------------------------------------------
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Death date', 'Death date','" + PatientAttribute.TYPE_DATE + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",deathDate from patient where deathDate is not null" );
+
+                // ---------------------------------------------------------------------
+                // registrationDate
+                // ---------------------------------------------------------------------
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Registration date', 'Registration date','"
+                    + PatientAttribute.TYPE_DATE
+                    + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",registrationDate from patient where registrationDate is not null" );
+
+                // ---------------------------------------------------------------------
+                // isDead
+                // ---------------------------------------------------------------------
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Is Dead', 'Is Dead','" + PatientAttribute.TYPE_TRUE_ONLY + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",isDead from patient where isDead is not null" );
+
+                // ---------------------------------------------------------------------
+                // underAge
+                // ---------------------------------------------------------------------
+
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, description, name, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Is under age', 'Is under age','"
+                    + PatientAttribute.TYPE_TRUE_ONLY
+                    + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",isDead from patient where underAge=true" );
+
+                // ---------------------------------------------------------------------
+                // DobType
+                // ---------------------------------------------------------------------
+
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, description, name, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','DOB type', 'DOB type','" + PatientAttribute.TYPE_COMBO + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",dobType from patient where dobType is not null" );
+
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'A'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'A'," + maxOpt + " from patient where dobType='A'" );
+
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'D'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'D'," + maxOpt + " from patient where dobType='D'" );
+
+                maxOpt++;
+                executeSql( "INSERT INTO patientattributeoption (patientattributeoptionid, name, patientattributeid ) VALUES ('"
+                    + maxOpt + "', 'V'," + max + ")" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value, patientattributeoptionid ) SELECT patientid,"
+                    + max + ",'V'," + maxOpt + " from patient where dobType='V'" );
+
+                // Update Case Aggregate Query Builder
+                source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "dobType]";
+                target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE
+                    + CaseAggregationCondition.SEPARATOR_OBJECT + max + "]";
+                updateFixedAttributeInCaseAggregate( source, target );
+
+                // ---------------------------------------------------------------------
+                // Birthdate
+                // ---------------------------------------------------------------------
+
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Birth date', 'Birth date','" + PatientAttribute.TYPE_DATE + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",birthdate from patient where birthdate is not null" );
+
+                // Update Case Aggregate Query Builder
+                source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "age]";
+                target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE
+                    + CaseAggregationCondition.SEPARATOR_OBJECT + max + ".age]";
+                updateFixedAttributeInCaseAggregate( source, target );
+
+                executeSql( "ALTER TABLE patient DROP COLUMN deathDate" );
+                executeSql( "ALTER TABLE patient DROP COLUMN registrationDate" );
+                executeSql( "ALTER TABLE patient DROP COLUMN isDead" );
+                executeSql( "ALTER TABLE patient DROP COLUMN underAge" );
+                executeSql( "ALTER TABLE patient DROP COLUMN dobType" );
+                executeSql( "ALTER TABLE patient DROP COLUMN birthdate" );
+            }
+        }
+        catch ( Exception ex )
+        {
+        }
     }
 
     private void updateFixedAttributeInCaseAggregate( String source, String target )

=== 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	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/addPatientAttributeForm.vm	2013-12-17 03:31:30 +0000
@@ -76,7 +76,6 @@
 	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
 	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
 	var i18n_current_date = '$encoder.jsEscape( $i18n.getString( "current_date" ) , "'") ';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'") ';
 	var i18n_incident_date = '$encoder.jsEscape( $i18n.getString( "incident_date" ) , "'") ';
 	var i18n_enrollment_date = '$encoder.jsEscape( $i18n.getString( "enrollment_date" ) , "'") ';
 	var isSubmit = true;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm	2013-07-30 08:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationForm.vm	2013-12-17 03:31:30 +0000
@@ -78,10 +78,6 @@
 			<tr>
 				<td>
 					<select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this.id, 'caSuggestedValues' )">
-						<option suggested="" title="Total of patient registration" value="[PT:count]">$i18n.getString( 'total_of_patient_registration' )</option>
-						<option suggested="F, M" title="Gender" value="[CP:gender]">$i18n.getString( 'gender' )</option>
-						<option suggested="V, D, A" title="DOB type" value="[CP:dobType]">$i18n.getString( 'dob_type' )</option>
-						<option suggested="" title="Age (days)" value="[CP:age]">$i18n.getString( "age_days" )</option>
 						#foreach($patientAttribute in $patientAttributes)
 							<option suggested="" title="$patientAttribute.displayName" value="[CA:$patientAttribute.id]">$patientAttribute.displayName</option>
 						#end
@@ -176,10 +172,6 @@
 </table>
 
 <script type="text/javascript">
-	var i18n_total_of_patient_registration = '$encoder.jsEscape( $i18n.getString( "total_of_patient_registration" ) , "'") ';
-	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'") ';
-	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ) , "'") ';
-	var i18n_age_days = '$encoder.jsEscape( $i18n.getString( "age_days" ) , "'") ';
 	var i18n_please_select = '[' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'") ' + ']';
 </script>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	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/javascript/caseaggregation.js	2013-12-17 03:31:30 +0000
@@ -109,12 +109,6 @@
   clearListById('caseProperty');
   var programId = getFieldValue('programId');
   if( programId == '' ) {
-    var caseProperty = jQuery('#caseProperty');
-    caseProperty.append('<option suggested="" title="' + i18n_total_of_patient_registration + '" value="[PT:count]">' + i18n_total_of_patient_registration + '</option>');
-    caseProperty.append('<option suggested="F, M" title="' + i18n_gender + '" value="[CP:gender]">' + i18n_gender + '</option>');
-    caseProperty.append('<option suggested="" title="' + i18n_dob_type + '" value="[CP:dobType]">' + i18n_dob_type + '</option>');
-    caseProperty.append('<option suggested="" title="' + i18n_age_days + '" value="[CP:age]">' + i18n_age_days + '</option>');
-
     disable('programProperty');
     disable('programStageProperty');
   }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	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/javascript/patientAttribute.js	2013-12-17 03:31:30 +0000
@@ -73,7 +73,6 @@
 					function ( json ) {
 						var patientAttributes = jQuery("#availableAttribute");
 						patientAttributes.append( "<option value='[current_date:0]' title='" + i18n_current_date + "'>" + i18n_current_date + "</option>" );
-						patientAttributes.append( "<option value='[CP:0]' title='" + i18n_date_of_birth + "'>" + i18n_date_of_birth + "</option>" );
 						for ( i in json.programs ) 
 						{ 
 							var id = "[PG:" + json.programs[i].id + ".dateOfIncident]";

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js	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/javascript/viewPatientRegistationForm.js	2013-12-17 03:31:30 +0000
@@ -123,11 +123,7 @@
 	var requiredFields = {};
 	if( getFieldValue("disableRegistrationFields")!='true' )
 	{
-		requiredFields['fixedattributeid=registrationDate'] = i18n_registration_date;
 		requiredFields['fixedattributeid=fullName'] = i18n_full_name;
-		requiredFields['fixedattributeid=gender'] = i18n_gender;
-		requiredFields['fixedattributeid=dobType'] = i18n_dob_type;
-		requiredFields['fixedattributeid=birthDate'] = i18n_date_of_birth;
 			
 		jQuery('#identifiersSelector option').each(function() {
 			var item = jQuery(this);
@@ -371,16 +367,6 @@
 	
 	var htmlCode = "<input " + id + " value=\"[" + value + "]\" title=\"" + value + "\" ";
 	
-	var suggestedValue = getFieldValue('genderSelector');
-	if( jQuery('#genderSelector').is(":visible") )
-	{
-		htmlCode += " suggested='" + suggestedValue + "' ";
-	}
-	suggestedValue = getFieldValue('dobTypeSelector');
-	if( jQuery('#dobTypeSelector').is(":visible") )
-	{
-		htmlCode += " suggested='" + suggestedValue + "' ";
-	}
 	suggestedValue = getFieldValue('suggestedField');
 	if( jQuery('#suggestedField').is(":visible") )
 	{
@@ -505,19 +491,3 @@
 		window.location.href = 'delRegistrationEntryFormAction.action?id=' + getFieldValue('id');
 	}
 }
-
-function suggestionSelectorToggle()
-{
-	hideById('genderSelector');
-	hideById('dobTypeSelector');
-	showById('suggestedField');
-	if( getFieldValue('fixedAttrSelector')=='gender' ){
-		hideById('suggestedField');
-		showById('genderSelector');
-	}
-	else if(getFieldValue('fixedAttrSelector')=='dobType'){
-		hideById('suggestedField');
-		showById('dobTypeSelector');
-	}
-}
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/jsonParamsByProgram.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/jsonParamsByProgram.vm	2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/jsonParamsByProgram.vm	2013-12-17 03:31:30 +0000
@@ -7,28 +7,6 @@
   }#if( $velocityCount < $size ),#end
   #end
   ],
-  "fixedAttributes": [
-	{
-		"id": "[PT:count]",
-		"name": "$i18n.getString( 'total_of_patient_registration' )",
-		"suggested": ""
-	},
-	{
-		"id": "[CP:gender]",
-		"name": "$i18n.getString( 'gender' )",
-		"suggested": "F, M"
-	},
-	{
-		"id": "[CP:dobType]",
-		"name": "$i18n.getString( 'dob_type' )",
-		"suggested": "V, D, A"
-	},
-	{
-		"id": "[CP:age]",
-		"name": "$i18n.getString( "age_days" )",
-		"suggested": ""
-	}
-  ],
   "patientAttributes":[
 	#set( $size = $!{patientAttributes.size()} )
 	#foreach( $patientAttribute in $!{patientAttributes} )

=== 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	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/updatePatientAttibuteForm.vm	2013-12-17 03:31:30 +0000
@@ -85,7 +85,6 @@
 	var i118_at_least_2_option = '$encoder.jsEscape( $i18n.getString( "at_least_2_option" ) , "'") ';
 	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
 	var i18n_current_date = '$encoder.jsEscape( $i18n.getString( "current_date" ) , "'") ';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'") ';
 	var i18n_incident_date = '$encoder.jsEscape( $i18n.getString( "incident_date" ) , "'") ';
 	var i18n_enrollment_date = '$encoder.jsEscape( $i18n.getString( "enrollment_date" ) , "'") ';
 	var isSubmit = true;	

=== 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-17 01:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-12-17 03:31:30 +0000
@@ -120,35 +120,10 @@
 		<tr>
 			<td>
 				<select id="fixedAttrSelector" multiple="multiple" style="width:450px;height:270px" onclick='suggestionSelectorToggle()' ondblclick="insertElement( 'fixedAttr' )">
-					<option value="registrationDate">$i18n.getString('registration_date')</option>
 					<option value="fullName">$i18n.getString('full_name')</option>
-					<option value="gender">$i18n.getString('gender')</option>
-					<option value="birthDate">$i18n.getString('birth_date')</option>
-					<option value="age">$i18n.getString('age_years')</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>
-					<option value="healthWorker">$i18n.getString('health_worker')</option>
-				</select>
-			</td>
-		</tr>
-		<tr>
-			<td>
-				$i18n.getString("default_value")
-				<input type='text' id='suggestedField' style='width:295px;'>
-				<select style='width:300px;display:none;' id='genderSelector'>
-					<option value="">[$i18n.getString( "please_select" )]</option>
-					<option value="M">$i18n.getString( "male" )</option>
-					<option value="F">$i18n.getString( "female" )</option>
-					<option value="T">$i18n.getString( "transgender" )</option>
-				</select>
-				<select style='width:300px;display:none;' id='dobTypeSelector'>
-					<option value="">[$i18n.getString( "please_select" )]</option>
-					<option value="V">$i18n.getString( "verified" )</option>
-					<option value="D">$i18n.getString( "declared" )</option>
-					<option value="A">$i18n.getString( "approximated" )</option>
-				</select>
-				<input type='checkbox' id='hiddenField'/>$i18n.getString("is_hidden")
+					<option value="associate">$i18n.getString('health_worker')</option>
+				</select>
 			</td>
 		</tr>
 	</table>
@@ -251,16 +226,12 @@
 	var i18n_property_is_inserted = '$encoder.jsEscape( $i18n.getString( "property_is_inserted" ) , "'" )';
 	var i18n_please_insert_all_required_fields = '$encoder.jsEscape( $i18n.getString( "please_insert_all_required_fields" ) , "'" )';
 	var i18n_required_fields_valivation = '$encoder.jsEscape( $i18n.getString( "required_fields_valivation" ) , "'" )';
-	var i18n_registration_date = '$encoder.jsEscape( $i18n.getString( "registration_date" ) , "'" )';
 	var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'" )';
-	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'" )';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'" )';
 	var i18n_properties = '$encoder.jsEscape( $i18n.getString( "properties" ) , "'" )';
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_registration_form" ) , "'" )';
 	var i18n_save_unsuccess_please_insert_all_required_fields = '$encoder.jsEscape( $i18n.getString( "save_unsuccess" ) , "'" )' + '. ' + '$encoder.jsEscape( $i18n.getString( "please_insert_all_required_fields" ) , "'" )';
 	var i18n_validate_success = '$encoder.jsEscape( $i18n.getString( "validate_success" ) , "'" )';
 	var i18n_name_exists = '$encoder.jsEscape( $i18n.getString( "name_exists" ) , "'" )';
-	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ) , "'" )';
 	jQuery(document).ready(	function(){
 		openPropertiesSelector();
 	});