← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11943: Allow only one comment for an event and display it on the post-comment field in dashboard.

 

------------------------------------------------------------
revno: 11943
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-09-06 14:54:55 +0700
message:
  Allow only one comment for an event and display it on the post-comment field in dashboard.
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.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/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.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/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.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/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-09-06 07:54:55 +0000
@@ -43,7 +43,8 @@
  * @author Abyot Asalefew
  * @version $Id$
  */
-public class ProgramStageInstance extends BaseIdentifiableObject
+public class ProgramStageInstance
+    extends BaseIdentifiableObject
 {
     /**
      * Determines if a de-serialized file is compatible with this class.
@@ -51,9 +52,13 @@
     private static final long serialVersionUID = 6239130884678145713L;
 
     public static final int COMPLETED_STATUS = 1;
+
     public static final int VISITED_STATUS = 2;
+
     public static final int FUTURE_VISIT_STATUS = 3;
+
     public static final int LATE_VISIT_STATUS = 4;
+
     public static final int SKIPPED_STATUS = 5;
 
     private ProgramInstance programInstance;
@@ -70,7 +75,7 @@
 
     private List<OutboundSms> outboundSms;
 
-    private Set<PatientComment> patientComments;
+    private PatientComment patientComment;
 
     private Integer status;
 
@@ -79,7 +84,7 @@
     private String completedUser;
 
     private Date completedDate;
-    
+
     private Set<Patient> patients;
 
     // -------------------------------------------------------------------------
@@ -252,14 +257,14 @@
         this.outboundSms = outboundSms;
     }
 
-    public Set<PatientComment> getPatientComments()
+    public PatientComment getPatientComment()
     {
-        return patientComments;
+        return patientComment;
     }
 
-    public void setPatientComments( Set<PatientComment> patientComments )
+    public void setPatientComment( PatientComment patientComment )
     {
-        this.patientComments = patientComments;
+        this.patientComment = patientComment;
     }
 
     public Date getCompletedDate()

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-09-06 07:54:55 +0000
@@ -537,7 +537,7 @@
                 }
             }
         }
-        
+
         return outboundSmsList;
     }
 
@@ -577,15 +577,12 @@
 
             // Comments
 
-            List<PatientComment> comments = new ArrayList<PatientComment>( programStageInstance.getPatientComments() );
+            PatientComment comment = programStageInstance.getPatientComment();
 
-            for ( PatientComment comment : comments )
-            {
-                grid.addRow();
-                grid.addValue( i18n.getString( "comment" ) + " " + i18n.getString( "on" ) + " "
-                    + format.formatDateTime( comment.getCreatedDate() ) );
-                grid.addValue( comment.getCommentText() );
-            }
+            grid.addRow();
+            grid.addValue( i18n.getString( "comment" ) + " " + i18n.getString( "on" ) + " "
+                + format.formatDateTime( comment.getCreatedDate() ) );
+            grid.addValue( comment.getCommentText() );
 
             // SMS messages
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-07-31 06:51:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-09-06 07:54:55 +0000
@@ -4,56 +4,60 @@
   "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
 
 <hibernate-mapping>
-  <class name="org.hisp.dhis.program.ProgramStageInstance" table="programstageinstance">
-
-    <id name="id" column="programstageinstanceid">
-      <generator class="native" />
-    </id>
-
-    <property name="uid" column="uid" unique="true" length="11" />
-
-    <property name="created" type="timestamp"/>
-
-    <property name="lastUpdated" type="timestamp"/>
-
-    <many-to-one name="programInstance" class="org.hisp.dhis.program.ProgramInstance" column="programinstanceid"
-      not-null="true" foreign-key="fk_programstageinstance_programinstanceid" />
-
-    <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage" column="programstageid"
-      not-null="true" foreign-key="fk_programstageinstance_programstageid" />
-
-    <property name="dueDate" column="duedate" />
-
-    <property name="executionDate" column="executiondate" />
-    
-    <property name="completed" not-null="true" />
-    
-    <many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit"
-        column="organisationunitid" foreign-key="fk_programstageinstance_organisationunitid" />
-    
-    <list name="outboundSms" table="programstageinstance_outboundsms">
-      <key column="programstageinstanceid" />
-      <list-index column="sort_order" base="1" />
-      <many-to-many class="org.hisp.dhis.sms.outbound.OutboundSms" column="outboundsmsid" />
-    </list>
-     
-    <set name="patientComments" order-by="createdDate asc" cascade="all">
-      <key column="programstageinstanceid" />
-      <one-to-many class="org.hisp.dhis.patientcomment.PatientComment" />
-    </set>
-    
-    <property name="status" column="status" />
-    
-    <property name="coordinates" type="text" />
-    
-    <property name="completedUser" />
-     
-    <property name="completedDate" />
-    
-    <set name="patients" table="programstageinstance_patients">
-      <key column="programstageinstanceid" />
-      <many-to-many class="org.hisp.dhis.patient.Patient" column="patientid"/>
-    </set>
-    
-  </class>
+	<class name="org.hisp.dhis.program.ProgramStageInstance" table="programstageinstance">
+
+		<id name="id" column="programstageinstanceid">
+			<generator class="native" />
+		</id>
+
+		<property name="uid" column="uid" unique="true" length="11" />
+
+		<property name="created" type="timestamp" />
+
+		<property name="lastUpdated" type="timestamp" />
+
+		<many-to-one name="programInstance" class="org.hisp.dhis.program.ProgramInstance"
+			column="programinstanceid" not-null="true"
+			foreign-key="fk_programstageinstance_programinstanceid" />
+
+		<many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
+			column="programstageid" not-null="true"
+			foreign-key="fk_programstageinstance_programstageid" />
+
+		<property name="dueDate" column="duedate" />
+
+		<property name="executionDate" column="executiondate" />
+
+		<property name="completed" not-null="true" />
+
+		<many-to-one name="organisationUnit"
+			class="org.hisp.dhis.organisationunit.OrganisationUnit" column="organisationunitid"
+			foreign-key="fk_programstageinstance_organisationunitid" />
+
+		<list name="outboundSms" table="programstageinstance_outboundsms">
+			<key column="programstageinstanceid" />
+			<list-index column="sort_order" base="1" />
+			<many-to-many class="org.hisp.dhis.sms.outbound.OutboundSms"
+				column="outboundsmsid" />
+		</list>
+
+		<many-to-one name="patientComment" cascade="all"
+			class="org.hisp.dhis.patientcomment.PatientComment" column="patientcommentid"
+			foreign-key="fk_programstageinstance_patientcommentid" />
+
+		<property name="status" column="status" />
+
+		<property name="coordinates" type="text" />
+
+		<property name="completedUser" />
+
+		<property name="completedDate" />
+
+		<set name="patients" table="programstageinstance_patients">
+			<key column="programstageinstanceid" />
+			<many-to-many class="org.hisp.dhis.patient.Patient"
+				column="patientid" />
+		</set>
+
+	</class>
 </hibernate-mapping>

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/AddPatientCommentAction.java	1970-01-01 00:00:00 +0000
@@ -1,110 +0,0 @@
-package org.hisp.dhis.caseentry.action.reminder;
-
-/*
- * Copyright (c) 2004-2013, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.patientcomment.PatientComment;
-import org.hisp.dhis.program.ProgramStageInstance;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.user.CurrentUserService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * 
- * @version AddPatientCommentAction.java 9:55:04 AM Aug 17, 2012 $
- */
-public class AddPatientCommentAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private ProgramStageInstanceService programStageInstanceService;
-
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
-    private CurrentUserService currentUserService;
-
-    public void setCurrentUserService( CurrentUserService currentUserService )
-    {
-        this.currentUserService = currentUserService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input
-    // -------------------------------------------------------------------------
-
-    private Integer programStageInstanceId;
-
-    public void setProgramStageInstanceId( Integer programStageInstanceId )
-    {
-        this.programStageInstanceId = programStageInstanceId;
-    }
-
-    private String commentText;
-
-    public void setCommentText( String commentText )
-    {
-        this.commentText = commentText;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-    {
-        ProgramStageInstance programStageInstance = programStageInstanceService
-            .getProgramStageInstance( programStageInstanceId );
-
-        Set<PatientComment> comments = programStageInstance.getPatientComments();
-
-        if ( comments == null )
-        {
-            comments = new HashSet<PatientComment>();
-        }
-
-        PatientComment comment = new PatientComment( commentText, currentUserService.getCurrentUsername(), new Date() );
-        comments.add( comment );
-
-        programStageInstanceService.updateProgramStageInstance( programStageInstance );
-
-        return SUCCESS;
-    }
-
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2013-09-06 07:54:55 +0000
@@ -34,7 +34,6 @@
 
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-import org.hisp.dhis.patientcomment.PatientComment;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.ProgramStageInstanceService;
 import org.hisp.dhis.sms.outbound.OutboundSms;
@@ -64,7 +63,7 @@
     }
 
     private PatientAttributeValueService patientAttributeValueService;
-    
+
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -75,8 +74,6 @@
 
     private List<OutboundSms> outboundSms;
 
-    private List<PatientComment> comments;
-
     private String currentUsername;
 
     private Collection<PatientAttributeValue> attributeValues;
@@ -110,11 +107,6 @@
         return currentUsername;
     }
 
-    public List<PatientComment> getComments()
-    {
-        return comments;
-    }
-
     public void setProgramStageInstanceId( Integer programStageInstanceId )
     {
         this.programStageInstanceId = programStageInstanceId;
@@ -134,15 +126,14 @@
         throws Exception
     {
         programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
-        
+
         outboundSms = new ArrayList<OutboundSms>( programStageInstance.getOutboundSms() );
-       
-        comments = new ArrayList<PatientComment>( programStageInstance.getPatientComments() );
 
         currentUsername = currentUserService.getCurrentUsername();
 
-        attributeValues = patientAttributeValueService.getPatientAttributeValues( programStageInstance.getProgramInstance().getPatient() );
-        
+        attributeValues = patientAttributeValueService.getPatientAttributeValues( programStageInstance
+            .getProgramInstance().getPatient() );
+
         return SUCCESS;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/RemovePatientCommentAction.java	2013-09-06 07:54:55 +0000
@@ -87,16 +87,14 @@
     public String execute()
     {
         PatientComment patientComment = commentService.getPatientComment( id );
-        
+
         ProgramStageInstance programStageInstance = programStageInstanceService
             .getProgramStageInstance( programStageInstanceId );
 
-        programStageInstance.getPatientComments().remove( patientComment );
-        
         commentService.deletePatientComment( patientComment );
-        
+
         programStageInstanceService.updateProgramStageInstance( programStageInstance );
-        
+
         return SUCCESS;
     }
 

=== 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-04 03:23:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-09-06 07:54:55 +0000
@@ -1137,12 +1137,13 @@
 
 	<!-- Comment && Message -->
 
-	<bean id="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction"
-		class="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction"
+	<bean id="org.hisp.dhis.caseentry.action.reminder.SavePatientCommentAction"
+		class="org.hisp.dhis.caseentry.action.reminder.SavePatientCommentAction"
 		scope="prototype">
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="patientCommentService" ref="org.hisp.dhis.patientcomment.PatientCommentService" />
 	</bean>
 
 	<bean

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-08-29 09:34:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-09-06 07:54:55 +0000
@@ -1121,8 +1121,8 @@
     
     <!-- Comment && Message -->
 
-    <action name="addPatientComment"
-      class="org.hisp.dhis.caseentry.action.reminder.AddPatientCommentAction">
+    <action name="savePatientComment"
+      class="org.hisp.dhis.caseentry.action.reminder.SavePatientCommentAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
       </result>
       <param name="requiredAuthorities">F_PATIENT_COMMENT_ADD</param>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-09-06 07:54:55 +0000
@@ -79,7 +79,7 @@
 <tr>
 	<th><label for="postComment">$i18n.getString('post_comment'):</label>
 		<input type="text" class="{validate:{maxlength:160}} criteria" id="commentInput" name='commentInput'
-			style="width:85%" onkeypress="keypressOnComment( event, this );" value="" >
+			style="width:85%" onkeypress="keypressOnComment( event, this );" >
 		<input id="commentButton" name='commentButton' type="button" style='width:40px' value="$i18n.getString('add')" onclick='addComment( byId("commentInput"), $programStageInstance.id )'>
 	</th>
 </tr>

=== 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 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-09-06 07:54:55 +0000
@@ -1958,7 +1958,7 @@
 		return;
 	}
 	
-	jQuery.postUTF8( 'addPatientComment.action',
+	jQuery.postUTF8( 'savePatientComment.action',
 		{
 			programStageInstanceId: programStageInstanceId,
 			commentText: commentText 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-09-06 07:54:55 +0000
@@ -798,6 +798,7 @@
             $( "#entryFormContainer input[id='currentUsername']" ).val( data.currentUsername );
             $( "#entryFormContainer input[id='blockEntryForm']" ).val( data.programStage.blockEntryForm );
             $( "#entryFormContainer input[id='remindCompleted']" ).val( data.programStage.remindCompleted );
+			$( "#entryFormContainer input[id='commentInput']" ).val( data.comment );
 
             $( "input[id='dueDate']" ).val( data.dueDate );
             $( "input[id='executionDate']" ).val( data.executionDate );
@@ -823,22 +824,6 @@
                 $( '#longitude' ).val( data.longitude );
                 $( '#latitude' ).val( data.latitude );
             }
-
-            if(data.comments.length > 0) {
-                $.each(data.comments, function(idx, item) {
-                    var comment = [
-                        "<tr>",
-                        "<td>" + item.createdDate + "</td>",
-                        "<td>" + item.creator + "</td>",
-						"<td>" + i18n_comment + "</td>",
-                        "<td>" + item.text + "</td>",
-                        "</tr>"
-                    ].join(' ');
-
-                    $( '#commentTB' ).append( comment )
-                });
-            }
-
             _.each( data.dataValues, function ( value, key ) {
                 var fieldId = getProgramStageUid() + '-' + key + '-val';
                 var field = $('#' + fieldId);

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-09-02 21:20:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-09-06 07:54:55 +0000
@@ -9,16 +9,7 @@
     "latitude": "$!latitude",
     "longitude": "$!longitude",
     #end
-
-    "comments": [
-    #set( $size = $programStageInstance.patientComments.size() )
-    #foreach( $comment in $programStageInstance.patientComments )
-{"createdDate": "$format.formatDateTime($comment.createdDate)", "creator": "$encoder.jsonEncode( $comment.creator )", "text": "$encoder.jsonEncode( $!comment.commentText )"}#if( $velocityCount < $size ),
-    #end
-    #end
-
-    ],
-
+    "comment": "$!encoder.jsonEncode( $programStageInstance.patientComment.commentText )",
     "dataValues": {
     #set( $size = $dataValueMap.keySet().size() )
     #foreach( $key in $dataValueMap.keySet() )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-09-06 05:27:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-09-06 07:54:55 +0000
@@ -152,7 +152,7 @@
 				  <em title="$i18n.getString( 'required' )" class="required">*</em></label>
 				</td>		
 				<td>
-					<input type="password" id="searchText" name="searchText" value="$!searchText" onkeyup='searchPatientsOnKeyUp( event );' style='width:200px;'>
+					<input type="text" id="searchText" name="searchText" value="$!searchText" onkeyup='searchPatientsOnKeyUp( event );' style='width:200px;'>
 					<input type="button" class='normal-button' name="clearSearchBtn" value='$i18n.getString( "clear" )' onclick="removeAttributeOption('advSearchBox0');" align='bottom'>
 				</td>
 			</tr>
@@ -175,7 +175,7 @@
 	datePicker( 'startDueDate', true );
 	datePicker( 'endDueDate', true );
 	
-	var searchTextBox = '<input type="password" id="searchText" name="searchText" onkeyup="searchPatientsOnKeyUp( event );" style="width:202px;">';
+	var searchTextBox = '<input type="text" id="searchText" name="searchText" onkeyup="searchPatientsOnKeyUp( event );" style="width:202px;">';
 	var programComboBox = '<select class="search-field" id="searchText" name="searchText" style="width:205px;">';
 	#foreach ( $program in $programs ) 
 		programComboBox += '<option value="$program.id">$program.displayName</option>';