Page History
...
Example Box | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Quick Links
|
Creating the Query
In order to create your query, you will need to define what information will be retrieved from the databases. Selected items from other i2b2 Web Client views can be dragged and dropped (copied) into the Query Tool view. Below is a list of the various items that can be dragged and dropped in to the Query Tool as you create your query:
Concepts
...
Concepts can be defined as terms, results, providers, etc. They can be added as a group (folder ()) or individually by dragging the item(s) from Navigate Terms, Find Terms, and Workplace views.
Modifiers
Modifiers are associated with a concept or group of concepts. They can be added as a group ( modifier folder) or individually by dragging the item(s) from Navigate Terms, Find Terms, and Workplace views.
Previous Query
A new query can be created from one that has already been run by dragging the previous query from Previous Query and Workplace views.
Patient Set
A patient set can be can be used in a query by dragging the patient set from Previous Query and Workplace views . When you run the query it will use the patient set to query against.
Encounter Set
...
and Concept Folders
Modifiers and Modifier Folders
Previous Queries
Patients and Patient Sets
Encounter Sets
...
To Create a query, locate the item or items that you would like to query from the Terms Panel, Workplace or Previous Queries. Drag these items in to a Group Panel.
Select a Folder or Item.
For example, From Navigate Terms Panel (#1) select Laboratory Tests and then Chemistry
Grab "Cardiac Tests" and drag over
And drop it in to panel "Group 1".
This Group 1 Panel now contains the term that will be used during the process of querying the database.
Find Terms View
The Find Terms view provides a way to search for a particular concept.
NOTE: For detailed information on how to search for terms, please click on the Find Terms section. |
Add Concept From Find Terms View
In the Find Terms view, search for the item(s) you want to add.
Highlight the concept or folder by clicking on its name.
While holding the left mouse button down, drag the item over to the Query Tool view
Drop the item into the panel labeled Group 1.
The item will now display in the panel for Group 1.
Group Information Box
The content of the information box for each Group Panel will change depending on whether or not a term is listed in the panel / group.
- Term(s) listed (See Group 1)
- The message will appear as "one or more of these"
- The color of the box will be green
- An additional information box will appear between panels
- Additional terms or folders can now be dragged to this Panel
- No term(s) listed (See Group 2)
- The message will appear as "drop a term on here"
- The color of the box will be yellow
- Term(s) listed (See Group 1)
NOTE: Once you add an item to a panel, an additional information box will appear between the two panels containing the text "AND". This is to indicate that each panel will be joined with an AND operator when the SQL query is created |
...
. |
Operators
There are two operators, known as SQL Logical Operators, which are necessary when running a query that has more than one item. These operators provide a way to specify exactly what you want to retrieve. The operators are the 'AND' and 'OR' operators.
IMPORTANT: The query tool knows which operator to use based on the panels used when defining the query. It is important to verify you are setting up your query correctly as each operator will return different results. |
The AND Operator
The AND operator returns a record if both the first condition and the second conditions are true. The query tool uses the AND operator when concepts are listed in different Group panels.
Example:
WHAT: Return only those patients who have Acute Myocardial Infarction AND Angina Pectoris.
HOW: In the query tool add the concept Acute Myocardial Infarction to Group 1 and then add the concept Angina Pectoris to Group 2.
RESULT: The The population is limited by requiring the patients fulfill both requirements. In this case using a sample database, there were only 3 patients who had BOTH conditions.
OR Operator
The OR operator returns a record if either the first condition or the second conditions are true.
The query tool uses the OR operator when concepts are listed in different panels.
Example:
WHAT: Return only those patients who have Acute Myocardial Infarction OR Angina Pectoris.
HOW: In the query tool add both concepts Acute Myocardial Infarction and Angina Pectoris to Group 1.
RESULT: The population is broadened to include all patients who fit either EITHER one of those criteria.
Add Concepts
Concepts can be added to the Query Tool view by simply dragging the concept from one of the following views.
Navigate Terms view
Find Terms view
Workplace view
Navigate or Find Terms View
The Navigate Terms view contains a hierarchical display of all the items that can be used to search the database.
...
NOTE:
How the items are grouped and displayed is dependent on how the database is setup.
Add Concept From Navigate Terms View
In the Navigate Terms view, expand the folder(s) that contains the concept or grouping of concepts you want to add.
Highlight the concept or folder () by clicking on its name.
While holding the left mouse button down, drag the item over to the Query Tool view
Drop the item into the panel labeled Group 1.
The item will now display in the panel for Group 1.
Find Terms View
The Find Terms view provides a way to search for a particular concept.
...
NOTE:
For detailed information on how to search for terms, please click on the Find Terms section.
Add Concept From Find Terms View
In the Find Terms view, search for the item(s) you want to add.
Highlight the concept or folder by clicking on its name.
While holding the left mouse button down, drag the item over to the Query Tool view
Drop the item into the panel labeled Group 1.
...
In the sample database, this increased the total to 9 patients who had either condition.
Example Box | ||||
---|---|---|---|---|
| ||||
|
...