← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4961: Merge Line Listing dataEntry from 2.3 to trunk

 

------------------------------------------------------------
revno: 4961
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-10-14 19:14:18 +0530
message:
  Merge Line Listing dataEntry from 2.3 to trunk
added:
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm
modified:
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java
  local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llidspl.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 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2011-10-07 12:25:01 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2011-10-14 13:44:18 +0000
@@ -32,6 +32,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -47,6 +48,7 @@
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.SectionService;
 import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.den.api.LLDataSets;
@@ -60,6 +62,10 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.CalendarPeriodType;
 import org.hisp.dhis.period.Period;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -131,7 +137,7 @@
     {
         this.i18n = i18n;
     } 
-    
+
     //SelectAction Source Code
     private DataSetService dataSetService;
 
@@ -140,7 +146,31 @@
         this.dataSetService = dataSetService;
     }
     
-    
+    private UserService userService;
+
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+    private SectionService sectionService;
+
+    public SectionService getSectionService()
+    {
+        return sectionService;
+    }
+
+    public void setSectionService( SectionService sectionService )
+    {
+        this.sectionService = sectionService;
+    }
+
     
     // -------------------------------------------------------------------------
     // Output
@@ -153,7 +183,6 @@
 	return recordNos;
     }
 
-    
     private List<OrganisationUnit> orgUnitChildList;
 
     public List<OrganisationUnit> getOrgUnitChildList() 
@@ -175,7 +204,6 @@
         return isLineListing;
     }
 
-    
     private List<DataElement> orderedDataElements = new ArrayList<DataElement>();
 
     public List<DataElement> getOrderedDataElements()
@@ -289,17 +317,17 @@
     }
 
     private String llmdeath;
-	
+        
     public String getLlmdeath() 
     {
-	return llmdeath;
+        return llmdeath;
     }
-	
+
     private String lluuidspe;
-	
+        
     public String getLluuidspe() 
     {
-	return lluuidspe;
+        return lluuidspe;
     }
 
     private String lluuidspep;
@@ -322,6 +350,14 @@
     {
         return llidspl;
     }
+
+    private String llcoldchain;
+    
+    public String getLlcoldchain()
+    {
+        return llcoldchain;
+    }
+
     
     private int maxRecordNo;
     
@@ -330,7 +366,7 @@
         return maxRecordNo;
     }
 	
-	private boolean locked = false;
+    private boolean locked = false;
 
     public boolean isLocked()
     {
@@ -435,7 +471,7 @@
 
             return SUCCESS;
         }
-        
+
         // ---------------------------------------------------------------------
         // Load DataSets
         // ---------------------------------------------------------------------
@@ -446,6 +482,19 @@
         // ---------------------------------------------------------------------
         // Remove DataSets which don't have a CalendarPeriodType or are locked
         // ---------------------------------------------------------------------
+        if ( currentUserService.getCurrentUser() != null && !currentUserService.currentUserIsSuper() )
+        {
+            UserCredentials userCredentials = userService.getUserCredentials( currentUserService.getCurrentUser() );
+
+            Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
+
+            for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
+            {
+                dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
+            }
+
+            dataSets.retainAll( dataSetUserAuthorityGroups );
+        }
 
         Iterator<DataSet> it = dataSets.iterator();
 
@@ -453,7 +502,14 @@
         {
             DataSet temp = it.next();
             
-            if(temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS )  || temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS ))
+            if( temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS )  || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_COLD_CHAIN ))
             {
                 if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) )
                 {
@@ -601,6 +657,7 @@
         lluuidspep = LLDataSets.LL_UU_IDSP_EVENTSP;
         lldidsp = LLDataSets.LL_DEATHS_IDSP;
         llidspl = LLDataSets.LL_IDSP_LAB;
+        llcoldchain = LLDataSets.LL_COLD_CHAIN;
         
         OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
 
@@ -618,8 +675,7 @@
         }
 
         /*
-          
-         if(selDSName.equalsIgnoreCase( llidspl ) || selDSName.equalsIgnoreCase( lldidsp ) || selDSName.equalsIgnoreCase( lluuidspep ) || selDSName.equalsIgnoreCase( llbirth ) || selDSName.equalsIgnoreCase( lldeath ) || selDSName.equalsIgnoreCase( llmdeath ) || selDSName.equalsIgnoreCase( lluuidspe ))
+        if(selDSName.equalsIgnoreCase( llidspl ) || selDSName.equalsIgnoreCase( lldidsp ) || selDSName.equalsIgnoreCase( lluuidspep ) || selDSName.equalsIgnoreCase( llbirth ) || selDSName.equalsIgnoreCase( lldeath ) || selDSName.equalsIgnoreCase( llmdeath ) || selDSName.equalsIgnoreCase( lluuidspe ))
         {
             isLineListing = "yes";
         }
@@ -627,8 +683,8 @@
         {
             isLineListing = "no";
         }
+         */
 
-*/
         orgUnitChildList = new ArrayList<OrganisationUnit>(organisationUnit.getChildren());
         
         Period period = selectedStateManager.getSelectedPeriod();   
@@ -667,11 +723,6 @@
         Collection<LLDataValue> dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements, defaultOptionCombo );
         
         dataValueMap = new HashMap<Integer, DataValue>( dataValues.size() );
-
-        /*for ( LLDataValue dataValue : dataValues )
-        {
-            //dataValueMap.put( dataValue.getDataElement().getId(), dataValue );
-        }*/
         
         // ---------------------------------------------------------------------
         // Make the standard comments available
@@ -710,27 +761,31 @@
         }
         else if(selDSName.equalsIgnoreCase( lldeath ))
         {
-        	prepareLLDeathFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLDeathFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else if(selDSName.equalsIgnoreCase( llmdeath ))
         {
-        	prepareLLMaternalDeathFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLMaternalDeathFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else if(selDSName.equalsIgnoreCase( lluuidspe ))
         {
-        	prepareLLUUIDSPEFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLUUIDSPEFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else if(selDSName.equalsIgnoreCase( lluuidspep ))
         {
-        	prepareLLUUIDSPEPFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLUUIDSPEPFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else if(selDSName.equalsIgnoreCase( lldidsp ))
         {
-        	prepareLLDIDSPFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLDIDSPFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else if(selDSName.equalsIgnoreCase( llidspl ))
         {
-        	prepareLLIDSPLFormCode(organisationUnit, period, dataElements, dataValues);
+            prepareLLIDSPLFormCode(organisationUnit, period, dataElements, dataValues);
+        }
+        else if(selDSName.equalsIgnoreCase( llcoldchain ))
+        {
+            prepareLLColdChainFormCode(organisationUnit, period, dataElements, dataValues);
         }
         else
         {
@@ -755,6 +810,114 @@
     }
     
     
+    private void prepareLLColdChainFormCode( OrganisationUnit organisationUnit, Period period, Collection<DataElement> dataElements,
+        Collection<LLDataValue> dataValues)
+    {
+        lldataValueMap = new HashMap<String, List<LLDataValue>>();
+        
+        for ( LLDataValue dataValue : dataValues )
+        {
+            Integer recordNo = dataValue.getRecordNo();
+            List<LLDataValue> tempLLDVList;
+            if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
+            {
+                tempLLDVList = new ArrayList<LLDataValue>();
+            }
+            else
+            {
+                tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+            }
+            
+            tempLLDVList.add( dataValue );
+            lldataValueMap.put( String.valueOf(recordNo), tempLLDVList );
+        }
+
+        Set<String> llDataValueMapKeys = lldataValueMap.keySet();
+        Iterator<String> it1 = llDataValueMapKeys.iterator();
+        while( it1.hasNext() )
+        {
+            String tempRecordNo = (String) it1.next();
+            List<LLDataValue> tempLLDVList1 = new ArrayList<LLDataValue>(lldataValueMap.get(tempRecordNo));
+            List<LLDataValue> tempLLDVList2 = new ArrayList<LLDataValue>();
+            LLDataValue existingLLDV = new LLDataValue();
+            
+            for(int i = 0; i<=6; i++)
+            {
+                LLDataValue tempLLDV1 = new LLDataValue();
+                tempLLDVList2.add(tempLLDV1);
+            }
+
+            Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
+            while( it2.hasNext() )
+            {
+                LLDataValue tempLLDV = (LLDataValue) it2.next();
+                
+                if( tempLLDV.getDataElement().getId() == LLDataSets.LLCC_EQUIPMENT )
+                {
+                    tempLLDVList2.set( 0, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }    
+                else if(tempLLDV.getDataElement().getId() == LLDataSets.LLCC_MACHINE )
+                {
+                    tempLLDVList2.set( 1, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+                else if(tempLLDV.getDataElement().getId() == LLDataSets.LLCC_MACHINE_WORKING )
+                {
+                    tempLLDVList2.set( 2, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+                else if( tempLLDV.getDataElement().getId() == LLDataSets.LLCC_BREAKDOWN_DATE )
+                {
+                    tempLLDVList2.set( 3, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+                else if( tempLLDV.getDataElement().getId() == LLDataSets.LLCC_INTIMATION_DATE )
+                {
+                    tempLLDVList2.set( 4, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+                else if( tempLLDV.getDataElement().getId() == LLDataSets.LLCC_REPAIR_DATE )
+                {
+                    tempLLDVList2.set( 5, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+                else if( tempLLDV.getDataElement().getId() == LLDataSets.LLCC_REMARKS )
+                {
+                    tempLLDVList2.set( 6, tempLLDV );
+                    existingLLDV = tempLLDV;
+                }
+            }
+
+            int llbDes[] = { LLDataSets.LLCC_EQUIPMENT, LLDataSets.LLCC_MACHINE, LLDataSets.LLCC_MACHINE_WORKING,
+                                LLDataSets.LLCC_BREAKDOWN_DATE, LLDataSets.LLCC_INTIMATION_DATE,
+                                LLDataSets.LLCC_REPAIR_DATE, LLDataSets.LLCC_REMARKS };
+            
+            for(int i = 0; i<=6; i++)
+            {
+                LLDataValue llDv = tempLLDVList2.get(i);
+                if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                {
+                    llDv.setPeriod(existingLLDV.getPeriod());
+                    llDv.setSource(existingLLDV.getSource());
+                    llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                    llDv.setRecordNo(existingLLDV.getRecordNo());
+                    llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                    llDv.setValue(" ");
+                    
+                    tempLLDVList2.set(i, llDv);
+                 }                               
+            }
+
+            lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
+        }
+     
+        recordNos = new ArrayList<String>(lldataValueMap.keySet());
+        Collections.sort( recordNos );
+    }
+
+    
+    
     private void prepareLLIDSPLFormCode(OrganisationUnit organisationUnit, Period period, Collection<DataElement> dataElements,
             Collection<LLDataValue> dataValues)
         {
@@ -767,11 +930,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                    tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                    tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -787,10 +950,10 @@
                 List<LLDataValue> tempLLDVList2 = new ArrayList<LLDataValue>();
                 LLDataValue existingLLDV = new LLDataValue();
                 
-                for(int i = 0; i<6; i++)
+                for( int i = 0; i < 7; i++ )
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                    LLDataValue tempLLDV1 = new LLDataValue();
+                    tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -828,28 +991,34 @@
                         tempLLDVList2.set( 5, tempLLDV );
                         existingLLDV = tempLLDV;
                     }
+                    else if(tempLLDV.getDataElement().getId() == LLDataSets.LLIDSPL_OUTCOME )
+                    {
+                        tempLLDVList2.set( 6, tempLLDV );
+                        existingLLDV = tempLLDV;
+                    }
                     
                 }
 
                 int llbDes[] = {
-                				LLDataSets.LLIDSPL_PATIENT_NAME, LLDataSets.LLIDSPL_AGE, LLDataSets.LLIDSPL_SEX,
-                				LLDataSets.LLIDSPL_ADDRESS, LLDataSets.LLIDSPL_TEST, LLDataSets.LLIDSPL_LAB_DIAGNOSIS
-                				};
+                                        LLDataSets.LLIDSPL_PATIENT_NAME, LLDataSets.LLIDSPL_AGE, LLDataSets.LLIDSPL_SEX,
+                                        LLDataSets.LLIDSPL_ADDRESS, LLDataSets.LLIDSPL_TEST, LLDataSets.LLIDSPL_LAB_DIAGNOSIS,
+                                        LLDataSets.LLIDSPL_OUTCOME
+                                };
                 
-                for(int i = 0; i<6; i++)
+                for(int i = 0; i < 7; i++ )
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set( i, llDv );                                                           
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -873,11 +1042,11 @@
             List<LLDataValue> tempLLDVList;
             if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
             {
-            	tempLLDVList = new ArrayList<LLDataValue>();
+                tempLLDVList = new ArrayList<LLDataValue>();
             }
             else
             {
-            	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
             }
             
             tempLLDVList.add( dataValue );
@@ -895,8 +1064,8 @@
             
             for(int i = 0; i<=7; i++)
             {
-            	LLDataValue tempLLDV1 = new LLDataValue();
-            	tempLLDVList2.add(tempLLDV1);
+                LLDataValue tempLLDV1 = new LLDataValue();
+                tempLLDVList2.add(tempLLDV1);
             }
 
             Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -948,25 +1117,25 @@
             }
 
             int llbDes[] = {
-            				LLDataSets.LLMD_MOTHER_NAME, LLDataSets.LLMD_VILLAGE_NAME, LLDataSets.LLMD_AGE_AT_DEATH,
-            				LLDataSets.LLMD_DURATION_OF_PREGNANCY, LLDataSets.LLMD_DELIVERY_AT, LLDataSets.LLMD_NATURE_OF_ASSISTANCE,
-            				LLDataSets.LLMD_DEATH_CAUSE, LLDataSets.LLMD_AUDITED 
-            				};
+                                LLDataSets.LLMD_MOTHER_NAME, LLDataSets.LLMD_VILLAGE_NAME, LLDataSets.LLMD_AGE_AT_DEATH,
+                                LLDataSets.LLMD_DURATION_OF_PREGNANCY, LLDataSets.LLMD_DELIVERY_AT, LLDataSets.LLMD_NATURE_OF_ASSISTANCE,
+                                LLDataSets.LLMD_DEATH_CAUSE, LLDataSets.LLMD_AUDITED 
+                           };
             
             for(int i = 0; i<=7; i++)
             {
-            	LLDataValue llDv = tempLLDVList2.get(i);
-            	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-            	{
-            		llDv.setPeriod(existingLLDV.getPeriod());
-            		llDv.setSource(existingLLDV.getSource());
-            		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-            		llDv.setRecordNo(existingLLDV.getRecordNo());
-            		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-            		llDv.setValue(" ");
-            		
-            		tempLLDVList2.set(i, llDv);
-            	}	            		
+                LLDataValue llDv = tempLLDVList2.get(i);
+                if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                {
+                        llDv.setPeriod(existingLLDV.getPeriod());
+                        llDv.setSource(existingLLDV.getSource());
+                        llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                        llDv.setRecordNo(existingLLDV.getRecordNo());
+                        llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                        llDv.setValue(" ");
+                        
+                        tempLLDVList2.set(i, llDv);
+                }                               
             }
 
             lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -990,11 +1159,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                        tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                        tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -1015,8 +1184,8 @@
                 
                 for(int i = 0; i<=5; i++)
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                        LLDataValue tempLLDV1 = new LLDataValue();
+                        tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -1057,21 +1226,21 @@
                 }
 
                 int llbDes[] = {LLDataSets.LLB_CHILD_NAME,LLDataSets.LLB_VILLAGE_NAME,LLDataSets.LLB_SEX,
-                				LLDataSets.LLB_DOB,LLDataSets.LLB_WIEGH,LLDataSets.LLB_BREASTFED};
+                                                LLDataSets.LLB_DOB,LLDataSets.LLB_WIEGH,LLDataSets.LLB_BREASTFED};
                 for(int i = 0; i<=5; i++)
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set(i, llDv);
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -1095,11 +1264,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                        tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                        tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -1117,8 +1286,8 @@
                 
                 for(int i = 0; i<5; i++)
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                        LLDataValue tempLLDV1 = new LLDataValue();
+                        tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -1154,22 +1323,22 @@
                 }
 
                 int llbDes[] = {LLDataSets.LLD_CHILD_NAME,LLDataSets.LLD_VILLAGE_NAME,LLDataSets.LLD_SEX,
-                				LLDataSets.LLD_AGE_CATEGORY,LLDataSets.LLD_DEATH_CAUSE};
+                                                LLDataSets.LLD_AGE_CATEGORY,LLDataSets.LLD_DEATH_CAUSE};
                 
                 for(int i = 0; i<5; i++)
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set(i, llDv);
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -1192,11 +1361,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                        tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                        tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -1214,8 +1383,8 @@
                 
                 for(int i = 0; i<4; i++)
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                        LLDataValue tempLLDV1 = new LLDataValue();
+                        tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -1246,22 +1415,22 @@
                 }
 
                 int llbDes[] = {LLDataSets.LLUUIDSPE_SC_NAME,LLDataSets.LLUUIDSPE_DATE_OF_EVENT,
-                				LLDataSets.LLUUIDSPE_DEATAILS,LLDataSets.LLUUIDSPE_WAS_INVESTIGATED};
+                                                LLDataSets.LLUUIDSPE_DEATAILS,LLDataSets.LLUUIDSPE_WAS_INVESTIGATED};
                 
                 for(int i = 0; i<4; i++)
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set(i, llDv);
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -1284,11 +1453,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                        tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                        tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -1306,8 +1475,8 @@
                 
                 for(int i = 0; i<4; i++)
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                        LLDataValue tempLLDV1 = new LLDataValue();
+                        tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -1338,22 +1507,22 @@
                 }
 
                 int llbDes[] = {LLDataSets.LLUUIDSPEP_EVENT_REPORTED,LLDataSets.LLUUIDSPEP_DATE_OF_EVENT,
-                				LLDataSets.LLUUIDSPEP_WAS_INVESTIGATED,LLDataSets.LLUUIDSPEP_ACTION_TAKEN};
+                                                LLDataSets.LLUUIDSPEP_WAS_INVESTIGATED,LLDataSets.LLUUIDSPEP_ACTION_TAKEN};
                 
                 for(int i = 0; i<4; i++)
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set(i, llDv);
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -1377,11 +1546,11 @@
                 List<LLDataValue> tempLLDVList;
                 if(lldataValueMap == null || lldataValueMap.isEmpty() || lldataValueMap.get(String.valueOf(recordNo)) == null || lldataValueMap.get(String.valueOf(recordNo)).isEmpty())
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>();
+                        tempLLDVList = new ArrayList<LLDataValue>();
                 }
                 else
                 {
-                	tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
+                        tempLLDVList = new ArrayList<LLDataValue>(lldataValueMap.get(String.valueOf(recordNo)));
                 }
                 
                 tempLLDVList.add( dataValue );
@@ -1399,8 +1568,8 @@
                 
                 for(int i = 0; i<5; i++)
                 {
-                	LLDataValue tempLLDV1 = new LLDataValue();
-                	tempLLDVList2.add(tempLLDV1);
+                        LLDataValue tempLLDV1 = new LLDataValue();
+                        tempLLDVList2.add(tempLLDV1);
                 }
 
                 Iterator<LLDataValue> it2 = tempLLDVList1.iterator();
@@ -1436,22 +1605,22 @@
                 }
 
                 int llbDes[] = {LLDataSets.LLDIDSP_CHILD_NAME,LLDataSets.LLDIDSP_VILLAGE_NAME,LLDataSets.LLDIDSP_SEX,
-                				LLDataSets.LLDIDSP_AGE_CATEGORY,LLDataSets.LLDIDSP_DEATH_CAUSE};
+                                                LLDataSets.LLDIDSP_AGE_CATEGORY,LLDataSets.LLDIDSP_DEATH_CAUSE};
                 
                 for(int i = 0; i<5; i++)
                 {
-                	LLDataValue llDv = tempLLDVList2.get(i);
-                	if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
-                	{
-                		llDv.setPeriod(existingLLDV.getPeriod());
-                		llDv.setSource(existingLLDV.getSource());
-                		llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
-                		llDv.setRecordNo(existingLLDV.getRecordNo());
-                		llDv.setOptionCombo(existingLLDV.getOptionCombo());
-                		llDv.setValue(" ");
-                		
-                		tempLLDVList2.set(i, llDv);
-                	}	            		
+                        LLDataValue llDv = tempLLDVList2.get(i);
+                        if(tempLLDVList2.get(i).getDataElement() == null || tempLLDVList2.get(i).getDataElement().getId() != llbDes[i])
+                        {
+                                llDv.setPeriod(existingLLDV.getPeriod());
+                                llDv.setSource(existingLLDV.getSource());
+                                llDv.setDataElement(dataElementService.getDataElement(llbDes[i]));
+                                llDv.setRecordNo(existingLLDV.getRecordNo());
+                                llDv.setOptionCombo(existingLLDV.getOptionCombo());
+                                llDv.setValue(" ");
+                                
+                                tempLLDVList2.set(i, llDv);
+                        }                               
                 }
 
                 lldataValueMap.put( tempRecordNo, tempLLDVList2 );            
@@ -1488,15 +1657,15 @@
 
     }
 
-	
-	
-
-	
-	
-
-
-
-	
+        
+        
+
+        
+        
+
+
+
+        
 
 
     /*

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java	2011-10-07 12:25:01 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java	2011-10-14 13:44:18 +0000
@@ -31,8 +31,10 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategory;
@@ -47,6 +49,10 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.CalendarPeriodType;
 import org.hisp.dhis.period.Period;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
 
 import com.opensymphony.xwork2.ActionSupport;
 
@@ -95,6 +101,20 @@
         this.dataSetService = dataSetService;
     }
 
+    private UserService userService;
+
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -224,11 +244,6 @@
     public String execute()
         throws Exception
     {
-        
-        
-        
-        
-        
         // ---------------------------------------------------------------------
         // Validate selected OrganisationUnit
         // ---------------------------------------------------------------------
@@ -256,6 +271,19 @@
         // ---------------------------------------------------------------------
         // Remove DataSets which don't have a CalendarPeriodType or are locked
         // ---------------------------------------------------------------------
+        if ( currentUserService.getCurrentUser() != null && !currentUserService.currentUserIsSuper() )
+        {
+            UserCredentials userCredentials = userService.getUserCredentials( currentUserService.getCurrentUser() );
+
+            Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
+
+            for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
+            {
+                dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
+            }
+
+            dataSets.retainAll( dataSetUserAuthorityGroups );
+        }
 
         Iterator<DataSet> it = dataSets.iterator();
 
@@ -263,7 +291,14 @@
         {
             DataSet temp = it.next();
             
-            if(temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS )  || temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS ))
+            if( temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS )  || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS ) || 
+                temp.getName().equalsIgnoreCase( LLDataSets.LL_COLD_CHAIN ))
             {
                 if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) )
                 {
@@ -392,7 +427,7 @@
         }
         else
         {        	
-        	return DEFAULT_FORM;
+            return DEFAULT_FORM;
         }            
     }
 }

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java	2011-10-13 09:13:08 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java	2011-10-14 13:44:18 +0000
@@ -36,18 +36,18 @@
     public static final String LL_UU_IDSP_EVENTSP = "Line listing Unusual IDSP events- FormP";
     public static final String LL_DEATHS_IDSP = "Line listing Deaths IDSP";
     public static final String LL_IDSP_LAB = "Line Listing IDSP Lab";
-    public static final String LL_COLD_CHAIN = "Line listing  Cold Chain";
+    public static final String LL_COLD_CHAIN = "Line listing Cold Chain";
 
     //----------------------------------------------------------------
     // LineListing Cold Chain
     //----------------------------------------------------------------
-    //public static final int LLCC_EQUIPMENT = ;
-    //public static final int LLCC_MACHINE =;
-    //public static final int LLCC_MACHINE_WORKING =;
-    //public static final int LLCC_BREAKDOWN_DATE =;
-    //public static final int LLCC_INTIMATION_DATE =;
-    //public static final int LLCC_REPAIR_DATE =;
-    //public static final int LLCC_REMARKS =;
+    public static final int LLCC_EQUIPMENT = 5726;
+    public static final int LLCC_MACHINE = 5727;
+    public static final int LLCC_MACHINE_WORKING = 5728;
+    public static final int LLCC_BREAKDOWN_DATE = 5729;
+    public static final int LLCC_INTIMATION_DATE = 5730;
+    public static final int LLCC_REPAIR_DATE = 5731;
+    public static final int LLCC_REMARKS = 5732;
     
     //----------------------------------------------------------------
     // LineListing IDSP LAB
@@ -58,6 +58,7 @@
     public static final int LLIDSPL_ADDRESS = 1056;
     public static final int LLIDSPL_TEST = 1057;
     public static final int LLIDSPL_LAB_DIAGNOSIS = 1058;
+    public static final int LLIDSPL_OUTCOME = 3120;
     
     //----------------------------------------------------------------
     // LineListing Death IDSP

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2011-10-07 12:25:01 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2011-10-14 13:44:18 +0000
@@ -85,7 +85,10 @@
     <property name="selectedStateManager"
       ref="org.hisp.dhis.den.state.SelectedStateManager"/>
   </bean>
-  
+
+
+	
+	  
   <bean id="org.hisp.dhis.den.action.FormAction"
     class="org.hisp.dhis.den.action.FormAction" scope="prototype">
     <property name="dataValueService"
@@ -101,9 +104,12 @@
 	<property name="dataElementCategoryService"
       ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
 	<property name="dataSetLockService"
-      ref="org.hisp.dhis.datalock.DataSetLockService"/>
+      ref="org.hisp.dhis.datalock.DataSetLockService"/>  
 	<property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/> 	  
+      ref="org.hisp.dhis.dataset.DataSetService"/>
+    <property name="sectionService" ref="org.hisp.dhis.dataset.SectionService"/>
+	<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService"/>
+	<property name="userService" ref="org.hisp.dhis.user.UserService" />	    
   </bean>
 	
   <bean id="org.hisp.dhis.den.action.multidimensional.FormAction"

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm	2011-10-07 12:25:01 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm	2011-10-14 13:44:18 +0000
@@ -17,6 +17,8 @@
 	#parse( "/dhis-web-dataentry-national/lldidsp.vm" )
 #elseif($selDSName.equals($llidspl))
 	#parse( "/dhis-web-dataentry-national/llidspl.vm" )
+#elseif($selDSName.equals($llcoldchain))
+    #parse( "/dhis-web-dataentry-national/llcoldchain.vm" )	
 	
 #else
   <h3>No Dataentry form available for selected DataSet/DataSet not assign to selected Organisation Unit</h3>

=== added file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm	2011-10-14 13:44:18 +0000
@@ -0,0 +1,248 @@
+<form id="delForm" name="delForm" action="delLLRecord.action" method="post">
+    <input type="hidden" name="recordId" id="recordId" />
+</form>
+
+
+#set($recordNo = $maxRecordNo + 1)
+#set($lastRecord = -1)
+
+<script>
+    var nextRecordNo = $recordNo;
+    var nextFlag = 0;
+    
+    var slnos = $recordNos.size()+1;    
+    var lastRecordNo = -1;
+        
+    function addLLColdChainNewRow( thisValue, dataElementId, recordNo )
+    {
+        var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].slno' );    
+        var resVal = field.innerHTML;
+        
+       if( thisValue <= 0 || slnos != resVal )
+       {
+            return;
+       }
+       
+       if( !isColdChainRemarksFieldEntered( ) )
+       {
+           return;
+       }
+                
+        lastRecordNo = nextRecordNo;
+        nextRecordNo++;
+        slnos++;
+        
+        var tbl = document.getElementById("tblGrid");
+        var lastRow = tbl.rows.length;
+        var newRow = tbl.insertRow(lastRow);        
+            
+        var oCell = newRow.insertCell(0);
+        oCell.innerHTML = "<div id='value[5726].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + "</div>";
+
+        oCell = newRow.insertCell(1);
+        oCell.innerHTML = "<select name='entryfield' id='value[5726].value:value["+nextRecordNo+"].value' onchange='validateColdChainEquipmentField(5726,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='CCEQP1'>WIC- CFC</option><option value='CCEQP2'>WIC- non CFC</option><option value='CCEQP3'>WIF</option><option value='CCEQP4'>ILR Large- CFC</option><option value='CCEQP5'>ILR Large- non CFC</option><option value='CCEQP6'>ILR Small- CFC</option><option value='CCEQP7'>ILR Small- non CFC</option><option value='CCEQP8'>Deep Freezer- Large - CFC</option><option value='CCEQP9'>Deep Freezer- Large - non CFC</option><option value='CCEQP10'>Deep Freezer- Small - CFC</option><option value='CCEQP11'>Deep Freezer- Small - non CFC</option><option value='CCEQP12'>Generator</option><option value='CCEQP13'>Voltage stabilizer</option><option value='CCEQP14'>Cold box- Large</option><option value='CCEQP15'>Cold box- Small </option><option value='CCEQP16'>Vaccine carrier</option><option value='CCEQP17'>Vaccine van</option></select>";        
+    
+        oCell = newRow.insertCell(2);
+        oCell.innerHTML = "<input name='entryfield' id='value[5727].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainMachineNumberField(5727,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+    
+        oCell = newRow.insertCell(3);       
+        oCell.innerHTML = "<select name='entryfield' id='value[5728].value:value["+nextRecordNo+"].value' onchange='validateColdChainMachineWorkingField(5728,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='Y'>YES</option><option value='N'>NO</option><option value='NK'>NOT KNOWN</option></select>";
+
+        oCell = newRow.insertCell(4);
+        oCell.innerHTML = "<input name='entryfield' id='value[5729].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfBreakdownField(5729,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:10em text-align:center'>";
+                                
+        oCell = newRow.insertCell(5);
+        oCell.innerHTML = "<input name='entryfield' id='value[5730].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfIntimationField(5730,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+
+        oCell = newRow.insertCell(6);
+        oCell.innerHTML = "<input name='entryfield' id='value[5731].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfRepairField(5731,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+
+        oCell = newRow.insertCell(7);
+        oCell.innerHTML = "<input name='entryfield' id='value[5732].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainRemarksField(5732,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+
+        oCell = newRow.insertCell(8);
+        oCell.innerHTML = "<div id='"+nextRecordNo+"' ><a href='javascript:removeLLRecord( " + nextRecordNo + " )' title='remove'><img src='../images/delete.png' alt='remove'></a></div>";
+        
+        var inputFieldVal1 = "value\\[5729\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+		var inputFieldVal2 = "value\\[5730\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+		var inputFieldVal3 = "value\\[5731\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+        
+        datePicker( inputFieldVal1, false);
+		datePicker( inputFieldVal2, false);
+		datePicker( inputFieldVal3, false);
+    }
+</script>
+
+
+<div align="center"><h3><u>Linelisting : Cold Chain</u></h3></div>
+
+<table id="tblGrid" width="100%">
+    <tr>
+        <th width="2%">Sl. No.</th>
+        <th width="15%">Equipment make</th>
+        <th width="15%">Machine Number</th>
+        <th width="10%">Whether working</th>
+        <th width="15%">if not Date of breakdown<br>(YYYY-MM-DD)</th>
+        <th width="15%">Date of intimation<br>(YYYY-MM-DD)</th>
+        <th width="13%">Date of repair<br>(YYYY-MM-DD)</th>
+        <th width="13%">Remarks</th>
+        <th width="2%">&nbsp;</th>
+    <tr>
+
+#set( $mapKeys = $recordNos )
+#set($slno = 1)
+#foreach( $mapKey in $mapKeys)
+    <tr>
+    #set($llDataValues = $lldataValueMap.get($mapKey))
+    #set($count1 = 1)
+    #foreach( $llDataValue in $llDataValues )
+        #if( $count1 == 1 )
+            <td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
+            <td>
+                <select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateColdChainEquipmentField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
+					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end >---</option>
+					<option value="CCEQP1" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP1") selected #end >WIC- CFC</option>
+					<option value="CCEQP2" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP2") selected #end>WIC- non CFC</option>
+					<option value="CCEQP3" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP3") selected #end>WIF</option>
+					<option value="CCEQP4" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP4") selected #end>ILR Large- CFC</option>
+					<option value="CCEQP5" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP5") selected #end>ILR Large- non CFC</option>
+					<option value="CCEQP6" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP6") selected #end>ILR Small- CFC</option>
+					<option value="CCEQP7" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP7") selected #end>ILR Small- non CFC</option>
+					<option value="CCEQP8" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP8") selected #end>Deep Freezer- Large - CFC</option>
+					<option value="CCEQP9" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP9") selected #end>Deep Freezer- Large - non CFC</option>
+					<option value="CCEQP10" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP10") selected #end>Deep Freezer- Small - CFC</option>
+					<option value="CCEQP11" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP11") selected #end>Deep Freezer- Small - non CFC</option>
+					<option value="CCEQP12" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP12") selected #end>Generator</option>
+					<option value="CCEQP13" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP13") selected #end>Voltage stabilizer</option>
+					<option value="CCEQP14" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP14") selected #end>Cold box- Large</option>
+					<option value="CCEQP15" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP15") selected #end>Cold box- Small </option>
+					<option value="CCEQP16" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP16") selected #end>Vaccine carrier</option>
+					<option value="CCEQP17" #if($llDataValue.getValue() && $llDataValue.getValue()=="CCEQP17") selected #end>Vaccine van</option>					
+                </select>
+            </td>           	
+        #elseif( $count1 == 2 )
+            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainMachineNumberField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>
+        #elseif( $count1 == 3 )
+            <td>
+                <select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateColdChainMachineWorkingField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
+                    <option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
+                    <option value="Y" #if($llDataValue.getValue() && $llDataValue.getValue()=="Y") selected #end>YES</option>
+                    <option value="N" #if($llDataValue.getValue() && $llDataValue.getValue()=="N") selected #end>NO</option>
+                    <option value="NK" #if($llDataValue.getValue() && $llDataValue.getValue()=="NK") selected #end>NOT KNOWN</option>
+                </select>
+            </td>           
+        #elseif( $count1 == 4 )
+            <td>
+                <input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainDateOfBreakdownField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked ) disabled="disabled"#end>
+                #if( !$locked ) <script type="text/javascript"> datePicker('value\\[$llDataValue.getDataElement().getId()\\]\\.value\\:value\\[$llDataValue.getRecordNo()\\]\\.value', false); </script> #end   
+           </td>
+        #elseif( $count1 == 5 )
+            <td>
+                <input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainDateOfIntimationField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked ) disabled="disabled"#end>
+                #if( !$locked ) <script type="text/javascript"> datePicker('value\\[$llDataValue.getDataElement().getId()\\]\\.value\\:value\\[$llDataValue.getRecordNo()\\]\\.value', false); </script> #end   
+           </td>
+        #elseif( $count1 == 6 )
+            <td>
+                <input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainDateOfRepairField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked ) disabled="disabled"#end>
+                #if( !$locked ) <script type="text/javascript"> datePicker('value\\[$llDataValue.getDataElement().getId()\\]\\.value\\:value\\[$llDataValue.getRecordNo()\\]\\.value', false); </script> #end   
+           </td>
+        #elseif( $count1 == 7 )
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainRemarksField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>           </td>
+            <td #if( $locked ) style="display:none" #end>
+                <a href="#" onclick="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )" #if( $locked ) disabled="disabled"#end><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+            </td>           
+        #end
+        #set( $count1 = $count1 + 1 )
+        #set( $lastRecord = $llDataValue.getRecordNo() )                
+    #end
+    #set( $slno = $slno + 1 )
+    </tr>   
+#end
+
+#if( !$locked )
+<tr>
+    <td align="center"><div id='value[5726].value:value[$recordNo].slno' align='center'>$slno</div></td>    
+    <td>
+        <select name="entryfield" id="value[5726].value:value[$recordNo].value" onchange="validateColdChainEquipmentField(5726,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+            <option value="NONE" selected>---</option>
+            <option value="CCEQP1">WIC- CFC</option>
+            <option value="CCEQP2">WIC- non CFC</option>
+			<option value="CCEQP3">WIF</option>
+			<option value="CCEQP4">ILR Large- CFC</option>
+			<option value="CCEQP5">ILR Large- non CFC</option>
+			<option value="CCEQP6">ILR Small- CFC</option>
+			<option value="CCEQP7">ILR Small- non CFC</option>
+			<option value="CCEQP8">Deep Freezer- Large - CFC</option>
+			<option value="CCEQP9">Deep Freezer- Large - non CFC</option>
+			<option value="CCEQP10">Deep Freezer- Small - CFC</option>
+			<option value="CCEQP11">Deep Freezer- Small - non CFC</option>
+			<option value="CCEQP12">Generator</option>
+			<option value="CCEQP13">Voltage stabilizer</option>
+			<option value="CCEQP14">Cold box- Large</option>
+            <option value="CCEQP15">Cold box- Small </option>
+			<option value="CCEQP16">Vaccine carrier</option>
+			<option value="CCEQP17">Vaccine van</option>			
+        </select>
+    </td>   
+    <td><input name="entryfield" id="value[5727].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainMachineNumberField(5727,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+    <td>
+        <select name="entryfield" id="value[5728].value:value[$recordNo].value" onchange="validateColdChainMachineWorkingField(5728,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+            <option value="NONE" selected>---</option>
+            <option value="Y">YES</option>
+            <option value="N">NO</option>
+            <option value="NK">NOT KNOWN</option>
+        </select>   
+    </td>
+    <td>
+        #set( $tempVar =  "value[5729].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfBreakdownField(5729,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+		<script type="text/javascript">
+			var a = "value\\[5729\\]\\.value\\:value\\[$recordNo\\]\\.value";
+			datePicker( a, false);
+		</script>           
+    </td>   
+    <td>
+        #set( $tempVar =  "value[5730].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfIntimationField(5730,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+        <script type="text/javascript">
+            var a = "value\\[5730\\]\\.value\\:value\\[$recordNo\\]\\.value";
+            datePicker( a, false);
+        </script>           
+    </td>   
+    <td>
+        #set( $tempVar =  "value[5731].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfRepairField(5731,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+        <script type="text/javascript">
+            var a = "value\\[5731\\]\\.value\\:value\\[$recordNo\\]\\.value";
+            datePicker( a, false);
+        </script>           
+    </td>   
+    <td><input name="entryfield" id="value[5732].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainRemarksField(5732,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+    <td>
+        <div id='$recordNo'><a href="javascript:removeLLRecord( '$recordNo' ) " title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></div>
+    </td>   
+ </tr>
+#end
+</table>
+
+<input type="hidden" value="$!selStartDate" id="selStartDate" name="selStartDate" >
+<input type="hidden" value="$!selEndDate" id="selEndDate" name="selEndDate" >
+
+<script type="text/javascript">
+    
+    lastRecordNo = $lastRecord;
+    
+    function onLoad()
+    {
+        var recordSize = $recordNos.size();
+        if( recordSize >= 1)
+        {
+            document.getElementById('actions').style.display = 'block';
+        }
+    }
+</script>
+
+<script type="text/javascript">
+    onLoad();
+    <div id="caleninfo" name="caleninfo">aaa</div>
+</script>
\ No newline at end of file

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llidspl.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llidspl.vm	2011-10-13 09:13:08 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llidspl.vm	2011-10-14 13:44:18 +0000
@@ -23,7 +23,7 @@
             return;
        }
 
-       if( !isIDSPLDaignosisFieldEntered( ) )
+       if( !isIDSPLOutcomeFieldEntered( ) )
        {
            return;
        }
@@ -58,6 +58,9 @@
         oCell.innerHTML = "<input name='entryfield' id='value[1058].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateIDSPLDaignosisField(1058,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
 
         oCell = newRow.insertCell(7);
+        oCell.innerHTML = "<select name='entryfield' id='value[3120].value:value["+nextRecordNo+"].value' onchange='validateIDSPLOutcomeField(3120,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='UT'>Under treatment</option><option value='EXP'>Expired</option></select>";        
+
+        oCell = newRow.insertCell(8);
         oCell.innerHTML = "<div id='"+nextRecordNo+"' style='display: none;'><a href='javascript:removeLLRecord( " + nextRecordNo + " )' title='remove'><img src='../images/delete.png' alt='remove'></a></div>";
 
 	}
@@ -72,9 +75,10 @@
 		<th width="17%">Name of Patient</th>
 		<th width="10%">Age</th>
 		<th width="10%">Sex</th>
-		<th width="20%">Address</th>
-		<th width="18%">Name of Test done</th>
-		<th width="20%">Lab Diagnosis</th>
+		<th width="17%">Address</th>
+		<th width="17%">Name of Test done</th>
+		<th width="17%">Lab Diagnosis</th>
+		<th width="7%">Outcome</th>
 		<th width="2%">&nbsp;</th>
 	<tr>
 
@@ -86,7 +90,7 @@
 	#set($llDataValues = $lldataValueMap.get($mapKey))
 	#set($count1 = 1)
 	
-	#foreach( $llDataValue in $llDataValues)
+	#foreach( $llDataValue in $llDataValues )
 		#if($count1 == 3)
 			<td>
 				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateIDSPLSexField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
@@ -106,10 +110,19 @@
             <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue()) $llDataValue.getValue() #end" onchange="validateIDSPLTestField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end></td>
         #elseif($count1 == 6)
             <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue()) $llDataValue.getValue() #end" onchange="validateIDSPLDaignosisField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end></td>
-			<td #if( $locked ) style="display:none" #end>
+        #elseif($count1 == 7)
+            <td>
+                <select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateIDSPLOutcomeField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+                    <option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
+                    <option value="UT" #if($llDataValue.getValue() && $llDataValue.getValue()=="UT") selected #end>Under treatment</option>
+                    <option value="EXP" #if($llDataValue.getValue() && $llDataValue.getValue()=="EXP") selected #end>Expired</option>
+                </select>
+            </td>
+            <td #if( $locked ) style="display:none" #end>
                 <a href="#" onclick="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )" #if( $locked ) disabled="disabled"#end><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
             </td>
         #end
+
 		#set($count1 = $count1+1)
 		#set( $lastRecord = $llDataValue.getRecordNo() )
 	#end
@@ -120,8 +133,8 @@
 #if( !$locked )
 <tr>
 	<td align="center"><div id='value[1053].value:value[$recordNo].slno' align='center'>$slno</div></td>
-	<td><input name="entryfield" id="value[1053].value:value[$recordNo].value" type="text" value=" " onchange="validateIDSPLNameField(1053,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
-	<td><input name="entryfield" id="value[1055].value:value[$recordNo].value" type="text" value=" " onchange="validateIDSPLAgeField(1055,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1053].value:value[$recordNo].value" type="text" value="" onchange="validateIDSPLNameField(1053,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1055].value:value[$recordNo].value" type="text" value="" onchange="validateIDSPLAgeField(1055,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
 	<td>
 		<select name="entryfield" id="value[1054].value:value[$recordNo].value" onchange="validateIDSPLSexField(1054,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
 			<option value="NONE" selected>---</option>
@@ -129,9 +142,16 @@
 			<option value="F">Female</option>
 		</select>		
 	</td>	
-	<td><input name="entryfield" id="value[1056].value:value[$recordNo].value" type="text" value=" " onchange="validateIDSPLAddressField(1056,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
-	<td><input name="entryfield" id="value[1057].value:value[$recordNo].value" type="text" value=" " onchange="validateIDSPLTestField(1057,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
-	<td><input name="entryfield" id="value[1058].value:value[$recordNo].value" type="text" value=" " onchange="validateIDSPLDaignosisField(1058,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" onblur="addLLIDSPLNewRow()" ></td>
+	<td><input name="entryfield" id="value[1056].value:value[$recordNo].value" type="text" value="" onchange="validateIDSPLAddressField(1056,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1057].value:value[$recordNo].value" type="text" value="" onchange="validateIDSPLTestField(1057,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+	<td><input name="entryfield" id="value[1058].value:value[$recordNo].value" type="text" value="" onchange="validateIDSPLDaignosisField(1058,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  ></td>
+    <td>
+        <select name="entryfield" id="value[3120].value:value[$recordNo].value" onchange="validateIDSPLOutcomeField(3120,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" >
+            <option value="NONE" selected>---</option>
+            <option value="UT">Under treatment</option>
+            <option value="EXP">Expired</option>
+        </select>       
+    </td>		
     <td><div id='$recordNo' style="display: none;"><a href="javascript:removeLLRecord( '$recordNo' ) " title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></div></td>   		
 </tr>
 #end