Skip to content

Cooking with CQL Q&A Index Using Quality Data Model Category

christinanguyen-esac edited this page Aug 17, 2020 · 18 revisions

Each Q&A has the Cooking with CQL session number and date. For the most current and accurate information, please check the CQL Qs&As for a more recent answer to your question.

Attributes for Organizations: When using the Quality Data Model (QDM) v.5.5 attributes for organizations, does this example make sense?

/*
This example shows how to check that the organization associated with a blood pressure is the same as the encounter:
*/

define "Qualifying Blood Pressures":
	  ["Physical Exam, Performed": "Blood Pressure"] BP
	    with ["Encounter, Performed": "Office Visit"] Encounter
	      such that BP.relevantPeriod during Encounter.relevantPeriod
	        and EINOf(Encounter.participant.identifier) = EINOf(BP.performer.identifier)
	

	define "EIN Identifier System": 'urn:oid:2.16.840.1.113883.4.4'
	

	define function EINOf(identifier Identifier):
	  identifier I where I.namingSystem = "EIN Identifier System" return I

(Session 46 - 7/30/2020)

  • Yes. For simplicity, we explicitly decided QDM would only represent one participant, performer, or organization within any given data element. This representation provides a little bit of flexibility in terms of how a submitting system populates that data element. There needs to be guidance associated with the use of the entity type to indicate that participants are expected to be the organization and the organization would have to use their own naming system identifier to run the string of code.
EHR and QDM Attributes: QDMs are not really used for interoperability like FHIR is, it defines the type of metadata that we call attributes. Is it true that EHRs have been implemented to be able to export the full QDM set of attributes every time you ask for something? That’s the ideal. (Session 35 - 5/23/19)
  • In typical implementation, that’s the structure seen. A typical scenario is a database with columns that match to attributes in QDM so the overall structure will look like that but not all of the columns will necessarily be filled. From an architectural perspective, this would be a straightforward and reasonable way to do the implementation.
Expand Operator: In the Quality Data Model (QDM) 5.5, what does the expand operator do? Can it be used to make a list of each day in the measurement period? (Session 43 - 4/23/20)
  • Yes. QDM 5.5 does not have an expand operator, QDM is the data model. The CQL expand operator is an operator that takes a list of intervals and returns the unit intervals in that input. As shown in Example 1, if you expand the interval from 1 to 10, the result would be a list of the intervals from 1 to 1, 2 to 2, and so on.

Example 1

expand { Interval[1, 10]} // { Interval[1, 1], Interval[2, 2] ...}

There is also a per clause, shown in Example 2. If you expand the measurement period, you can get intervals of milliseconds by saying per day then you get intervals of days. If you said per month, you would get 12 months and then you could count the encounters in that month.

Example 2


define "Measurement Period Days":
	  expand { "Measurement Period" } per day

Measurement Period is a calendar calculation. If you are using Measurement Period Days and the measurement period includes a leap year, that will be accounted for in the calculation. Similarly, if you said month, you will get the calendar month intervals. You could also ask for the months, the counts in the days, and the highest count of days in that month.

Glucocorticoid Dosage Expression: For the glucocorticoid dosage expression, is using Date appropriate in place of DateTime? (Session 31 - 1/31/19)

https://github.com/esacinc/CQL-Formatting-and-Usage-Wiki/blob/master/Source/Cooking%20With%20CQL/31/87_GlucocorticoidDosage.cql#L128


define function "Glucocorticoids Dosage Per Day"(glucocorticoids List<Tuple {
  code Code,
  daysInPeriod List<DateTime>,
  dailyDosage Quantity
}>):

  • Yes, since version 1.3 of CQL, the Date type can be used for the daysInPeriod argument (i.e. List instead of List).
“is” vs ”as” operator in Bonnie uses in QDM v5.3: In QDM 5.5, we have reduced ability to talk about entity types and these are attributes that are patients, persons, or practitioners. In the examples we’ve used to illustrate these is using the ‘is’ operator in CQL by saying participant is an organization. However, there is an issue with Bonnie that it doesn’t support the ‘is’ operator, but it does support the ‘as’ operator. How do we work around this issue? (Session 40 - 12/5/19)
  • In the example below, it is using the ‘as’ operator to get to the same place by turning that into Org and saying it’s not null. Here we’re saying participant ‘as’ an organization. If the participant is not an organization, then the result of that is null so by saying that if Org1 is not null and Org2 is not null, then you can do the comparison between them.

define "My Qualifying Encounters":
	   ( distinct ( flatten ( from
	           "Dementia Encounter" Enc1,
	           "Dementia Encounter" Enc2
	           let Org1: ( Enc1.participant as "Organization" ),
	           Org2: ( Enc2.participant as "Organization" )
	           where Org1 is not null
	             and Org2 is not null
	             and start of Enc2.relevantPeriod 1 day or more after start
	of Enc1.relevantPeriod
	             and Org1.identifier ~ Org2.identifier
	           return all { Enc1, Enc2 }
	       )
	     )
	   )

Medical Coverage in QDM: Is the type of coverage, e.g., commercial, Medicare, Medicaid considered in the QDM participation logic? (Session 32 - 2/28/19)
  • The participation logic determines coverage in a QDM measure using the QDM participation type. The logic starts with whether the patient is enrolled and it is particular to each product line, commercial, Medicare or Medicaid. However, in calculating the participation period and the enrollment periods, coverage type is usually ignored.
Related Person QDM datatype: Does the new Related Person QDM datatype allow an eCQM specification to reference information about a related person that is already present in the patient’s record? As an example, instead of a direct context query, maternal information may be shared in a C-CDA and incorporated into an infant’s record. (Session 33 - 3/28/19)
  • Yes, the new QDM datatype Related Person will allow reference to information that is already present in the patient’s record yet represents information about the related person.

Wiki Index

Home

Authoring Patterns - QICore v4.1.1

Authoring Patterns - QICore v5.0.0

Authoring Patterns - QICore v6.0.0

Authoring Measures in CQL

Composite Measure Development

Cooking with CQL Examples

Cooking with CQL Q&A All Categories
Additional Q&A Examples

CQL 1.3 Impact Guidance

CQL Error Messages

Developers Introduction to CQL

Discussion Items

Example Measures

Formatting and Usage Topics

Formatting Conventions

Library Versioning

Negation in QDM

QDM Known Issues

Specific Occurrences

Specifying Population Criteria

Supplemental Data Elements

Terminology in CQL

Translator Options For Measure Development

Unions in CQL

Clone this wiki locally