Previous Page TOC Index Next Page

2.8.31 QSC - query selection criteria

Components: <name of field (ST)> ^ <relational operator (ID)> ^ <value (ST)> ^ <relational conjunction (ID)>

Definition: This field indicates the conditions that qualify the rows to be returned in the query response. (This field conveys the same information as the "WHERE" clause in the corresponding SQL expression of the query, but is formatted differently.)

2.8.31.1 Name of field (ST)

The name of the field that is participating as a qualifier (usually the "key"). Refer to Section 2.8.30, "QIP - query input parameter list", for field naming conventions.

2.8.31.2 Relational operator (ID)

Refer to HL7 table 0209 - Relational operator for valid values.

Table 0209 - Relational operator

Relational operator

Value

EQ

Equal

NE

Not Equal

LT

Less than

GT

Greater than

LE

Less than or equal

GE

Greater than or equal

CT

Contains

GN

Generic

2.8.31.3 Value (ST)

The value to which the field will be compared.

2.8.31.4 Relational conjunction (ID)

Refer to HL7 table 0102 - Relation conjunction for valid values. The relational conjunction, defined as follows: If more than one comparison is to be made to select qualifying rows, a conjunction relates this repetition of the field to the next.

Table 0210 - Relational conjunction

Relational conjunction

Note

AND

Default

OR


• When applied to strings, the relational operators LT, GT, LE, and GE imply an alphabetic comparison.

• A "generic" comparison selects a record for inclusion in the response when the beginning of the designated field matches the select string.

• Where a repeating field is specified as an operand, a match on any instance of that field qualifies the row for inclusion in the response message.

• AND takes precedence over OR. More sophisticated precedence rules require that the query be expressed as an embedded query language message or a stored procedure query message (see Section 2.19, "ENHANCED MODE QUERY MESSAGES," and also Sections 2.24.16, "EQL - embedded query language segment," and 2.24.20, "SPR - stored procedure request definition segment."

Previous Page TOC Index Next Page