How to query for list of visits with no stored specimens
Got feedback or spotted a mistake?

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

How to query for list of visits with no stored specimens

A user needs to identify visits where none of the specimens are stored in the biobank.

This can be achieved by subqueries. Refer https://openspecimen.atlassian.net/wiki/x/aoA-FQ .

You have to create two queries,
Query 1: Find all visits that have at least one stored specimen
Query 2: Find all visits that are not in Query 1.

Steps to create Query 1 (Subquery):

  1. Create a ‘New Query’.

  2. Expand the ‘Collection Protocol’ section to add a filter as:

    1. Collection Protocol >> Short Title Equals Tissue and stem cell biobank

  3. Expand the visit section to add a filter as:

    1. Visit >> Visit Status Equals Complete

  4. Expand the specimen section and add a filter as:

    1. Specimen >> Container Name Exists

image-20260423-091937.png
  1. Click on ‘View Records’ and select the columns as required. E.g., visit identifier, visit name.

  2. Save the query

Steps to create Query 2 (Main query):

  1. Create a ‘New Query’.

  2. Expand the ‘Collection Protocol’ section to add a filter as:

    1. Collection Protocol >> Short Title Equals Tissue and stem cell biobank

  3. Expand visit section to add filter as:

    1. Visit >> Visit Status Equals Complete

    2. Visit >> Identifier Is Not One Of Visits with stored specimens. (i.e. the first query)

To restrict the query results to only the required protocols. In the main query, add a filter to include Collection Protocol short titles.

image-20260423-092447.png

 

  1. Click on ‘View Records’ and select the columns as required. E.g., visit name, visit date.

  2. Save the query.

Got feedback or spotted a mistake?

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