The Demo site for our new HL7 Version 2+ (plus) Standard
visit the hl7 website

Draft Website - For Review Purposes Only

QSC - query selection criteria

HL7 Component Table - QSC - query selection criteria
Seq# Description Implement Flags Cardinality Length C.LEN Vocabulary Data Type
QSC
1 Segment Field Name [0..1]     ST
2 Relational Operator SHALL [0..1] [2..2]     0209 ID
3 Value # [0..1] 199 ST
4 Relational Conjunction SHALL [0..1] [3..3]     0210 ID

Components: <Segment Field Name (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.

Note: This field conveys the same information as the "WHERE" clause in the corresponding SQL expression of the query, but is formatted differently.


Example:

|@PID.5.1^EQ^EVANS|

QSC-1: Segment Field Name (ST)

Definition: The name of the field that is participating as a qualifier (usually the "key"). Refer to Section 2.A.59.1, “Segment Field Name (ST),” for segment field name conventions.

QSC-2: Relational Operator (ID)

Definition: Refer to HL7 Table 0209 - Relational Operator for valid values.

QSC-3: Value (ST)

Definition: The value to which the field will be compared.

QSC-4: Relational Conjunction (ID)

Definition: Refer to HL7 Table 0210 - Relational Conjunction for valid values. The relational conjunction is 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.

  • 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 Chapter 5, "Query").