← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13011: Change healthWorker name to associate in Patient object.

 

------------------------------------------------------------
revno: 13011
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-11-25 14:31:02 +0700
message:
  Change healthWorker name to associate in Patient 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/PatientRegistrationForm.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.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/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.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-11-22 03:59:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-11-25 07:31:02 +0000
@@ -51,7 +51,7 @@
 /**
  * @author Abyot Asalefew Gizaw
  */
-@JacksonXmlRootElement(localName = "person", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "person", namespace = DxfNamespaces.DXF_2_0 )
 public class Patient
     extends BaseIdentifiableObject
 {
@@ -61,31 +61,45 @@
     private static final long serialVersionUID = 884114994005945275L;
 
     public static final String MALE = "M";
+
     public static final String FEMALE = "F";
+
     public static final String TRANSGENDER = "T";
 
     public static final char DOB_TYPE_VERIFIED = 'V';
+
     public static final char DOB_TYPE_DECLARED = 'D';
+
     public static final char DOB_TYPE_APPROXIMATED = 'A';
 
     public static final char AGE_TYPE_YEAR = 'Y';
+
     public static final char AGE_TYPE_MONTH = 'M';
+
     public static final char AGE_TYPE_DAY = 'D';
 
-
     public static String SEARCH_SAPERATE = "_";
-    
+
     public static String PREFIX_IDENTIFIER_TYPE = "iden";
+
     public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
+
     public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
+
     public static String PREFIX_PROGRAM = "prg";
+
     public static String PREFIX_PROGRAM_INSTANCE = "pi";
+
     public static String PREFIX_PROGRAM_EVENT_BY_STATUS = "stat";
+
     public static String PREFIX_PROGRAM_STAGE = "prgst";
 
     public static String FIXED_ATTR_BIRTH_DATE = "birthDate";
+
     public static String FIXED_ATTR_AGE = "age";
+
     public static String FIXED_ATTR_INTEGER_AGE = "integerValueOfAge";
+
     public static String FIXED_ATTR_REGISTRATION_DATE = "registrationDate";
 
     public static String FIXED_ATTR_FULL_NAME = "fullName";
@@ -103,20 +117,20 @@
     private boolean isDead;
 
     private Set<PatientIdentifier> identifiers = new HashSet<PatientIdentifier>();
-    
+
     private Set<PatientAttributeValue> attributeValues = new HashSet<PatientAttributeValue>();
-    
+
     private Set<ProgramInstance> programInstances = new HashSet<ProgramInstance>();
-    
+
     private OrganisationUnit organisationUnit;
-    
+
     private Patient representative;
 
     private boolean underAge;
 
     private Character dobType;
 
-    private User healthWorker;
+    private User associate;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -136,9 +150,9 @@
     }
 
     @JsonProperty
-    @JsonSerialize(as = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize( as = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public OrganisationUnit getOrganisationUnit()
     {
         return organisationUnit;
@@ -150,8 +164,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getGender()
     {
         return gender;
@@ -163,8 +177,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getBirthDate()
     {
         return birthDate;
@@ -176,8 +190,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getDeathDate()
     {
         return deathDate;
@@ -189,8 +203,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getIsDead()
     {
         return isDead;
@@ -210,7 +224,7 @@
     {
         this.identifiers = identifiers;
     }
-    
+
     public Set<PatientAttributeValue> getAttributeValues()
     {
         return attributeValues;
@@ -232,22 +246,22 @@
     }
 
     @JsonProperty
-    @JsonSerialize(as = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
-    public User getHealthWorker()
+    @JsonSerialize( as = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public User getAssociate()
     {
-        return healthWorker;
+        return associate;
     }
 
-    public void setHealthWorker( User healthWorker )
+    public void setAssociate( User associate )
     {
-        this.healthWorker = healthWorker;
+        this.associate = associate;
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getRegistrationDate()
     {
         return registrationDate;
@@ -259,9 +273,9 @@
     }
 
     @JsonProperty
-    @JsonSerialize(as = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonSerialize( as = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Patient getRepresentative()
     {
         return representative;
@@ -400,25 +414,25 @@
 
         return AGE_TYPE_DAY;
     }
-    
+
     public void addIdentifier( PatientIdentifier identifier )
     {
         identifiers.add( identifier );
         identifier.setPatient( this );
     }
-    
+
     public void removeIdentifier( PatientIdentifier identifier )
     {
         identifiers.remove( identifier );
         identifier.setPatient( null );
     }
-    
+
     public void addAttributeValue( PatientAttributeValue attributeValue )
     {
         attributeValues.add( attributeValue );
         attributeValue.setPatient( this );
     }
-    
+
     public void removeAttributeValue( PatientAttributeValue attributeValue )
     {
         attributeValues.remove( attributeValue );
@@ -468,12 +482,12 @@
     {
         switch ( dobType )
         {
-            case DOB_TYPE_VERIFIED:
-                return "Verified";
-            case DOB_TYPE_DECLARED:
-                return "Declared";
-            default:
-                return "Approxiated";
+        case DOB_TYPE_VERIFIED:
+            return "Verified";
+        case DOB_TYPE_DECLARED:
+            return "Declared";
+        default:
+            return "Approxiated";
         }
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-11-08 07:40:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-11-25 07:31:02 +0000
@@ -58,7 +58,7 @@
 
     public static String FIXED_ATTRIBUTE_DOB_TYPE = "dobType";
 
-    public static String FIXED_ATTRIBUTE_HEALTH_WORKER = "healthWorker";
+    public static String FIXED_ATTRIBUTE_ASSOCIATE = "associate";
 
     private Program program;
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java	2013-11-19 12:09:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/DefaultEventStore.java	2013-11-25 07:31:02 +0000
@@ -30,6 +30,7 @@
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
+
 import org.hisp.dhis.dxf2.events.person.Person;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patient.Patient;
@@ -53,7 +54,8 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public class DefaultEventStore implements EventStore
+public class DefaultEventStore
+    implements EventStore
 {
     @Autowired
     private JdbcTemplate jdbcTemplate;
@@ -66,61 +68,77 @@
     @Override
     public List<Event> getAll( Program program, OrganisationUnit organisationUnit )
     {
-        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ), null, null, null );
+        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ),
+            null, null, null );
     }
 
     @Override
     public List<Event> getAll( Program program, OrganisationUnit organisationUnit, Date startDate, Date endDate )
     {
-        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ), null, startDate, endDate );
+        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ),
+            null, startDate, endDate );
     }
 
     @Override
-    public List<Event> getAll( Program program, OrganisationUnit organisationUnit, Person person, Date startDate, Date endDate )
+    public List<Event> getAll( Program program, OrganisationUnit organisationUnit, Person person, Date startDate,
+        Date endDate )
     {
-        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ), person, startDate, endDate );
+        return getAll( Arrays.asList( program ), new ArrayList<ProgramStage>(), Arrays.asList( organisationUnit ),
+            person, startDate, endDate );
     }
 
     @Override
     public List<Event> getAll( ProgramStage programStage, OrganisationUnit organisationUnit )
     {
-        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), null, null, null );
-    }
-
-    @Override
-    public List<Event> getAll( ProgramStage programStage, OrganisationUnit organisationUnit, Date startDate, Date endDate )
-    {
-        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), null, startDate, endDate );
-    }
-
-    @Override
-    public List<Event> getAll( ProgramStage programStage, OrganisationUnit organisationUnit, Person person, Date startDate, Date endDate )
-    {
-        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), person, startDate, endDate );
+        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            null, null, null );
+    }
+
+    @Override
+    public List<Event> getAll( ProgramStage programStage, OrganisationUnit organisationUnit, Date startDate,
+        Date endDate )
+    {
+        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            null, startDate, endDate );
+    }
+
+    @Override
+    public List<Event> getAll( ProgramStage programStage, OrganisationUnit organisationUnit, Person person,
+        Date startDate, Date endDate )
+    {
+        return getAll( new ArrayList<Program>(), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            person, startDate, endDate );
     }
 
     @Override
     public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit )
     {
-        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), null, null, null );
-    }
-
-    @Override
-    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit, Person person )
-    {
-        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), person, null, null );
-    }
-
-    @Override
-    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit, Date startDate, Date endDate )
-    {
-        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), null, startDate, endDate );
-    }
-
-    @Override
-    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit, Person person, Date startDate, Date endDate )
-    {
-        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ), person, startDate, endDate );
+        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            null, null, null );
+    }
+
+    @Override
+    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit,
+        Person person )
+    {
+        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            person, null, null );
+    }
+
+    @Override
+    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit,
+        Date startDate, Date endDate )
+    {
+        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            null, startDate, endDate );
+    }
+
+    @Override
+    public List<Event> getAll( Program program, ProgramStage programStage, OrganisationUnit organisationUnit,
+        Person person, Date startDate, Date endDate )
+    {
+        return getAll( Arrays.asList( program ), Arrays.asList( programStage ), Arrays.asList( organisationUnit ),
+            person, startDate, endDate );
     }
 
     @Override
@@ -130,19 +148,23 @@
     }
 
     @Override
-    public List<Event> getAll( Program program, List<ProgramStage> programStages, OrganisationUnit organisationUnit, Date startDate, Date endDate )
+    public List<Event> getAll( Program program, List<ProgramStage> programStages, OrganisationUnit organisationUnit,
+        Date startDate, Date endDate )
     {
-        return getAll( Arrays.asList( program ), programStages, Arrays.asList( organisationUnit ), null, startDate, endDate );
+        return getAll( Arrays.asList( program ), programStages, Arrays.asList( organisationUnit ), null, startDate,
+            endDate );
     }
 
     @Override
-    public List<Event> getAll( List<Program> programs, List<ProgramStage> programStages, List<OrganisationUnit> organisationUnits, Date startDate, Date endDate )
+    public List<Event> getAll( List<Program> programs, List<ProgramStage> programStages,
+        List<OrganisationUnit> organisationUnits, Date startDate, Date endDate )
     {
         return getAll( programs, programStages, organisationUnits, null, startDate, endDate );
     }
 
     @Override
-    public List<Event> getAll( List<Program> programs, List<ProgramStage> programStages, List<OrganisationUnit> organisationUnits, Person person, Date startDate, Date endDate )
+    public List<Event> getAll( List<Program> programs, List<ProgramStage> programStages,
+        List<OrganisationUnit> organisationUnits, Person person, Date startDate, Date endDate )
     {
         List<Event> events = new ArrayList<Event>();
 
@@ -184,15 +206,18 @@
                 if ( rowSet.getBoolean( "ps_capturecoordinates" ) )
                 {
                     Coordinate coordinate = new Coordinate();
-                    String psi_coordinates = rowSet.getString( "psi_coordinates" );
+                    Double psi_longitude = rowSet.getDouble( "psi_longitude" );
+                    Double psi_latitude = rowSet.getDouble( "psi_latitude" );
 
-                    if ( !StringUtils.isEmpty( psi_coordinates ) )
+                    if ( !StringUtils.isEmpty( psi_longitude ) && !StringUtils.isEmpty( psi_latitude ) )
                     {
+                        coordinate = new Coordinate(psi_longitude, psi_latitude);
                         try
                         {
-                            List<Double> list = objectMapper.readValue( psi_coordinates, new TypeReference<List<Double>>()
-                            {
-                            } );
+                            List<Double> list = objectMapper.readValue( coordinate.getCoordinateString(),
+                                new TypeReference<List<Double>>()
+                                {
+                                } );
 
                             coordinate.setLongitude( list.get( 0 ) );
                             coordinate.setLatitude( list.get( 1 ) );
@@ -223,19 +248,20 @@
         return events;
     }
 
-    private String buildSql( List<Integer> programIds, List<Integer> programStageIds, List<Integer> orgUnitIds, Integer personId, Date startDate, Date endDate )
+    private String buildSql( List<Integer> programIds, List<Integer> programStageIds, List<Integer> orgUnitIds,
+        Integer personId, Date startDate, Date endDate )
     {
         String sql = "select p.uid as p_uid, ps.uid as ps_uid, ps.capturecoordinates as ps_capturecoordinates, pa.uid as pa_uid, psi.uid as psi_uid, psi.status as psi_status, ou.uid as ou_uid, "
-            + "psi.executiondate as psi_executiondate, psi.completeduser as psi_completeduser, psi.coordinates as psi_coordinates," +
-            " pdv.value as pdv_value, pdv.storedby as pdv_storedby, pdv.providedelsewhere as pdv_providedelsewhere, de.uid as de_uid" +
-            " from program p" +
-            " left join programstage ps on ps.programid=p.programid" +
-            " left join programstageinstance psi on ps.programstageid=psi.programstageid" +
-            " left join programinstance pi on pi.programinstanceid=psi.programinstanceid" +
-            " left join organisationunit ou on (psi.organisationunitid=ou.organisationunitid)" +
-            " left join patientdatavalue pdv on psi.programstageinstanceid=pdv.programstageinstanceid" +
-            " left join dataelement de on pdv.dataelementid=de.dataelementid " +
-            " left join patient pa on pa.patientid=pi.patientid ";
+            + "psi.executiondate as psi_executiondate, psi.completeduser as psi_completeduser, psi.longitude as psi_longitude, psi.latitude as psi_latitude,"
+            + " pdv.value as pdv_value, pdv.storedby as pdv_storedby, pdv.providedelsewhere as pdv_providedelsewhere, de.uid as de_uid"
+            + " from program p"
+            + " left join programstage ps on ps.programid=p.programid"
+            + " left join programstageinstance psi on ps.programstageid=psi.programstageid"
+            + " left join programinstance pi on pi.programinstanceid=psi.programinstanceid"
+            + " left join organisationunit ou on (psi.organisationunitid=ou.organisationunitid)"
+            + " left join patientdatavalue pdv on psi.programstageinstanceid=pdv.programstageinstanceid"
+            + " left join dataelement de on pdv.dataelementid=de.dataelementid "
+            + " left join patient pa on pa.patientid=pi.patientid ";
 
         boolean startedWhere = false;
 
@@ -293,7 +319,8 @@
 
         if ( startDate != null && endDate != null )
         {
-            sql += " and (psi.executiondate >= '" + startDate.toString() + "' and psi.executiondate <= '" + endDate.toString() + "') ";
+            sql += " and (psi.executiondate >= '" + startDate.toString() + "' and psi.executiondate <= '"
+                + endDate.toString() + "') ";
         }
 
         sql += " order by psi_uid;";

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-10-14 02:42:20 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-11-25 07:31:02 +0000
@@ -549,7 +549,7 @@
         }
 
         // Health-worker field
-        else if ( fixedAttr.equals( PatientRegistrationForm.FIXED_ATTRIBUTE_HEALTH_WORKER ) )
+        else if ( fixedAttr.equals( PatientRegistrationForm.FIXED_ATTRIBUTE_ASSOCIATE ) )
         {
             inputHtml = inputHtml.replaceFirst( "input", "select" ) + " class='" + hidden + "' >";
             inputHtml += "<option value=\"\" selected >" + i18n.getString( "please_select" ) + "</option>";

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java	2013-11-25 07:31:02 +0000
@@ -128,9 +128,9 @@
             }
             break;
         case PatientReminder.SEND_TO_HEALTH_WORKER:
-            if ( patient.getHealthWorker() != null && patient.getHealthWorker().getPhoneNumber() != null )
+            if ( patient.getAssociate() != null && patient.getAssociate().getPhoneNumber() != null )
             {
-                phoneNumbers.add( patient.getHealthWorker().getPhoneNumber() );
+                phoneNumbers.add( patient.getAssociate().getPhoneNumber() );
             }
             break;
         case PatientReminder.SEND_TO_ORGUGNIT_REGISTERED:
@@ -180,9 +180,9 @@
             users.addAll( patient.getOrganisationUnit().getUsers() );
             break;
         case PatientReminder.SEND_TO_HEALTH_WORKER:
-            if ( patient.getHealthWorker() != null && patient.getHealthWorker().getPhoneNumber() != null )
+            if ( patient.getAssociate() != null && patient.getAssociate().getPhoneNumber() != null )
             {
-                users.add( patient.getHealthWorker() );
+                users.add( patient.getAssociate() );
             }
             break;
         case PatientReminder.SEND_TO_USER_GROUP:

=== 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-11-18 10:26:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-11-25 07:31:02 +0000
@@ -51,7 +51,7 @@
     <many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit" column="organisationunitid"
       foreign-key="fk_patient_organisationunitid" not-null="true" />
 
-    <many-to-one name="healthWorker" column="healthworkerid" class="org.hisp.dhis.user.User" foreign-key="fk_user_patientid" />
+    <many-to-one name="associate" column="healthworkerid" class="org.hisp.dhis.user.User" foreign-key="fk_user_patientid" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-11-18 11:50:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-11-25 07:31:02 +0000
@@ -28,11 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
@@ -194,7 +192,7 @@
 
         if ( healthWorker != null )
         {
-            patient.setHealthWorker( userService.getUser( healthWorker ) );
+            patient.setAssociate( userService.getUser( healthWorker ) );
         }
 
         Date _birthDate = new Date();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-10-08 17:16:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-11-25 07:31:02 +0000
@@ -182,11 +182,7 @@
 
         if ( healthWorker != null )
         {
-            patient.setHealthWorker( userService.getUser( healthWorker ) );
-        }
-        else
-        {
-            patient.setHealthWorker( null );
+            patient.setAssociate(  userService.getUser( healthWorker ) );
         }
 
         if ( birthDate != null || age != null )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm	2013-09-27 11:13:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm	2013-11-25 07:31:02 +0000
@@ -69,10 +69,10 @@
 	<tr>
 		<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
 		<td class="input-column">
-			<select id="healthWorkerId" name="healthWorkerId">
+			<select id="healthWorker" name="healthWorker">
 				<option value="">[$i18n.getString("please_select")]</option>
 				#foreach( $healthWorker in $healthWorkers)
-					<option value="$healthWorker.id" #if($patient.healthWorker.id == $healthWorker.id) selected #end>$healthWorker.name</option>
+					<option value="$healthWorker.id" #if($patient.associate.id == $healthWorker.id) selected #end>$healthWorker.name</option>
 				#end
 			</select>
 		</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-11-25 03:07:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-11-25 07:31:02 +0000
@@ -478,7 +478,7 @@
     }
 
     $.getJSON( "getProgramStageDataElementList.action", {
-        programStageId: getFieldValue( 'programStageId' )
+        programStageId: programStageId
     }, function ( json ) {
         $( '#advancedSearchTB [name=searchText]' ).val( '' );
         $( '.stage-object-selected' ).attr( 'psid', $( '#programId option:selected' ).attr( "psid" ) );
@@ -730,7 +730,7 @@
     hideById( 'dataEntryInfor' );
     hideById( 'listDiv' );
 
-    var params = 'anonynousEntryForm=true';
+    var params = '';
     $( '#displayInReports option' ).each( function ( i, item ) {
         var input = $( item );
         params += '&filterValues=de_' + input.val() + '_false_';
@@ -773,10 +773,8 @@
     }
 
     params += '&facilityLB=selected';
-    params += '&level=0';
     params += '&orgunitIds=' + getFieldValue( 'orgunitId' );
     params += '&programStageId=' + $( '#programId option:selected' ).attr( 'psid' );
-    params += '&orderByOrgunitAsc=false';
     params += '&userOrganisationUnit=false';
     params += '&userOrganisationUnitChildren=false';
 

=== 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-10-25 05:00:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-11-25 07:31:02 +0000
@@ -61,8 +61,8 @@
 				<tr>
 					<td>$i18n.getString("health_worker")</td>
 					<td>
-						#if($!patient.healthWorker )
-							$!encoder.htmlEncode($patient.healthWorker.name)
+						#if($!patient.associate )
+							$!encoder.htmlEncode($patient.associate.name)
 						#else
 							[$i18n.getString('none')]
 						#end

=== 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	2013-10-30 23:42:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-11-25 07:31:02 +0000
@@ -74,10 +74,10 @@
 	<tr name='propertiesField'>
 		<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
 		<td class="input-column">
-			<select id="healthWorkerId" name="healthWorkerId">
+			<select id="healthWorker" name="healthWorker">
 				<option value="">[$i18n.getString("please_select")]</option>
 				#foreach( $healthWorker in $healthWorkers)
-					<option value="$healthWorker.id" #if($patient.healthWorker.id == $healthWorker.id) selected #end>$healthWorker.name</option>
+					<option value="$healthWorker.id" #if($patient.associate.id == $healthWorker.id) selected #end>$healthWorker.name</option>
 				#end
 			</select>
 		</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-11-25 07:31:02 +0000
@@ -62,8 +62,8 @@
 			<tr>
 				<td>$i18n.getString("health_worker"):</td>
 				<td>
-					#if($!programStageInstance.programInstance.patient.healthWorker )
-						$encoder.htmlEncode($!programStageInstance.programInstance.patient.healthWorker.name)
+					#if($!programStageInstance.programInstance.patient.associate )
+						$encoder.htmlEncode($!programStageInstance.programInstance.patient.associate.name)
 					#else
 						[$i18n.getString('none')]
 					#end
@@ -147,16 +147,16 @@
 					<option value='1'>$i18n.getString('patient')</option>
 					#end
 					
-					#if($!patient.healthWorker.phoneNumber)
+					#if($!patient.associate.phoneNumber)
 					<option value='2'>$i18n.getString('health_worker')</option>
 					#end
 					
-					#if($!patient.healthWorker.organisationUnit.phoneNumber)
+					#if($!patient.associate.organisationUnit.phoneNumber)
 					<option value='3'>$i18n.getString('orgunit_registered')</option>
 					#end
 					
 					#set($hasUsers = false)
-					#foreach($user in $!patient.healthWorker.organisationUnit.users)
+					#foreach($user in $!patient.associate.organisationUnit.users)
 						#if($!user.phoneNumber!='') 
 							#set($hasUsers = true)
 						#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-10-09 14:43:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-11-25 07:31:02 +0000
@@ -1,6 +1,6 @@
 #set($programStageInstances = $programInstance.programStageInstances)
 #set($hasUsers = false)
-#foreach($user in $!programInstance.patient.healthWorker.organisationUnit.users)
+#foreach($user in $!programInstance.patient.associate.organisationUnit.users)
 	#if($!user.phoneNumber!='') 
 		#set($hasUsers = true)
 	#end
@@ -185,8 +185,8 @@
 			<td>
 				#if(($auth.hasAccess( "dhis-web-caseentry", "sendSMS" ) ) 
 					&& ($!programInstance.patient.phoneNumber 
-					|| $!programInstance.patient.healthWorker.phoneNumber 
-					|| $!programInstance.patient.healthWorker.organisationUnit.phoneNumber 
+					|| $!programInstance.patient.associate.phoneNumber 
+					|| $!programInstance.patient.associate.organisationUnit.phoneNumber 
 					|| $hasUsers ))
 				<img src="images/send_sms.png" class='img-button' title="$i18n.getString( 'send_message' )" onclick="setFieldValue('sendFromEvent','true');setFieldValue( 'programStageInstanceId',$programStageInstance.id);sendSmsOnePatientForm();"/>
 				#end
@@ -211,11 +211,11 @@
 						<option value='1'>$i18n.getString('patient')</option>
 						#end
 						
-						#if($!programInstance.patient.healthWorker.phoneNumber)
+						#if($!programInstance.patient.associate.phoneNumber)
 						<option value='2'>$i18n.getString('health_worker')</option>
 						#end
 						
-						#if($!programInstance.patient.healthWorker.organisationUnit.phoneNumber)
+						#if($!programInstance.patient.associate.organisationUnit.phoneNumber)
 						<option value='3'>$i18n.getString('orgunit_registered')</option>
 						#end