Data Criteria Processing Order Data criteria processing rules: A data criteria specifies a set of filters on the events it identifies. The filters are processed in the following order: (i) Initial set of events - code value set and category of events or UNION subset operator (ii) Attributes, e.g. status, value (ii) Temporal relationships (iii) Subsets - always processd last* since some operators (COUNT, MIN, MAX etc) reduce the event list to a simple boolean value preventing further processing. Within each of the above classifications, filters are applied in document order. E.g. if there are two excerpt elements, they are processed in the order they appear within the criteria. Example 1: most recent HbA1C result of 9% or greater during the measurement period: <entry> <localVariableName>HbA1C</localVariableName> <observationCriteria> <id root="0" extension="HbA1C"/> <code valueSet="2.16.840.1.113883.3.464.1.72"/> <statusCode code="completed"/> <value xsi:type="IVL_PQ"> <low value="9" unit="%"/> </value> <definition> <observationReference moodCode="DEF"> <id root="0" extension="Results"/> </observationReference> </definition> <excerpt> <subsetCode code="RECENT"/> <observationCriteria/> </excerpt> <temporallyRelatedInformation typeCode="DURING"> <observationReference moodCode="EVN"> <id root="0" extension="MeasurePeriod"/> </observationReference> </temporallyRelatedInformation> </observationCriteria> </entry> Processing steps: (Initial set of events) (i) Find all result events whose code matches one in the 2.16.840.1.113883.3.464.1.72 value set (Attributes) (ii) Remove any events for which the value is < 9% (iii) Remove any for which the status is not "completed" (Temporal relationships) (iv) Remove any events that are outside the measurement period (Subsets) (v) Remove all but the most recent event Example 2: was the most recent HbA1C result during the measurement period 9% or greater ? <entry> <localVariableName>MostRecentHbA1C</localVariableName> <observationCriteria> <id root="0" extension="MostRecentHbA1C"/> <code valueSet="2.16.840.1.113883.3.464.1.72"/> <statusCode code="completed"/> <definition> <observationReference moodCode="DEF"> <id root="0" extension="Results"/> </observationReference> </definition> <excerpt> <subsetCode code="RECENT"/> <observationCriteria/> </excerpt> <temporallyRelatedInformation typeCode="DURING"> <observationReference moodCode="EVN"> <id root="0" extension="MeasurePeriod"/> </observationReference> </temporallyRelatedInformation> </observationCriteria> </entry> <entry> <localVariableName>MostRecentHbA1CIfGreaterThan9PC</localVariableName> <observationCriteria> <id root="0" extension="MostRecentHbA1CIfGreaterThan9PC"/> <value xsi:type="IVL_PQ"> <low value="9" unit="%"/> </value> <definition> <observationReference moodCode="DEF"> <id root="0" extension="Derived"/> </observationReference> </definition> <excerpt> <subsetCode code="UNION"/> <observationReference moodCode="EVN"> <id root="0" extension="MostRecentHbA1C"/> </observationReference> </excerpt> </observationCriteria> </entry> Processing steps: (MostRecentHbA1C) (i) Find all result events whose code matches one in the 2.16.840.1.113883.3.464.1.72 value set (ii) Remove any for which the status is not "completed" (iii) Remove any events that are outside the measurement period (iv) Remove all but the most recent event (MostRecentHbA1CIfGreaterThan9PC) (i) Take the events generated by MostRecentHbA1C (UNION subset operator) (ii) Remove any events for which the value is < 9% *Note UNION subsets break the rules that subsets are processed last since they need to be processed first. The UNION subset operator acts much like the code attribute in that it specifies the initial set of events that the rest of the criteria operates on. Perhaps we need some different markup to emphasize the difference ? -Marc Hadley <mhadley@mitre.org>