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): Create a ‘New Query’. Expand the ‘Collection Protocol’ section to add a filter as: Collection Protocol >> Short Title Equals Tissue and stem cell biobank Expand the visit section to add a filter as: Visit >> Visit Status Equals Complete Expand the specimen section and add a filter as: Specimen >> Container Name Exists Click on ‘View Records’ and select the columns as required. E.g., visit identifier, visit name. Save the query Steps to create Query 2 (Main query): Create a ‘New Query’. Expand the ‘Collection Protocol’ section to add a filter as: Collection Protocol >> Short Title Equals Tissue and stem cell biobank Expand visit section to add filter as: Visit >> Visit Status Equals Complete 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. Click on ‘View Records’ and select the columns as required. E.g., visit name, visit date. Save the query.
Got feedback or spotted a mistake?

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