← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9260: Remove preferred property from PatientIdentifier object.

 

------------------------------------------------------------
revno: 9260
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-12-11 15:03:28 +0700
message:
  Remove preferred property from PatientIdentifier object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifier.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	2012-09-27 06:54:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2012-12-11 08:03:28 +0000
@@ -114,26 +114,6 @@
     }
 
     // -------------------------------------------------------------------------
-    // Logic
-    // -------------------------------------------------------------------------
-
-    public PatientIdentifier getPreferredPatientIdentifier()
-    {
-        if ( getIdentifiers() != null && getIdentifiers().size() > 0 )
-        {
-            for ( PatientIdentifier patientIdentifier : getIdentifiers() )
-            {
-                if ( patientIdentifier.getPreferred() )
-                {
-                    return patientIdentifier;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    // -------------------------------------------------------------------------
     // hashCode and equals
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java	2012-12-11 08:03:28 +0000
@@ -51,8 +51,6 @@
 
     private String identifier;
 
-    private Boolean preferred = false;
-
     // -------------------------------------------------------------------------
     // hashCode, equals and toString
     // -------------------------------------------------------------------------
@@ -129,16 +127,6 @@
         this.identifier = identifier;
     }
 
-    public Boolean getPreferred()
-    {
-        return preferred;
-    }
-
-    public void setPreferred( Boolean preferred )
-    {
-        this.preferred = preferred;
-    }
-
     public void setIdentifierType( PatientIdentifierType identifierType )
     {
         this.identifierType = identifierType;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java	2012-03-26 06:36:24 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientIdentifierStore.java	2012-12-11 08:03:28 +0000
@@ -48,8 +48,7 @@
 {
     public PatientIdentifier get( Patient patient )
     {
-        return (PatientIdentifier) getCriteria( Restrictions.eq( "patient", patient ),
-            Restrictions.eq( "preferred", true ) ).uniqueResult();
+        return (PatientIdentifier) getCriteria( Restrictions.eq( "patient", patient ) ).uniqueResult();
     }
 
     public PatientIdentifier get( String identifier, OrganisationUnit organisationUnit )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifier.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifier.hbm.xml	2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientIdentifier.hbm.xml	2012-12-11 08:03:28 +0000
@@ -17,7 +17,5 @@
 
     <property name="identifier" length="31" not-null="true" />
 
-    <property name="preferred" not-null="true" />
-
   </class>
 </hibernate-mapping>