<p class="jdwebheading4"><a name="_Toc370995248">Add Previous Query From workplace View (New Query)</a></p>
<p class="jdweblistnumbers">1.<span class='c2'> </span> In the <b>Workplace view</b>, expand
the folder(s) that contains the previous query you want to add.</p>
<p class="jdweblistnumbers">2.<span class='c2'> </span> Highlight the <b>previous query</b>
<span class='c8'>(<img width="10" height="10" src="images/tqt_image060.jpg" />)</span> by clicking on its name</p>
<p class="jdweblistnumbers">3.<span class='c2'> </span> While holding the <i>left mouse
button</i> down, drag the item over to the <b>Query Tool View</b>.</p>
<p class="jdweblistnumbers">4.<span class='c2'> </span> Drop the previous query into the
<b>Query Drop Area</b> in either Step 1 or Step 2.</p>
<p class="jdweblistnumbers">5.<span class='c2'> </span> The terms, <b>Groups</b>,
<b>Events</b>, and <b>Temporal Relationships</b> defined in that previous query will
be reconstituted in the current interface. If the previous query is a non-temporal
query, then only the Population portion of the UI will be reconstituted. If the
previous query is a temporal query, then both the Population portion and the temporal
relationship portion of the UI will be reconstituted.</p>
<p class="jdwebheading4"><a name="_Toc370995249">Add Previous Query From Previous Query View (Query-In-Query)</a></p>
<p class="jdweblistnumbers">1.<span class='c2'> </span> In the <b>Workplace view</b>, expand
the folder(s) that contains the previous query you want to add.</p>
<p class="jdweblistnumbers">2.<span class='c2'> </span> Highlight the <b>previous query</b>
<span class='c8'>(<img width="10" height="10" src="images/tqt_image060.jpg" />)</span> by clicking on its name</p>
<p class="jdweblistnumbers">3.<span class='c2'> </span> While holding the <i>left mouse
button</i> down, drag the item over to the <b>Query Tool View</b>.</p>
<p class="jdweblistnumbers">4.<span class='c2'> </span> Drop the previous query into the
<b>panel</b> labeled <b>Group 1</b>.</p>
<p class="jdweblistnumbers">5.<span class='c2'> </span> The previous query will now display in the panel for Group 1.</p>
<p class="jdwebheading4"><a name="_Toc370995252">Add Patient List From Previous Query View</a></p>
<p class="jdweblistnumbers">6.<span class='c2'> </span> In the <b>Previous Query view</b>
click on the plus sign <span class='c8'>(<img width="11" height="11" src="images/tqt_image063.gif" />)</span> next to the name of the previous query that
contains the patient set.</p>
<p class="jdweblistnumbers">7.<span class='c2'> </span> Click on the plus sign <span class=
'c8'>(<img width="11" height="11" src="images/tqt_image063.gif" />)</span> next to the results folder.</p>
<p class="jdweblistnumbers">8.<span class='c2'> </span> Highlight the <b>patient list</b>
<span class='c8'>(<img width="10" height="10" src="images/tqt_image044.jpg" />)</span> by clicking on its name</p>
<li>Click the <b>check box</b> next to the date in the <b>From box</b>.</li>
<li>At this point there are two methods of entering your <i>starting</i> date.</li>
<ol type="a">
<li>Manually type it in the text box.</li>
<li>Click on the <b>drop-down arrow</b> <span style="color:#CCCCCC">(<img src="images/dropDownArrow.png" alt="dropDownArrow" />)</span> to open the calendar view and click on the desired date.
<p class="jdwebnormal"><b>Flags</b> are defined in the source system when the value is entered. The following are some examples that can be found in the i2b2 Demo database.
</p>
<ul>
<li>High</li>
<li>Low</li>
<li>Abnormal</li>
</ul>
<p class="jdwebheading5"><a name="qtFlagValueConstraintSetConcept" id="qtFlagValueConstraintSetConcept"></a>Setting the Value Constraint (Flag) for a Concept</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The value constraint window will open automatically when you drop a concept into a panel in the Query Tool view. This will only happen if the concept is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<p class="jdwebheading5"><a name="qtFlagValueConstraintSetModifier" id="qtFlagValueConstraintSetModifier"></a>Setting the Value Constraint (Flag) for a Modifier</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The modifier value constraint window will open automatically when you drop a modifier into a panel in the Query Tool view. This will only happen if the modifier is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<p class="jdwebnormal">The<b> text value</b> is defined in the source system when the value is entered. The following are some examples that can be found in the i2b2 Demo database.
</p>
<ul>
<li>Test Not Performed</li>
<li>Borderline</li>
<li>Positive</li>
</ul>
<p class="jdwebheading5"><a name="qtTextValueConstraintSetConcept" id="qtTextValueConstraintSetConcept"></a>Setting the Value Constraint (Text) for a Concept</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The value constraint window will open automatically when you drop a concept into a panel in the Query Tool view. This will only happen if the concept is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
To select more than one you can hold down the <Ctrl> key while clicking on each name. On the Macintosh you can hold down the command key instead of the <Ctrl> key.
<p class="jdwebheading5"><a name="qtTextValueConstraintSetModifier" id="qtTextValueConstraintSetModifier"></a>Setting the Value Constraint (Text) for a Modifier</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The modifier value constraint window will open automatically when you drop a modifier into a panel in the Query Tool view. This will only happen if the modifier is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<li>A pop-up menu will open.</li>
<li>Select <b>Set Modifier Value</b> from the list.</li>
To select more than one you can hold down the <Ctrl> key while clicking on each name. On the Macintosh you can hold down the command key instead of the <Ctrl> key.
<p class="jdwebnormal">The <b>numeric value</b> is defined in the source system when the result is entered. The following are some example formats that can be found in the i2b2 Demo database.
</p>
<ul>
<li>200</li>
<li>1.3</li>
</ul>
<p class="jdwebnormal">Unlike flag and text values, numeric values use operators, such as greater than or less than when setting the constraints. The following is a listing of operators currently in use.
<td>Any value less than or equal to the number entered (inclusive).</td>
</tr>
<tr>
<td>Equal To (=)</td>
<td>An exact match to the number entered.</td>
</tr>
<tr>
<td>Between</td>
<td>Any value in the range of numbers entered.</td>
</tr>
<tr>
<td>Greater Than (>)</td>
<td>Any value greater than the number entered.</td>
</tr>
<tr>
<td>Greater Than or Equal To (>=)</td>
<td>Any value greater than or equal to the number entered (inclusive).</td>
</tr>
</table>
<p class="jdwebheading5"><a name="qtNumValueConstraintSetConcept" id="qtNumValueConstraintSetConcept"></a>Setting the Value Constraint (Numeric) for a Concept</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The value constraint window will open automatically when you drop a concept into a panel in the Query Tool view. This will only happen if the concept is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<p class="jdwebnormal"></p>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<p class="jdwebheading5"><a name="qtNumValueConstraintSetModifier" id="qtNumValueConstraintSetModifier"></a>Setting the Value Constraint (Numeric) for a Modifier</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The modifier value constraint window will open automatically when you drop a modifier into a panel in the Query Tool view. This will only happen if the modifier is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<p class="jdwebnormal"></p>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<li>A pop-up menu will open.</li>
<li>Select <b>Set Modifier Value</b> from the list.</li>
<p class="jdwebheading4"><a name="qtNumValueConstraintUnits" id="qtNumValueConstraintUnits"></a>Using Units In Value Constraints</p>
<p class="jdwebnormal">Units in regards to i2b2 are the standard units of measurement associated with a value. For instance, a medication may have "mg" listed as the unit for the dose, while a HGB lab test may have "gm/dL".
</p>
<p class="jdwebnormal">The units are defined in the source system and although it is recommended that all numerical facts are stored in normalized units it is recognized that this is not always feasible. Therefore, the Web Client has the ability to convert the units when running a query.
</p>
<p class="jdwebnormal">In order for this feature 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.
</p>
<p class="jdwebheading5"><a name="qtNumValueConstraintUnitsSet" id="qtNumValueConstraintUnitsSet"></a>Defining the Units When Running a Query</p>
<table id=note>
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The modifier value constraint window will open automatically when you drop a modifier into a panel in the Query Tool view. This will only happen if the modifier is set up in the database with XML metadata. The first three steps can be used if you did not add a value constraint when you added the item or if you wish to edit an existing item.
</p>
</td>
</tr>
</table>
<ol>
<li>Using the <i>right mouse button</i>, click on the item listed in the panel.</li>
<li>A pop-up menu will open.</li>
<li>Select <b>Set Modifier Value</b> from the list.</li>
<p class="jdwebnormal">In the above scenario, the normal units are "mg". When setting up the value constraint the units were changed to "gm" and the numerical value was set to 5. Upon saving the value constraint, the Web Client converted 5 gm to 5000 mg. When the query is run it will look at those facts that have both 5 gm and 5000 mg defined in the observation_fact table.
<table id="note">
<tr>
<td>
<p class=NoteHeading>NOTE: </p>
<p class=NoteParagraph>
The unit conversion information is specific to the term and is defined in the i2b2 metadata table.
</p>
</td>
</tr>
</table>
<h2><a name="tqtRunningQuery" id="tqtRunningQuery"></a>Running a Query</h2>
<p class="jdwebnormal">This section describes the process of running a query and getting results.</p>
<h2><a name="tqtPrintQuery" id="tqtPrintQuery"></a>Printing a Query</h2>
<p class="jdwebnormal">Users are able to print out the query information if they wish to have a hard copy of the search criteria defined for a query.</p>
<p class="jdwebnormal">When printing a query you can either print the information for a current query or
you can drag a previous query to the query tool view and print the information
associated with that query.</p>
<p class="jdwebnormal">The following steps outline the process of printing a query once you have the
appropriate query in the Query Tool.</p>
<ol>
<li>Click on the <b>Print Query button</b> located on the toolbar at the bottom of the <i>Query Tool view</i>