← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9803: Error when update patient information with custom registration form.

 

------------------------------------------------------------
revno: 9803
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-02-13 23:20:07 +0700
message:
  Error when update patient information with custom registration form.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java
  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/updatePatientForm.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-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-02-02 10:34:22 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientRegistrationFormService.java	2013-02-13 16:20:07 +0000
@@ -36,11 +36,8 @@
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-import org.hisp.dhis.patientdatavalue.PatientDataValue;
-import org.hisp.dhis.patientdatavalue.PatientDataValueService;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.user.User;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -256,7 +253,8 @@
                 String value = "";
                 if ( programInstance != null )
                 {
-                    value = format.formatDate( ((Date) getValueFromProgram( property, programInstance )) );
+                    value = format.formatDate( ((Date) getValueFromProgram( StringUtils.capitalize( property ),
+                        programInstance )) );
                 }
 
                 inputHtml = "<input id=\"" + property + "\" name=\"" + property + "\" tabindex=\"" + index
@@ -480,7 +478,7 @@
     {
         try
         {
-            return Patient.class.getMethod( "get" + property ).invoke( programInstance );
+            return ProgramInstance.class.getMethod( "get" + property ).invoke( programInstance );
         }
         catch ( Exception ex )
         {

=== 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-02-08 12:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-02-13 16:20:07 +0000
@@ -968,7 +968,6 @@
 			programId: getFieldValue('programIdAddPatient')
 		}, function()
 		{
-			jQuery('#searchPatientsDiv').dialog('close');
 			jQuery('#loaderDiv').hide();
 			showById('editPatientDiv');
 		});

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2013-02-13 15:58:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2013-02-13 16:20:07 +0000
@@ -62,17 +62,19 @@
 <input type="hidden" id="relationshipTypeId" name='relationshipTypeId' value="$!relationship.relationshipType.id"/>
 <input type="hidden" id="id" name="id" value="$patient.id">
 
-<table>		
-	<tr>
-		<th colspan="2" class="heading-column">$i18n.getString( "system_identifier" )</th>
-	</tr>	
-	<tr>
-		<td></td>
-		<td>$!systemIdentifier</td>
-	</tr>
-	<tr>
-		<td>&nbsp;</td>
-	</tr>	
+<table>	
+	#if($!systemIdentifier)
+		<tr>
+			<th colspan="2" class="heading-column">$i18n.getString( "system_identifier" )</th>
+		</tr>	
+		<tr>
+			<td></td>
+			<td>$!systemIdentifier</td>
+		</tr>
+		<tr>
+			<td>&nbsp;</td>
+		</tr>	
+	#end
 
 	#parse( "/dhis-web-caseentry/patientForm.vm" )