Skip to content

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

rhondaschwartz edited this page Jun 15, 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.

Diagnoses vs Diagnosis: With the new changes to the QDM, is the attribute now “Diagnoses” instead of “Diagnosis”? (Session 17 - 8/17/17)
  • Yes. This change was made to support the fact that a single encounter may have multiple diagnoses associated with it. Note that the “Principal Diagnosis” attribute is still singular.
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, in version 1.3 of CQL, the Date type can be used for the daysInPeriod argument (i.e. List instead of List).
“id” uses in QDM v5.3: Which are the other uses for “id” in QDM v5.3? (Session 17 - 8/17/17)
  1. When using observations with different dates
  2. For an episode of care
  3. When using the same encounter from two different expressions.
“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