The Query Tool panel is where queries are constructed and run.
3.1 Layout
- Panel Options allow users to (1) view the XML exchange between the client and the i2b2 server (if enabled) , (2) set options for the panel, and (3) resize the panel.
- Query Name Display shows the name of the current query. Users can also drop a previous query here to load it.
- Query Timing Selector enables users to select the appropriate timings for their query, including temporal queries.
- Query Groups are where users can drag and drop terms to build queries. There are initially three Groups, but more can be added.
- Tool Bar contains buttons to run queries, clear all the panels, add new panels, and navigate between panels.
3.2 Creating a Query
3.2.1 i2b2 Items for Querying
These items may be dragged into Query Groups to construct queries.
Icons | Names | Description |
---|---|---|
Terms | Terms (also called concepts) are the words or phrases that make up vocabularies. Terms are the basic query items. | |
Term Groups | Related terms are grouped into hierarchies. When a term group is used in a query, all terms in the group are searched for. | |
Modifiers | Modifiers are descriptors that can be attached to terms to make small changes to them. For example, a Diagnosis concept may be additionally described by Modifiers "Principal Diagnosis" or "Secondary diagnosis." | |
Modifier Groups | Groups of Modifiers, similar to Term Groups. | |
/ | Previous Queries | Previous Queries are queries that have been run before and are stored in the 'Previous Queries' panel. |
Individual Patients | If selected when running a query, a query can return a Patient Set,which is a set of patient numbers that satisfy the query criteria. The Patient Set is stored with the query in the Previous Queries panel. The Patient Set can be expanded, and individual subjects dragged into query groups to be used in a new query. | |
Patient Sets | If selected when running a query, a query can return a Patient Set, which is a set of patient numbers that satisfy the query criteria. The Patient Set is stored with the query in the Previous Queries panel and can be dragged into query groups to be used in a new query. | |
Encounter Sets | If selected when running a query, a query can return an Encounter Set, which is a set of encounter numbers that satisfy the query criteria. The Encounter Set is stored with the query in the Previous Queries panel and can be dragged into query groups to be used in a new query. |
3.2.1 Operators and Order of Precedence
i2b2 items are combined using Boolean operators AND and OR.
Items within each Group are first ORed together. The Groups are then ANDed together.
Example 1 (AND): This query finds patients with Acute Myocardial Infarction AND Angina Pectoris.
Example 2 (OR): This query finds patients with Acute Myocardial Infarction OR Angina Pectoris.
Example 3 (AND of ORs): This query finds patients with (Acute Myocardial Infarction OR Angina Pectoris) AND who are male.
*Note that the OR expression in the parentheses is evaluated first.
3.2.2 Constraints
Constraints are used to narrow down the search criteria to a particular time frame, number of occurrences or a specific value or range of values. In i2b2, there are several types of constraints that can be defined in the Query Tool view.
- Group Constraints
- Date Constraint
- Setting Date Constraint for the entire Group
Clicking on 'Dates' will display a dialog box in which a date range can be selected to restrict the occurrences of the items in the Group to within that range. Check one or both of the check boxes to indicate whether there is a begin date (From) or an end date (To) or both.
Then type the date directly in the text box or click on the drop-down arrow to open the calendar below to select a date. This will set the date range for all items in this Group. - Setting Date Constraint on individual items.
Sometimes only some items in the Group need date constraints or different items in one group require different date constraints. In this case, right click on an item and select Set Date Constraint to set the date constraint for that item specifically. - Once a date constraint is applied, Dates will now be underlined to indicate a date constraint has been set.
- Setting Date Constraint for the entire Group
- Occurrence Constraint
Users can define the number of times an item must occur for each subject.
Click on 'Occurs>0x'
A new window will open
Click on the drop-down arrow to display a list of numbers.
Select a number from the list.Click on the OK button.
Occurs > 0x will now be underlined to indicate a constraint has been set and the 0 will be replaced with the selected number.
- Exclusion
- Value Constraints (eg. labs)
- Numeric
- Categorical
- Text
- Flags (high, low, etc.)
- Date Constraint
- Modifier Value Constraints
3.2.3 Query Timing (in progress)
- Independent
- Same Financial Encounter
- Same Observation
- Temporal Query
3.2.4 Reloading a Previous Query (in progress)
3.2.5 Resetting the Query Tool (in progress)
3.3 Running a Query (in progress)
3.3.1 Run Query
3.3.2 Query Result Options
1) Patient Set
2) Encounter Set
3) Number of Patients
4) Gender Patient Breakdown
5) Vital Status Patient Breakdown
6) Race Patient Breakdown
7) Age Patient Breakdown
8) Timeline
9) Length of Stay Breakdown
10) Top 20 Medications Breakdown
12) Top 20 diagnoses Breakdown
13) Inpatient and Outpatient Breakdown
3.3.3. Query Status
- Running
- Finished
- Queued
- Error