The i2b2 Query Tool

The HOME Cell extends the functionality of the i2b2 system by allowing researchers to link concepts about patients temporally (through time) and quantifiably (through number of occurrences or values).  However, before researchers can make use of the HOME Cell, they must first be familiar with the i2b2 Query Tool.

Generating a population in the QUERY tab for use in the HOME Cell

i2b2 queries are population based, which means that the number returned from the initial query is the number of patients that fulfill the criteria you assigned in the various groups.  Each patient may (and probably will) have multiple records throughout time in the database, but the initial query will tell you how many people you have in your population.

Example:  Create  Query Tool Query for patients with a Primary Care visit between 2005 and 2011, and any diagnosis (Ever) of Essential Hypertension, and at least 1 Blood Pressure between 2005 and 2011

Step 1: Add your concepts

The concepts (Essential Hypertension, General Medicine, Family Medicine, Geriatrics, Blood Pressure) were dragged into their groups from the Navigate Terms tab on the left.

querytool.querydemo

Step 2: Apply Constraints

Constraints can be applied on the Date, the Number of Occurrences, and to Exclude a Group.

To constraint to only patients with General Medicine, Family Medicine, Geriatrics and Blood Pressure from 2005 to 2011, the Date Constraint was applied to Group 1 and Group 3 as below:

querytool.dateconstraints

Step 3: Select  your Analysis Type

The most commonly used Analysis Types are:

  • Number of Patients
  • Gender Patient Breakdown
  • Race Patient Breakdown
  • Age Patient Breakdown

It is not recommended to select any other Analysis Type in the MHDR unless you have a specific reason to do so.   Specifically avoid the Patient List and Encounter List options – these create Lists of patients or patient encounters and stores them in the database.  Since queries can have many thousands of patients, the use of these options creates lists of data that are not generally useful and will take up unnecessary space on the server.

Step 4:  Run your query

That is it – you have now created a patient population query to use as the basis for a HOME Cell query.

Generating a Query for a Cohort Definition – Considerations

When generating a query in the Query tab the researcher should consider:

1)  Is this Query being used to identify a cohort one time only today? (Cohort identification)

2) Is this Query going to be used in conjunction with the HOME cell to identify a cohort and track them through time? (Cohort monitoring)

These considerations may determine what constraints you want to put on your initial Query, especially in terms of date ranges.

In the example above you restricted your query to only patients with certain concepts between 2005 and 2011.

But  consider if you were generating a query to be used in conjunction with the HOME cell for monitoring people going forward into 2012, 2013, etc.

If that were the case, then you would not want to put an Upper limit on the date constraint for the initial Query. Otherwise you would only get patients who had the desired concepts in 2005 to 2011 and not pick up new patients who may have been in 2012 or 2013.