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


'Query Tool' is the main panel in which users construct, refine, and submit i2b2 queries.


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 enables users to run, clear their queries, and also enable them to navigate the Groups if there are more than three.


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.

  1. Terms are located in the 'Navigate/Find Term' panel.
    1. leafImage AddedConcepts are diagnoses, medications, procedures, or demographic information a patient has.
    2. folderImage AddedConcept Groups contain many Concepts as their 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.
    3. leafImage AddedModifiers are additional descriptors that can be attached to concepts. For example, a Diagnosis concept may be additionally described by Modifiers "primary diagnosis" or "secondary diagnosis."
    4. folderImage AddedModifier Groups are groups of Modifiers, similar to Concept Groups.
  2. prevQueryImage Added / Image AddedPrevious Queries are found in the 'Previous Queries' panel. When they are used in a query, they are executed first.
  3. Image AddedIndividual Patients are results of a previous query. They can be found by expanding a Patient Set in the Previous Queries panel.
  4. Image AddedPatient Sets are 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.
  5. Image AddedEncounter Sets are also results of a previous query.

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 then are ANDed together. This means each i2b2 query is a an AND of ORs.


Example 1 (AND): This query finds patients with Acute Myocardial Infarction AND Angina Pectoris.

Image Added


Example 2 (OR): This query finds patients with Acute Myocardial Infarction OR Angina Pectoris.

Image Added


Example 3 (AND or ORs): This query finds patients with (Acute Myocardial Infarction OR Angina Pectoris) AND who are male.

Image Added




Initially the Query Tool shows three Groups to the users, but only one (the first one) is active. Users are to add criteria via drag-and-drop to the Groups to construct their queries. A number of potential i2b2 objects can be added to the Groups. They include ontology terms, previous queries, results of previous queries, and items from the Workplace.

    i. Adding i2b2 Objects into Groups

       1) Ontology Terms

The Navigate/Find Terms panel contains all available ontologies. Users can browse or use its search functionalities to find a certain terms. After identifying the terms users wish to query for, they can drag and drop them into the Groups.

       2) Previous Query

The Previous Queries panel lists all previously submitted queries. Users may drag and drop a previous query into a Group. When a new query contains a previous query is executed, i2b2 will run the previous query first. The previous query's results are then used in conjunction with the other terms in the new query to obtain the final results. In this sense, a previous query in a query can be thought of as a sub-query.

       3) Query Result (Patient Set/ Patient)

For each previous query in the Previous Queries panel, its results such as individual patients or patient sets can also be dropped into the Groups.

       4) Including a Folder in Workplace

Workplace is a place where users can put any i2b2 objects such as ontology terms, previous queries, patient sets, etc. they wish to save for later. Users can then drag these saved objects into the query Groups. In addition,

    ii. AND/OR Operators

       Order of Precedents

    iii. How to use a lab test (terms with values)

    iv. Run Query and Clear buttons

3.4 Resetting the Query Tool (Clear)

3.5 What Happens when a query gets queued?

3.6  Rerun a Previous Query

3.7 Advanced Query Options

    i.Output 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

    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 )

3.8 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)