Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

OpenSpecimen allows to configure graphical dashboards with various counters and graphs. This helps users to get a summary view of the data collected for the protocol. A default dashboard is shipped with OpenSpecimen which is set for all protocols. But users can change this to update the dashlets as per requirement. Dashboard feature is available as an enterprise plugin.

Default dashboard

When OpenSpecimen is deployed with dashboard plugin, all protocols are set with a default dashboard with below elements:

  1. Metrics(Counts)
    1. Total participants
    2. Total primary specimens
    3. Total available specimens
    4. Total distributed specimens
  2. Graphs
    1. Specimens by type
    2. Specimens by anatomic site
    3. Specimens collected vs distributed in previous quarter
    4. Specimens stored by freezer

Creating dashlets

Each of the above elements - metrics and graphs are considered as dashlets. These dashlets can either be created using query interface or REST API. For more details on creating dashlets using query interface, refer to <>.

Create dashlet via API

URL: http[s]:<host>:<port>/openspecimen/rest/ng/dashlet-configs

URLhttp://<host>:<port>/openspecimen/rest/ng/dashlet-configs
MethodPOST
Requestapplication/json
Example json for Metric

Dashlet to include metric : Count of completed visits

{
	"name":"visit_count",
	"title":"Visits",
        "type":"COUNTER",
	"dataSource":{
		"options":{
			"criteria":" SpecimenCollectionGroup.activityStatus = \"Active\" and  SpecimenCollectionGroup.collectionStatus = \"Complete\" and  Specimen.collectionStatus = \"Collected\"  ",
			"metric":{
				"expr":"count(distinct SpecimenCollectionGroup.name)",
				"title":"Visits"
			}
		},
		"type":"AQL"
	},
	"chartOpts":{},
	"activityStatus":"Active"
}
Example json for graph

Dashlet to include graph : Available aliquots by type

  {
    "name": "dash_1_20161215_0251537",
    "title": "Available aliquots by type",
    "type": "CHART",
    "dataSource": {
      "options": {
        "criteria": " Specimen.collectionStatus = \"Collected\" and  Specimen.lineage = \"Aliquot\" and  Specimen.specimenPosition.containerName exists   ",
        "metric": {
          "expr": "count(distinct Specimen.id)",
          "title": "Aliquots"
        },
        "category": {
          "expr": "Specimen.type",
          "title": "Type"
        }
      },
      "type": "AQL"
    },
    "chartOpts": {
      "type": "Pie"
    },
    "activityStatus": "Active"
  }

Configuring dashboards to CP

Different dashboards can be set per CP. To change settings per CP, go to individual protocol settings and edit the dashlets to be included or excluded.

To set default dashboard for all CPs, follow the below steps:

Step 1: Query existing default system level dashboard for all CPs:
GET <app_url>/rest/ng/dashboards?view=CollectionProtocol&viewKey=cpId&viewKeyValues=-1
Step 2: Use above API response to obtain dashboard ID, add make required changes.
URLhttp://<host>:<port>/openspecimen/rest/ng/dashboards/{dashboardId}
MethodPUT
Requestapplication/json
Example json
{
  "view": "CollectionProtocol",
  "viewParams": {
    "cpId": "-1"
  },
  "dashlets": [
    {
      "config": {
        "name": "dash-sys-participants"
      },
      "sortOrder": 1
    },
    {
      "config": {
        "name": "visit_count"
      },
      "sortOrder": 2
    },
    {
      "config": {
        "name": "dash_1_20161214_0406950"
      },
      "sortOrder": 3
    },
    {
      "config": {
        "name": "dash_1_20161214_0357273"
      },
      "sortOrder": 4
    },
    {
      "config": {
        "name": "dash_1_20161215_0251537"
      },
      "sortOrder": 5
    },
    {
      "config": {
        "name": "dash-spmns-by-anatomic"
      },
      "sortOrder": 6
    },
    {
      "config": {
        "name": "dash-sys-coll-dist"
      },
      "sortOrder": 7
    },
{
      "config": {
        "name": "dash-sys-coll-dist-yr"
      },
      "sortOrder": 8
    },
    {
      "config": {
        "name": "dash-spmns-by-path"
      },
      "sortOrder": 9
    }
  ],
  "activityStatus": "Active"
}

Configuring dashboards to SpecimenCatalog

Query existing dashboard set for public SpecimenCatalog:

Method: Get 

URL: http://<host>:<port>/rest/ng/dashboards?view=SpecimenCatalog

JSON for making changes to SpecimenCatalog dashboard is similar to CP dashboard. Only the 'view' has to be replaced with 'SpecimenCatalog'.


  • No labels