i2b2 Web Client
Space shortcuts
Space Tools

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Example Box
show-iconfalse


Expand
titleTable of Contents

Table of Contents
maxLevel4
stylenone


The 'Query Tool' is panel is where queries are constructed. 


3.1 Layout

  1. 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.
  2. Query Name Display shows the name of the current query. Users can also drop a previous query here to load it.
  3. Query Timing Selector enables users to select the appropriate timings for their query, including temporal queries.
  4. 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.
  5. 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 These items may be dragged into Query Groups to construct queries.

IconsNamesDescription

leaf

ConceptsDiagnoses, medications, procedures, or demographic information a patient hasTermsTerms (also called concepts) are the words or phrases that make up the vocabularies and are the basic query items.

folder

Concept Term GroupsConcepts 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 ConceptsRelated terms are grouped into hierarchies. When a term group is used in a query, all terms in the group are searched for.

leaf

ModifiersAdditional Modifiers are descriptors that can be attached to conceptsterms to make small changes to them. For example, a Diagnosis concept may be additionally described by Modifiers "Principal Diagnosis" or "Secondary diagnosis."

folder

Modifier GroupsGroups of Modifiers, similar to Concept Term Groups.

prevQuery/

Previous QueriesListed Previous Queries are queries that have been run before and are stored 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 PatientsResults of If selected, a previous query . They can be found by expanding can return a Patient Set. 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 SetsResults of If selected, a previous query . Like Individual Patients, these can be used to restrict the scope of a query to just the patients in the setcan return a Patient Set. 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 SetsResults of If selected, a previous query [need to be more specific]query can return an Encounter Set. 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

The i2b2  i2b2 items are combined using boolean 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.

3.2.2 Constraints

Constraints can be further applied to the items in a Group. Here are the different types of constraints

  1. Group Constraints
    1. Date Constraint
      1. Setting Date Constraint for the entire Group

        qtConstDateSelect

        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.

        qtConstDateWindow

        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. 

        qtConstDateCal1

      2. 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.



    2. Occurrence Constraint
    3. Exclusion
    4. Value Constraints (eg. labs)
    5. Numeric
    6. Categorical
    7. Text
    8. Flags (high, low, etc.)
  1. Modifier Value Constraints

3.2.3 Query Timing

  1. Independent
  2. Same Financial Encounter
  3. Same Observation
  4. 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
        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

  1. Running
  2. Finished
  3. Queued
  4. Error

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 (to be deleted):

    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)
        3) Occurrences

    iv. Value Constraints

(e.g. "Find patients who have a systolic blood pressure reading greater than 130 mm Hg")


    v. Modifiers

        1) What are they?
        2) Has Value Constraints like Labs
        3) How are they represented in Navigate/Find Terms
            - Modifier
            - Modifier Container

    vi. Query Timing

        1) Treat all groups independently (default)
        2) Select Groups occur in the same financial encounter
        3) Define sequence of events (Temporal Query)
            - Simple
            - Advanced
            - Some Concepts do not make sense here (Put them in the Population )