Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Example: Lung cancer patients who have had lung tumor specimens collected AND non-lung tumor specimens collected.

The example query file can be imported by downloading this file - Query FileThis can be achieved using a subquery as follows:

  1. Image RemovedSelect Queries from Dashboard and Click on '+Create'. Since this task does not specify which gender to collect samples from, click on Participant, select 'Gender', and then click on 'All' as an operator.

    Image Added
  2. To add condition for anatomic site, click on Specimen and select 'Anatomic Site'. Add filter with Operator 'Equals' and select 'Lung, NOS' as a value.
    Image RemovedImage Added

  3. To define type of specimens, click on Specimen and select 'Type'. Add 'Frozen Tissue' under the value.
    Image RemovedImage Added
  4. Since these types of samples are already collected, click on 'Collection Status' and select 'Collected' as the condition value.
    Image RemovedImage Added

  5. To define tissue type which is cancer in this case, click on Specimen and select 'Pathological Status'. Add filter with Operator 'Equals' and select 'Malignant' Malignant`under under the condition value.
    Image Added
  6. Click on "View Records".
    Image Removed
  7. To add non-lung tumor tissues, follow the same steps as these tissues are from the same group of patients and considered 'Intersection' query. Add 'Frozen Tissue' as type and 'Collected' as collection status.
    Image Removed
  8. Under specimen, click on 'Anatomic Site'. Select 'Not equal' as operator and 'Lung' as condition value.

    Image Removed

  9. Since these are also tumor tissues, click on Specimen, select 'Pathological Status' and add 'Malignant' under condition value.
    Image Removed
  10. Since these are two different type of samples but from same patient, these filters need to be linked using 'Intersection' operator.

    Image Removed

    Click on 'Save' in order to save the query under a specific name. Click on 'View Records' to see the results.
    Image RemovedFrom the Actions > Columns, select the PPID, Visit Name and Specimen Label column in the results view. Click on "Done"
    Image Added
  11. Go to Actions > Save. Give a name to query
    Image Added
  12. Similarly, create another query for non-lung tumour specimens. Click on Queries > Create.
  13. Add the filters 'Anatomic Site Not Equals Lung, NOS', 'Specimen Type Equals Frozen Tissue' and 'Collection Status  Equals Collected' from the 'Specimen' filter
    Image Added
  14. Click "View Records". From 'Actions' > 'Columns' select the columns PPID, Visit Name and Specimen Label. Click on 'Done' and save the query
    Image Added
  15. Now, create another query to select the records that match both of these conditions. Click 'Create'.
  16. Add the condition PPID Is One Of and check the checkbox for 'Records of another subquery'. In the select query dropdown, select the query 'Patients with lung tumour tissues'. Click on 'Add'
    Image Added
  17. Similarly add a condition PPID Is One Of Patients with non-lung tumour specimens. Click on 'Add'.
    Image Added
  18. This will show all specimens of participants belonging to these conditions. 
  19. Refer step 12 to add filters for including only lung tumor frozen tissues and non-lung tumor frozen tissues. Select Specimen Label Is One Of Patients with lung tumor tissues. Add it. Add another filter for Specimen Label Is One Of Patients with non-lung tumor specimens
    Image Added


  20. Now, in the expression above, click on the 'and' between filters 3 and 4 so that it changes to 'or'. Enclose the expression '3 or 4' in parentheses, as below
    Image Added
    Image Added
  21. The query for showing lung and non-lung tumor specimens is ready. Save it by clicking "Save" and giving it a title.
    Image Added

The main query and subqueries can be imported from here:

Patients with lung tumor tissue subquery

Patients with non-lung tumor tissue subquery

Main query

Import the subqueries first and then the main query. More information on parameterizing subqueries: Subqueries