← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4433: Minor fix for loading case-entry form.

 

------------------------------------------------------------
revno: 4433
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-08-25 10:29:09 +0700
message:
  Minor fix for loading case-entry form.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.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/DefaultProgramDataEntryService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2011-08-24 08:57:39 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2011-08-25 03:29:09 +0000
@@ -141,11 +141,12 @@
 
     public String prepareDataEntryFormForEdit( String htmlCode )
     {
-        String result = populateCustomDataEntryForTextBox( htmlCode );
-
-        result = populateCustomDataEntryForDate( result );
+        
+        String result = populateCustomDataEntryForDate( htmlCode );
 
         result = populateCustomDataEntryForOption( result );
+        
+        result = populateCustomDataEntryForTextBox( result );
 
         return result;
     }
@@ -195,11 +196,6 @@
                 int dataElementId = Integer.parseInt( identifierMatcher.group( 2 ) );
                 DataElement dataElement = dataElementService.getDataElement( dataElementId );
 
-                if ( dataElement != null && !dataElement.getDetailedNumberType().equals( DataElement.VALUE_TYPE_STRING ) )
-                {
-                    continue;
-                }
-
                 int optionComboId = Integer.parseInt( identifierMatcher.group( 3 ) );
                 DataElementCategoryOptionCombo optionCombo = categoryService
                     .getDataElementCategoryOptionCombo( optionComboId );
@@ -235,7 +231,7 @@
         // ---------------------------------------------------------------------
 
         StringBuffer sb = new StringBuffer();
-        
+
         // ---------------------------------------------------------------------
         // Pattern to match data elements in the HTML code
         // ---------------------------------------------------------------------
@@ -268,7 +264,7 @@
                 int dataElementId = Integer.parseInt( identifierMatcher.group( 2 ) );
                 DataElement dataElement = dataElementService.getDataElement( dataElementId );
 
-                if ( dataElement != null && !dataElement.getDetailedNumberType().equals( DataElement.VALUE_TYPE_STRING ) )
+                if ( dataElement != null && !DataElement.VALUE_TYPE_STRING.equals( dataElement.getType() ) )
                 {
                     continue;
                 }
@@ -336,11 +332,11 @@
                 int dataElementId = Integer.parseInt( identifierMatcher.group( 2 ) );
                 DataElement dataElement = dataElementService.getDataElement( dataElementId );
 
-                if ( dataElement != null && !dataElement.getDetailedNumberType().equals( DataElement.VALUE_TYPE_DATE ) )
+                if ( dataElement != null && !DataElement.VALUE_TYPE_DATE.equals( dataElement.getType() ) )
                 {
                     continue;
                 }
-            
+
                 String displayValue = (dataElement == null) ? " value=\"" + DATA_ELEMENT_DOES_NOT_EXIST + "\""
                     : " value=\"[ " + dataElement.getName() + " ]\"";
                 inputHTML = inputHTML.contains( EMPTY_VALUE_TAG ) ? inputHTML.replace( EMPTY_VALUE_TAG, displayValue )