Dashlet: Additional Features
Got feedback or spotted a mistake?

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

Dashlet: Additional Features

Embed Dashlets

OpenSpecimen provides an embed option so that the dashlets can be embedded into other web pages, such as a university site, biobank site etc., using the HTML tag.

Only the Super admins can see the embed option after they log in.

  • Log in as Super Admin

  • Click on the three dots in the corner of the dashlet → Embed.

    image-20250808-111339.png
  • A pop-up will open with the HTML tag that can be added to the web page.

    image-20250808-111436.png

Export Dashboard

You can export the dashboard summary as a PDF file.

  1. Navigate to 'Collection Protocols' → Select a CP.

  2. From the participants-list-view page, click on 'More' → Dashboard.

    image-20250808-085204.png
  3. Clicking on the print button will download/pop-up window will apear to save this as a PDF.

    image-20250808-085630.png

    Example:

Editing Dashlet Definition

In some cases, after you create a dashlet using a query, you would like to edit the dashlet for

  • Better graphical representation

  • Combine two dashlets, to show two different criteria in one bar graph

  • Move the dashlet from one OpenSpecimen instance to other

For such cases, you need to edit the dashlet definition, which is a JSON file. Below is an example of creating a dashlets for specimens collected and distributed in the last quarter.

  • Create a query with condition as mentioned below. For more details, refer to the wiki page

  • Create a bar type dashlet with cumulative count of specimen ID as the metrics (Y axis) and the collection date(X axis) as category. See the attached image below. For more details, refer to the wiki page.

  • Create a query with the below conditions.

  • Create a bar type dashlet with cumulative count of specimen ID as the metrics (Y axis) and the order execution date(X axis) as category. See the attached image below. For more details, refer to the wiki page.

  • Refer to the export section below and download both the dashlet definition files.

  • Combine the two definition files.

JSON File

Example 1: Specimen Collected and Distributed in last quarter

To customize the dashlet for specific collection protocols—ensuring it retrieves records from only one or two protocols—simply add the following syntax at the beginning of your criteria.

CollectionProtocol.shortTitle in (\"<CP_NAME_1>\",\"CP_NAME_2\") and
  • Refer to the import section below and import the file. Attached file for reference.

  • The dash lets with both conditions of specimens collected and distributed will be created. See the image below

{ "name" : "dash-sys-coll-dist-lastquat", "title" : "Specimen Collected and Distributed in last quarter", "type" : "CHART", "dataSource" : { "options" : { "dataSources" : [ { "type" : "AQL", "options" : { "category" : { "expr" : "Specimen.createdOn", "title" : "Creation Time" }, "metrics" : [ { "expr" : "c_count(Specimen.id)", "title" : "Collected Specimens" } ], "criteria" : "Specimen.createdOn exists and Specimen.collectionStatus = \"Collected\" and date_range(Specimen.createdOn, last_cal_qtr)" } }, { "type" : "AQL", "options" : { "category" : { "expr" : "Specimen.specimenOrders.executionDate", "title" : "Distribution Time" }, "metrics" : [ { "expr" : "c_count(Specimen.id)", "title" : "Distributed Specimens" } ], "criteria" : "Specimen.specimenOrders.executionDate exists and Specimen.specimenOrders.orderStatus = \"EXECUTED\" and date_range(Specimen.specimenOrders.executionDate, last_cal_qtr)" } } ], "categoryType" : "date" }, "type" : "SERIES_MIXER" }, "chartOpts" : { }, "activityStatus" : "Active" }
image-20250523-090310.png

 

Example 2: Trends in Specimen Collection per Type

{ "name": "combined_cumulative_chart", "title": "Combined Cumulative Chart", "type": "CHART", "dataSource": { "options": { "dataSources": [ { "type": "AQL", "options": { "criteria": "date_range(Specimen.extensions.SpecimenCollectionEvent.time,last_cal_month, 12) and date_format(Specimen.extensions.SpecimenCollectionEvent.time,\"%month2%/%year4%\") any and Specimen.type = \"Fresh Tissue\"", "metric": { "expr": "c_count(distinct Specimen.id)", "title": "Fresh Tissue" }, "category": { "expr": "date_format(Specimen.extensions.SpecimenCollectionEvent.time,\"%month2%/%year4%\")", "title": "Date" } } }, { "type": "AQL", "options": { "criteria": "date_range(Specimen.extensions.SpecimenCollectionEvent.time,last_cal_month, 12) and date_format(Specimen.extensions.SpecimenCollectionEvent.time,\"%month2%/%year4%\") any and Specimen.type = \"Saliva\"", "metric": { "expr": "c_count(distinct Specimen.id)", "title": "Saliva" }, "category": { "expr": "date_format(Specimen.extensions.SpecimenCollectionEvent.time,\"%month2%/%year4%\")", "title": "Date" } } } ] }, "type": "SERIES_MIXER" }, "chartOpts": { "scales": { "yAxes": [ { "ticks": { "beginAtZero": true } } ], "xAxes": [] }, "type": "line" }, "activityStatus": "Active" }
image-20250523-090203.png

 

 

Dashlets FAQs

https://openspecimen.atlassian.net/wiki/x/aABK5Q

Got feedback or spotted a mistake?

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