The Query Tool panel is where queries are constructed and run.
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. |
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.
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.
Users can define the number of times an item must occur for each subject.
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.
Click on the Exclude button located in the selection criteria section of the panel.
The text in the information box will change to "none of these" and the background color will change to pink.
The numeric value is defined in the source system when the result is entered. Enter a numerical value at the Please enter a value field.
Unlike flag and text values, numeric values use operators, such as greater than or less than when setting the constraints.
The Units will default to the normal units defined for the item. Click on the drop-down arrow to change the units.
(In order for unit conversion to work a parameter called CRC_ENABLE_UNITCD_CONVERSION must be defined for the project. If this is not defined you need to contact your system administrator.)
The items (facts) can occur at any time in the patient's history.
Patient has a medication with a dose greater than 500 mg and a medication that is taken once a day documented at any time in their history. RESULTS: there are 47 patients who have had a medication with a dose of 500 mg and a frequency of once a day entered as a fact in the observation_fact table, where medication dose and frequency have the same patient_num. |
The items (facts) occur during the same visit (financial encounter).
Temporal constraint has to be set to Same financial encounter in order to be available for selection
Patient has a diagnosis of Acute MI documented at any time in their history and they have a medication with a dose greater than 500 mg and a medication that is taken once a day documented during the same visit. RESULTS: there are 4 patients who have had a medication with a dose greater than 500 mg and a frequency of once a day entered as a fact in the observation_fact table, where the medication dose and frequency have the same encounter_num AND the diagnosis of acute MI, the medication dose and frequency all have the same patient_num |
The items (facts) occur during the same visit (financial encounter) AND the same instance.
Temporal constraint has to be set to Items instance will be the same in order to be available for selection.
Patient has a diagnosis of Acute MI documented at any time in their history and they have a medication with a dose greater than 500 mg and a medication that is taken once a day documented during the same instance. RESULTS: there are 3 patients who have had a medication with a dose of 500 mg and a frequency of once a day entered as a fact in the observation_fact table, where the medication dose and frequency have the same encounter_num , concept_cd, provider_id, start_date, AND instance_num AND the diagnosis of acute MI, the medication dose and frequency all have the same patient_num |
Once the query criterion has been defined, the final steps are to click on the Run Query button, select the result type(s), and click on the OK button to run the query.
Once you have defined the search criteria click on the Run Query button located on the toolbar at the bottom of the Query Tool view. A new window will open.
Once you begin the process of running the query the Query Status view will display "Running Query", the name of the query, and the time that has elapsed.
There are three categories of query type: counts, sets, and breakdowns. (Note that the Timeline type is not used in the Web Client. If selected it will work the same as patient set.)
This option will return a total count for those patients who meet the defined criteria. This is the most common and fastest query type.
These options return a set of patients or encounters that meet the defined criteria. The set is visible in the Previous Query view and can be used in future queries, the workspace, and by plugins.
Only information on the query's completion is shown in the Query Status panel.
The following query types will return patient counts stratified by the selected breakdown category (e.g., Gender or Age).
breakdown
Breakdown type |
---|
Gender patient breakdown |
Vital Status patient breakdown |
Race patient breakdown |
Age patient breakdown |
Length of Stay breakdown |
Top 20 Medications Breakdown |
Top 20 diagnoses Breakdown |
Inpatient and Outpatient Breakdown |