← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11706: Add tabular report into dashboard.

 

------------------------------------------------------------
revno: 11706
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-08-20 11:58:55 +0700
message:
  Add tabular report into dashboard.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardSearchResult.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReportService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/DefaultPatientTabularReportService.java
  dhis-2/dhis-services/dhis-service-reporting/pom.xml
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardItem.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js


--
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/dashboard/DashboardItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2013-08-08 17:05:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardItem.java	2013-08-20 04:58:55 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.mapping.Map;
+import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
@@ -63,6 +64,7 @@
     public static final String TYPE_REPORT_TABLES = "reportTables";
     public static final String TYPE_REPORTS = "reports";
     public static final String TYPE_RESOURCES = "resources";
+    public static final String TYPE_PATIENT_TABULAR_REPORT = "patientTabularReports";
     
     private Chart chart;
     
@@ -77,6 +79,8 @@
     private List<Report> reports = new ArrayList<Report>();
 
     private List<Document> resources = new ArrayList<Document>();
+    
+    private List<PatientTabularReport> patientTabularReports = new ArrayList<PatientTabularReport>();
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -128,7 +132,10 @@
         {
             return TYPE_RESOURCES;
         }
-        
+        else if ( !patientTabularReports.isEmpty() )
+        {
+            return TYPE_PATIENT_TABULAR_REPORT;
+        }
         return null;
     }
 
@@ -282,11 +289,26 @@
     {
         this.resources = resources;
     }
+    
+    @JsonProperty( value = "patientTabularReports" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JacksonXmlElementWrapper( localName = "patientTabularReports", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( localName = "patientTabularReport", namespace = DxfNamespaces.DXF_2_0)
+    public List<PatientTabularReport> getPatientTabularReports()
+    {
+        return patientTabularReports;
+    }
+
+    public void setPatientTabularReports( List<PatientTabularReport> patientTabularReports )
+    {
+        this.patientTabularReports = patientTabularReports;
+    }
 
     // -------------------------------------------------------------------------
     // Merge with
     // -------------------------------------------------------------------------
 
+  
     @Override
     public void mergeWith( IdentifiableObject other )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardSearchResult.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardSearchResult.java	2013-07-22 15:17:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardSearchResult.java	2013-08-20 04:58:55 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.mapping.Map;
+import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
@@ -59,6 +60,8 @@
     private List<Report> reports = new ArrayList<Report>();
 
     private List<Document> resources = new ArrayList<Document>();
+    
+    private List<PatientTabularReport> patientTabularReports = new ArrayList<PatientTabularReport>();
 
     // -------------------------------------------------------------------------
     // Constructor
@@ -82,6 +85,7 @@
         results += reportTables.size();
         results += reports.size();
         results += resources.size();
+        results += patientTabularReports.size();
         return results;
     }
 
@@ -119,8 +123,15 @@
     public int getResourceCount()
     {
         return resources.size();
+    }  
+    
+    @JsonProperty
+    public int getPatientTabularReportCount()
+    {
+        return patientTabularReports.size();
     }    
 
+
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------
@@ -208,4 +219,18 @@
     {
         this.resources = resources;
     }
+
+    @JsonProperty( value = "patientTabularReports" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JacksonXmlElementWrapper( localName = "patientTabularReports", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( localName = "patientTabularReports", namespace = DxfNamespaces.DXF_2_0)
+    public List<PatientTabularReport> getPatientTabularReports()
+    {
+        return patientTabularReports;
+    }
+
+    public void setPatientTabularReports( List<PatientTabularReport> patientTabularReports )
+    {
+        this.patientTabularReports = patientTabularReports;
+    }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java	2013-05-30 09:08:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java	2013-08-20 04:58:55 +0000
@@ -33,14 +33,26 @@
 import java.util.Set;
 
 import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.user.User;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+
 /**
  * @author Chau Thu Tran
  * @version $PatientTabularReport.java May 7, 2012 12:41:41 PM$
  */
+
+@JacksonXmlRootElement( localName = "patientTabularReport", namespace = DxfNamespaces.DXF_2_0 )
 public class PatientTabularReport
     extends BaseIdentifiableObject
 {
@@ -108,12 +120,23 @@
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
-
+   
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getStartDate()
     {
         return startDate;
     }
 
+    public void setStartDate( Date startDate )
+    {
+        this.startDate = startDate;
+    }
+
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getUseFormNameDataElement()
     {
         return useFormNameDataElement;
@@ -124,11 +147,9 @@
         this.useFormNameDataElement = useFormNameDataElement;
     }
 
-    public void setStartDate( Date startDate )
-    {
-        this.startDate = startDate;
-    }
-
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getEndDate()
     {
         return endDate;
@@ -139,6 +160,11 @@
         this.endDate = endDate;
     }
 
+    @JsonProperty( value = "organisationUnits" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
     public Set<OrganisationUnit> getOrganisationUnits()
     {
         return organisationUnits;
@@ -149,6 +175,10 @@
         this.organisationUnits = organisationUnits;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlElementWrapper( localName = "filterValues", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( localName = "filterValue", namespace = DxfNamespaces.DXF_2_0)
     public List<String> getFilterValues()
     {
         return filterValues;
@@ -159,6 +189,9 @@
         this.filterValues = filterValues;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getLevel()
     {
         return level;
@@ -169,6 +202,9 @@
         this.level = level;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSortedOrgunitAsc()
     {
         return sortedOrgunitAsc;
@@ -179,6 +215,9 @@
         this.sortedOrgunitAsc = sortedOrgunitAsc;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getFacilityLB()
     {
         return facilityLB;
@@ -189,6 +228,9 @@
         this.facilityLB = facilityLB;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getUserOrganisationUnit()
     {
         return userOrganisationUnit;
@@ -199,6 +241,9 @@
         this.userOrganisationUnit = userOrganisationUnit;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getUserOrganisationUnitChildren()
     {
         return userOrganisationUnitChildren;
@@ -209,6 +254,9 @@
         this.userOrganisationUnitChildren = userOrganisationUnitChildren;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getUseCompletedEvents()
     {
         return useCompletedEvents;
@@ -219,6 +267,10 @@
         this.useCompletedEvents = useCompletedEvents;
     }
 
+    @JsonProperty
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "users", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "user", namespace = DxfNamespaces.DXF_2_0)
     public User getUser()
     {
         return user;
@@ -229,6 +281,10 @@
         this.user = user;
     }
 
+    @JsonProperty
+    @JsonView({ DetailedView.class, ExportView.class })
+    @JacksonXmlElementWrapper(localName = "programStages", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty(localName = "programStage", namespace = DxfNamespaces.DXF_2_0)
     public ProgramStage getProgramStage()
     {
         return programStage;
@@ -239,6 +295,9 @@
         this.programStage = programStage;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean getDisplayOrgunitCode()
     {
         return displayOrgunitCode;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReportService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReportService.java	2013-08-19 03:45:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReportService.java	2013-08-20 04:58:55 +0000
@@ -43,6 +43,8 @@
     PatientTabularReport getPatientTabularReport( int id );
     
     PatientTabularReport getPatientTabularReport( String name );
+    
+    PatientTabularReport getPatientTabularReportByUid( String uid );
 
     void deletePatientTabularReport( PatientTabularReport patientTabularReport );
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/DefaultPatientTabularReportService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/DefaultPatientTabularReportService.java	2013-08-19 03:45:04 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientreport/DefaultPatientTabularReportService.java	2013-08-20 04:58:55 +0000
@@ -81,6 +81,12 @@
     }
 
     @Override
+    public PatientTabularReport getPatientTabularReportByUid( String uid )
+    {
+        return tabularReportStore.getByUid( uid );
+    }
+
+    @Override
     public Collection<PatientTabularReport> getPatientTabularReports( User user, String query, Integer min, Integer max )
     {
         return tabularReportStore.get( user, query, min, max );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/pom.xml'
--- dhis-2/dhis-services/dhis-service-reporting/pom.xml	2013-07-16 14:06:13 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/pom.xml	2013-08-20 04:58:55 +0000
@@ -37,7 +37,11 @@
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-service-administration</artifactId>
     </dependency>
-    
+    <dependency>
+      <groupId>org.hisp.dhis</groupId>
+      <artifactId>dhis-service-patient</artifactId>
+    </dependency> 
+	
     <!-- JasperReports -->
 
     <dependency>

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2013-08-08 17:05:40 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2013-08-20 04:58:55 +0000
@@ -35,6 +35,7 @@
 import static org.hisp.dhis.dashboard.DashboardItem.TYPE_REPORT_TABLES;
 import static org.hisp.dhis.dashboard.DashboardItem.TYPE_RESOURCES;
 import static org.hisp.dhis.dashboard.DashboardItem.TYPE_USERS;
+import static org.hisp.dhis.dashboard.DashboardItem.TYPE_PATIENT_TABULAR_REPORT;
 
 import java.util.List;
 
@@ -47,6 +48,7 @@
 import org.hisp.dhis.dashboard.DashboardService;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.mapping.Map;
+import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
@@ -93,6 +95,7 @@
         result.setReportTables( objectManager.getBetweenByName( ReportTable.class, query, 0, MAX_PER_OBJECT ) );
         result.setReports( objectManager.getBetweenByName( Report.class, query, 0, MAX_PER_OBJECT ) );
         result.setResources( objectManager.getBetweenByName( Document.class, query, 0, MAX_PER_OBJECT ) );
+        result.setPatientTabularReports( objectManager.getBetweenByName( PatientTabularReport.class, query, 0, MAX_PER_OBJECT ) );
         
         return result;
     }
@@ -142,7 +145,10 @@
             {
                 item.getResources().add( objectManager.get( Document.class, contentUid ) );
             }
-            
+            else if ( TYPE_PATIENT_TABULAR_REPORT.equals( type ) )
+            {
+                item.getPatientTabularReports().add( objectManager.get( PatientTabularReport.class, contentUid ) );
+            }
             if ( availableItem == null )
             {
                 dashboard.getItems().add( 0, item );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardItem.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardItem.hbm.xml	2013-08-08 17:05:40 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardItem.hbm.xml	2013-08-20 04:58:55 +0000
@@ -38,11 +38,11 @@
       <list-index column="sort_order" base="0" />
       <many-to-many column="reportid" class="org.hisp.dhis.report.Report" foreign-key="fk_dashboarditem_reports_reportid" />
     </list>
-
-    <list name="resources" table="dashboarditem_resources">
-      <key column="dashboarditemid" foreign-key="fk_dashboarditem_resources_dashboardid" />
+ 	
+    <list name="patientTabularReports" table="dashboarditem_patientTabularReports">
+      <key column="dashboarditemid" foreign-key="fk_dashboarditem_patientTabularReports_dashboardid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="resourceid" class="org.hisp.dhis.document.Document" foreign-key="fk_dashboarditem_resources_documentid" />
+      <many-to-many column="patienttabularreportid" class="org.hisp.dhis.patientreport.PatientTabularReport" foreign-key="fk_dashboarditem_patientTabularReports_patientTabularReportid" />
     </list>
 
   </class>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java	2013-05-19 08:24:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java	2013-08-20 04:58:55 +0000
@@ -86,9 +86,9 @@
     // Input
     // -------------------------------------------------------------------------
 
-    private Integer id;
+    private String id;
 
-    public void setId( Integer id )
+    public void setId( String id )
     {
         this.id = id;
     }
@@ -171,7 +171,7 @@
     public String execute()
         throws Exception
     {
-        tabularReport = tabularReportService.getPatientTabularReport( id );
+        tabularReport = tabularReportService.getPatientTabularReportByUid( id );
 
         programStage = tabularReport.getProgramStage();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java	2013-02-19 06:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java	2013-08-20 04:58:55 +0000
@@ -79,6 +79,18 @@
     // Output
     // -------------------------------------------------------------------------
 
+    private String id;
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
     private Collection<Program> programs;
 
     public Collection<Program> getPrograms()
@@ -110,12 +122,12 @@
         orgunitGroups = new ArrayList<OrganisationUnitGroup>(
             organisationUnitGroupService.getAllOrganisationUnitGroups() );
         Collections.sort( orgunitGroups, IdentifiableObjectNameComparator.INSTANCE );
-        
+
         programs = programService.getAllPrograms();
-        programs.retainAll( programService.getProgramsByCurrentUser());
-        
+        programs.retainAll( programService.getProgramsByCurrentUser() );
+
         levels = organisationUnitService.getOrganisationUnitLevels();
-
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-08-19 06:54:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-08-20 04:58:55 +0000
@@ -32,6 +32,9 @@
 				
 				obj.system.accessPatientAttributes = r.user.accessPatientAttributes;
 				
+				obj.report={};
+				obj.report.id = r.id;
+				
 				return obj;
 			}
 		}
@@ -201,6 +204,36 @@
 				a[i] = TR.conf.util.jsonEncodeString(a[i]);
 			}
 			return a;
+		},
+		getURLParameters: function(paramName) {
+			var sURL = window.document.URL.toString();  
+			if (sURL.indexOf("?") > 0)
+			{
+			   var arrParams = sURL.split("?");         
+			   var arrURLParams = arrParams[1].split("&");      
+			   var arrParamNames = new Array(arrURLParams.length);
+			   var arrParamValues = new Array(arrURLParams.length);     
+			   var i = 0;
+			   for (i=0;i<arrURLParams.length;i++)
+			   {
+					var sParam =  arrURLParams[i].split("=");
+					arrParamNames[i] = sParam[0];
+					if (sParam[1] != ""){
+						arrParamValues[i] = unescape(sParam[1]);
+					}
+					else{
+						arrParamValues[i] = "";
+					}
+			    }
+
+				for (i=0;i<arrURLParams.length;i++)
+				{
+					if(arrParamNames[i] == paramName){
+						return arrParamValues[i];
+					}
+				}
+			}
+			return "";
 		}
 	}
 };
@@ -218,8 +251,9 @@
     Ext.QuickTips.init();
     document.body.oncontextmenu = function(){return false;}; 
     
+	var reportId = TR.conf.util.getURLParameters('id');
     Ext.Ajax.request({
-        url: TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.initialize,
+        url: TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.initialize + "?id=" + reportId,
         success: function(r) {
             
     TR.init = TR.conf.init.ajax.jsonfy(r);    
@@ -3504,7 +3538,7 @@
 								element.addClsOnOver('link');
 								element.load = function() {
 									favoriteWindow.hide();
-									TR.util.crud.favorite.run( record.data.id );
+									TR.util.crud.favorite.run( record.data.uid );
 								};
 								element.dom.setAttribute('onclick', 'Ext.get(this).load();');
 							}
@@ -6965,6 +6999,12 @@
 				for( var i in TR.init.system.rootnodes){
 					TR.state.orgunitIds.push( TR.init.system.rootnodes[i].localid );
 				}
+				
+				if( TR.init.report.id != "")
+				{
+					Ext.getCmp('reportTypeGroup').setValue(true);
+					TR.util.crud.favorite.run(TR.init.report.id);
+				}
             },
             resize: function(vp) {
                 TR.cmp.region.west.setWidth(TR.conf.layout.west_width);
@@ -6978,5 +7018,6 @@
         }
     });
     
+	
     }});
 }); 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-05-23 14:28:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-08-20 04:58:55 +0000
@@ -1,4 +1,5 @@
 {
+	"id": "$!id",
 	"user":
 	{
 		"id":"$!currentUser.id",

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2013-08-13 16:25:17 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js	2013-08-20 04:58:55 +0000
@@ -69,6 +69,13 @@
                "<a href='javascript:dhis2.db.viewImage( \"../api/reportTables/${id}/data.html\", \"${name}\" )'>${i18n_view}</a>" +
                "<a href='javascript:dhis2.db.viewShareForm( \"${id}\", \"table\", \"${name}\" )'>${i18n_share}</a></div>" +
                "<div id='pivot-${itemId}' onclick='dhis2.db.exploreReportTable( \"${id}\" )' title='${i18n_click}'></div>" +
+               "<script type='text/javascript'>dhis2.db.renderReportTable( '${id}', '${itemId}' );</script></div></li>",
+	
+	patientTabularReport: "<li id='liDrop-${itemId}' class='liDropItem'><div class='dropItem' id='drop-${itemId}' data-item='${itemId}'></div></li>" +
+               "<li id='li-${itemId}' class='liItem'><div class='item' id='${itemId}'><div class='itemHeader'><a href='javascript:dhis2.db.removeItem( \"${itemId}\" )'>${i18n_remove}</a>" +
+               "<a href='javascript:dhis2.db.viewImage( \"../api/reportTables/${id}/data.html\", \"${name}\" )'>${i18n_view}</a>" +
+               "<a href='javascript:dhis2.db.viewShareForm( \"${id}\", \"table\", \"${name}\" )'>${i18n_share}</a></div>" +
+               "<div id='pivot-${itemId}' onclick='dhis2.db.exploreReportTable( \"${id}\" )' title='${i18n_click}'></div>" +
                "<script type='text/javascript'>dhis2.db.renderReportTable( '${id}', '${itemId}' );</script></div></li>"
 };
 
@@ -344,6 +351,10 @@
 				{
 					dhis2.db.renderLinkItem( $d, item.id, item.resources, "Resources", position, "../api/documents/", "/data" );
 				}
+				else if ( "patientTabularReports" == item.type )
+				{
+					dhis2.db.renderLinkItem( $d, item.id, item.patientTabularReports, "Person tabular reports", position, "../dhis-web-caseentry/app/index.html?type=patientTabularReport&id=", ""  );
+				}
 			} );
 			
 			dhis2.db.renderLastDropItem( $d, parseInt( data.items.length - 1 ) );
@@ -558,6 +569,17 @@
 				$h.append( $.tmpl( dhis2.db.tmpl.hitItem, { "link": "../api/documents/" + o.id, "img": "document_small", "name": o.name, "type": "resources", "id": o.id } ) );
 			}
 		}
+		
+		if ( data.patientTabularReportCount > 0 )
+		{
+			$h.append( $.tmpl( dhis2.db.tmpl.hitHeader, { "title": "Tabular reports" } ) );
+			
+			for ( var i in data.patientTabularReports )
+			{
+				var o = data.patientTabularReports[i];
+				$h.append( $.tmpl( dhis2.db.tmpl.hitItem, { "link": "../dhis-web-caseentry/generateTabularReport.action?uid=" + o.id, "img": "document_small", "name": o.name, "type": "patientTabularReports", "id": o.id} ) );
+			}
+		}
 	}
 	else
 	{