Query across multiple CPs

OpenSpecimen allows users to create queries across multiple CPs or across ALL CPs that user has access to. This include custom forms that are attached to "All current and future CPs".

Querying specific CPs

  1. Go to Queries and click on 'Create'
  2. Important: Do not select any CP from the 'Select a Collection Protocol' dropdown
  3. Click on 'Collection Protocol' form and select 'Short Title' field.
  4. Select 'Is one of' as the query operator and in the condition values select the CPs from the dropdown for which the data is to be fetched.
  5. Note: If you want to query across all CPs (i.e. all CPs you have access to), then skip step #4.

Parameterizing CP titles

What is parameterized query?

Paremeterized filters are displayed in the results view, so that you can filter results during viewing the results. For more details, read Parameterizing queries.

  1. During, adding filter, click on 'Parameterized filter' check box in the filter pop-up, and click on 'Add
  2. A filter with all the collection protocols appears on the result page
  3. When user selects the CP from the list, the results are filtered based on the selection.

Querying custom form data

Case 1: Form is attached to 'All Present and Future Collection Protocols'

If a form is attached at all levels, then the form fields are displayed even when no CP is selected.

Case 2: Form is attached to one or more CPs (Collection Protocol Groups)

Querying of custom form data for forms linked to a single protocol as well as to multiple protocols present in a collection protocol group is possible. More details on CP Group: Collection Protocol Groups
If a form is linked to specific CP or a CP Group, then those forms are selected only when you select a specific CP/ CP Group as below:

  1. In the create query page, in the 'Select a Collection Protocol' dropdown, select the CP/CP Group to which a form is attached

  2. User will be able to see the form under the filter level to which it is attached for the selected CP/CP Group. For example, 'Smoking History' is attached at the 'Participant' level in the below screenshot for the selected protocol.