NIH | National Cancer Institute | NCI Wiki  

Question: How do I use the data search panel to perform a query that contains both "and" and "or" logical operators?

Topic: caIntegrator Usage

Release: caIntegrator 1.2 and above

Date entered: 03/23/2011

Related Forum Posting

Details about the Question

I want to run a query containing both "and" and "or" operators (see an example query below). However, I could not find the selection buttons to construct such a query. Is there any way around it?

Select:
all patients who are male AND their tumor subtypes = "Classical"
OR
all patients who are female

Answer

In the current design, the radio buttons for logical operators are at the end of the entire query, Therefore, users can only choose either "OR" or "AND" for the whole query. A more complex query as stated in the question requires the flexibility to select the logical operator at the end of each SQL predicate. This feature was not present in the current version.

One way to get around this in current version of caIntegrator is to execute the query in multiple steps. Refer to the steps that follow.

Step 1: Execute a query to select all patients who are male AND have tumor subtypes = "Classical."

(1) On the criteria tab, from the first drop down list, select Patient. (2) Click the Add button to add a new predicate. (3) From the Patient drop down lists, select GENDER equals MALE. (4) Click Add to add a new predicate. (5) From the Patient drop down lists, select Subtype equals Classical. (6) Select the logical operator "and". (7) Click the Run Query button.
screenshot representing the steps

Step 2: Save the query results as a subject list.

(1) On the Query Results tab, click the Save Subject List button. (2) In the Save Subject List dialog, enter the name for the subject list, "male and classical" in the example. (3) Click the Save button in the dialog.
screenshot representing the steps

Step 3: Create a new query using the subject list as the first predicate.

(1) On the Criteria tab, Click the saved subject list, "male and classical" in the example. (2) Note that the first drop down list field and the saved list fields are populated.
screenshot representing the steps

Step 4: Add "patient's GENDER = female" as the final predicate. Run the query.

(1) On the Criteria tab, from the first drop down list, select Patient. (2) Click the Add button to add a new predicate.(4,5,6) Select Patient GENDER equals FEMALE. (7) Select the logical operator "or". (8) Click the Run Query button.
screenshot representing the steps

Have a comment?

Please leave your comment in the caIntegrator End User Forum.