'Query Tool' is the main panel in which users construct, refine, and submit i2b2 queries.
- Panel Options allows 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 areas where users can drag and drop i2b2 items to build their queries. There are initially three Groups, but more can be added.
- Tool Bar contains buttons to run and clear their queries. Its buttons also enable users to navigate the Groups.
3.2 Creating a Query
3.2.1 i2b2 Items for Querying
Users can drag the following i2b2 items into the Query Groups to construct queries.
|Concepts||Diagnoses, medications, procedures, or demographic information a patient has.|
|Concept Groups||Concepts that have many Concept children. Using a Concept Group in a query tells i2b2 to search for any data that belong to the Concept Group or any of its children Concepts.|
|Modifiers||Additional descriptors that can be attached to concepts. For example, a Diagnosis concept may be additionally described by Modifiers "Principal Diagnosis" or "Secondary diagnosis."|
|Modifier Groups||Groups of Modifiers, similar to Concept Groups.|
|Previous Queries||Listed in the 'Previous Queries' panel. When they are used in a new query, they are executed first. Its results are used to obtain the results of the new query.|
|Individual Patients||Results of a previous query. They can be found by expanding a Patient Set in the Previous Queries panel.|
|Patient Sets||Results of a previous query. Like Individual Patients, these can be used to restrict the scope of a query to just the patients in the set.|
|Encounter Sets||Results of a previous query [need more description]|
3.2.1 Operators and Order of Precedence
The i2b2 items are combined using boolean operators AND and OR.
Items within each Group are first ORed together. The Groups are then ANDed together. This means that every i2b2 query is an AND of ORs.
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.
- Group Constraints
- Date Constraint
- Occurrence Constraint
- Value Constraints (eg. labs)
- Flags (high, low, etc.)
- Modifier Value Constraints
3.2.3 Query Timing
- Same Financial Encounter
- Same Observation
- Temporal Query
3.2.4 Reloading a Previous Query
3.2.5 Resetting the Query Tool
3.3 Running a Query
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
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
3.4 Example Queries
i. Simple Query: "Finding patients with a diagnosis A or a diagnosis B or has lab test C."
ii. Running a Previous Query
iii. Temporal Query (Simple)
iv. How to find Patients with >1 diagnosis X OR >1 diagnosis Y (Using nested queries)
Old Notes below:
ii. Managing Groups
1) Additional Groups
2) Shifting Group Order
3) Delete Groups
iii. Specifying Constraints
1) Date Constraints (Panel-level and Term-level)
2) Negation (Exclude)
iv. Value Constraints
(e.g. "Find patients who have a systolic blood pressure reading greater than 130 mm Hg")