← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6339: (patient) Minor fix for Patient details and history.

 

------------------------------------------------------------
revno: 6339
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-03-22 09:15:46 +0700
message:
  (patient) Minor fix for Patient details and history.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java


--
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/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2012-03-14 02:11:09 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2012-03-22 02:15:46 +0000
@@ -201,7 +201,7 @@
         attrGrid.addHeader( new GridHeader( i18n.getString( "name" ), false, true ) );
         attrGrid.addHeader( new GridHeader( i18n.getString( "value" ), false, true ) );
         attrGrid.addHeader( new GridHeader( "", true, false ) );
-        
+
         Collection<PatientAttribute> patientAttributes = patient.getAttributes();
 
         // ---------------------------------------------------------------------
@@ -234,7 +234,21 @@
             attrGrid.addValue( patientAttribute.getName() );
             PatientAttributeValue attributeValue = patientAttributeValueService.getPatientAttributeValue( patient,
                 patientAttribute );
-            attrGrid.addValue( (attributeValue == null) ? PatientAttributeValue.UNKNOWN : attributeValue.getValue() );
+            String value = "";
+            if ( attributeValue == null )
+            {
+                value = PatientAttributeValue.UNKNOWN;
+            }
+            else if ( attributeValue.getPatientAttribute().getValueType().equals( PatientAttribute.TYPE_BOOL ) )
+            {
+                value = i18n.getString( attributeValue.getValue() );
+            }
+            else
+            {
+                value = attributeValue.getValue();
+            }
+
+            attrGrid.addValue( value );
         }
 
         // ---------------------------------------------------------------------
@@ -273,7 +287,7 @@
                 Grid gridProgram = new ListGrid();
                 gridProgram.setTitle( programInstance.getProgram().getName() );
                 gridProgram.setSubtitle( "" );
-                
+
                 // ---------------------------------------------------------------------
                 // Headers
                 // ---------------------------------------------------------------------
@@ -281,7 +295,7 @@
                 gridProgram.addHeader( new GridHeader( i18n.getString( "name" ), false, false ) );
                 gridProgram.addHeader( new GridHeader( i18n.getString( "value" ), false, false ) );
                 gridProgram.addHeader( new GridHeader( "", true, false ) );
-                
+
                 // ---------------------------------------------------------------------
                 // Values
                 // ---------------------------------------------------------------------