← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12150: Remove attributes from Patient object.

 

------------------------------------------------------------
revno: 12150
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-09-19 10:24:26 +0700
message:
  Remove attributes from Patient object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientDeletionHandler.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/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml


--
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-18 03:49:35 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-09-19 03:24:26 +0000
@@ -100,9 +100,7 @@
     private Set<PatientIdentifier> identifiers = new HashSet<PatientIdentifier>();
     
     private OrganisationUnit organisationUnit;
-
-    private Set<PatientAttribute> attributes = new HashSet<PatientAttribute>();
-
+    
     private Patient representative;
 
     private boolean underAge;
@@ -128,16 +126,6 @@
         return name;
     }
 
-    public Set<PatientAttribute> getAttributes()
-    {
-        return attributes;
-    }
-
-    public void setAttributes( Set<PatientAttribute> attributes )
-    {
-        this.attributes = attributes;
-    }
-
     @JsonProperty
     @JsonSerialize(as = BaseIdentifiableObject.class)
     @JsonView({ DetailedView.class, ExportView.class })

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientDeletionHandler.java	2013-09-18 03:49:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PatientDeletionHandler.java	2013-09-19 03:24:26 +0000
@@ -48,13 +48,6 @@
         this.patientService = patientService;
     }
 
-    private JdbcTemplate jdbcTemplate;
-
-    public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
-    {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-
     // -------------------------------------------------------------------------
     // DeletionHandler implementation
     // -------------------------------------------------------------------------
@@ -77,13 +70,7 @@
             patientService.updatePatient( representative );
         }
     }
-
-    @Override
-    public void deletePatientAttribute( PatientAttribute patientAttribute )
-    {
-        jdbcTemplate.execute( "delete from patient_attributes where patientattributeid=" + patientAttribute.getId() );
-    }
-
+    
     @Override
     public String allowDeleteOrganisationUnit( OrganisationUnit unit )
     {

=== 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-18 03:49:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-09-19 03:24:26 +0000
@@ -241,6 +241,7 @@
         executeSql( "alter table patient drop column lastname" );
 
         executeSql( "DROP TABLE patient_programs" );
+        executeSql( "DROP TABLE patient_attributes" );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2013-09-18 06:54:48 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2013-09-19 03:24:26 +0000
@@ -346,7 +346,6 @@
 
 	<bean id="org.hisp.dhis.patient.PatientDeletionHandler" class="org.hisp.dhis.patient.PatientDeletionHandler">
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-		<property name="jdbcTemplate" ref="jdbcTemplate" />
 	</bean>
 
 	<bean id="org.hisp.dhis.program.ProgramStageDataElementDeletionHandler"

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-09-18 03:49:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-09-19 03:24:26 +0000
@@ -35,12 +35,6 @@
       <one-to-many class="org.hisp.dhis.patient.PatientIdentifier" />
     </set>
     
-    <set name="attributes" table="patient_attributes">
-      <key column="patientid" foreign-key="fk_patient_attributes_patientid" />
-      <many-to-many class="org.hisp.dhis.patient.PatientAttribute" column="patientattributeid"
-        foreign-key="fk_patient_patientattributeid" />
-    </set>
-
     <many-to-one name="representative" class="org.hisp.dhis.patient.Patient" column="representativeid"
       foreign-key="fk_representativeid" />