Tag Archives: Analytics

Google CQL: From Clinical Measurements to Action


Today, many institutions are building custom solutions for understanding their medical data, as well as tools for acting on that data. A major pain point with the current approach is that these tools can be error prone, lack built in medical context and medical data structure representations. Enter Clinical Quality Language (CQL), a portable, computable, and open HL7 language specification for expressing computable clinical logic over healthcare data. We believe that CQL has the power to radically improve the future of data driven workflows in healthcare. Over the past year at Google Health, our team has been hard at work building foundational tools for healthcare data analytics. Today we’re announcing the release of an experimental open source toolkit for Clinical Quality Language execution.

The Google CQL engine is an experimental open source toolkit that includes a CQL execution engine built from scratch in Go. We built this engine with a focus on horizontal scalability in mind, ease of use, and high test coverage. We wanted to make it easy to experiment with our engine, so we’ve included an easy to use CLI, REPL, and a two-click setup web playground! The toolkit is still a work in progress and we very much welcome input, contributions, and ideas from the community.


Why CQL

CQL represents a major shift away from the precedent of distributing clinical logic as free text guidelines which each institution implements in custom and often error prone ways. Now, CQL allows clinical logic to be written once, distributed, and run anywhere in a single framework. Major standards bodies like Medicare, NCQA, and the World Health Organization (WHO) have already started to adopt and distribute clinical measures in CQL! (Check out these antenatal care measures from the WHO as an example). We believe that CQL lowers the burden to writing, sharing, and computing complex clinical content.

CQL supports multiple common healthcare data models (such as FHIR and QDM) and is designed with common clinical concepts, tasks, and nested data structures in mind. For example, consider this comparison:

A side by side comparison of FHIR SQL (BigQuery) to CQL.
(click to enlarge) A side by side comparison of FHIR SQL (BigQuery) to CQL.
This logic extracts CHD encounters with statins prescribed during the visit.

The FHIR SQL requires more boilerplate, unnesting, and custom value set handling. It’s very clear here that the CQL is more readable, concise, and easier to understand than the SQL implementation for this example.

If you’d like to see a more in depth CQL example with an explanation, see Appendix A.

As the healthcare industry has matured so have the representations of Clinical Quality Measures. Previously, clinical quality mandates were provided as free-text guidelines. That left it up to each medical institution to implement themselves. This was of course error prone, and repetitive across the industry. There is a shift today where institutions like the WHO, CMS, and NCQA are writing clinical measures increasingly in CQL.

Transition to standards based Clinical Quality Measures diagram
Transition to standards based Clinical Quality Measures diagram

Examples like the WHO Antenatal Care Guidelines project exemplify the shift to openly distributed and executable measures. We believe that computable and shareable measures like these WHO SMART Guidelines are the future for expressing and sharing medical knowledge.


Our CQL Toolkit

We would love others excited about this work to check out our experimental CQL tools at https://github.com/google/cql. We continue to be very interested in welcoming external contributors, so we strongly encourage you to check out the repository to give it a try and consider helping with any open issues. If you’re not sure where to ask, reach out to us! We’d also like to hear from others about what they’re working on and how the Google CQL engine may fit into their toolchain, feel free to reach out at [email protected] or open an issue on the repository.

If you want to learn more about CQL see https://github.com/cqframework/clinical_quality_language and https://cql.hl7.org/index.html.


Appendix A: Simplified Diabetes CQL Example

library ExampleCQLLibrary version '1.2.3'
using FHIR version '4.0.1'

valueset Diabetes: 'diabetes-valuseset-url' version '1.0'
valueset GlucoseLevels: 'glucose-levels-valueset-url' version '1.0'

context Patient

define PatientMeetsAgeRequirement: AgeInYearsAt(Now()) < 20

define HasDiabetes:
       exists ([Condition: Diabetes] chd where chd.onset before Now())

define LatestGlucoseReading:
       Last([Observation: GlucoseLevels] bp sort by effective desc)

define LatestGlucoseAbove200: LatestGlucoseReading.value > 200

define Denominator: PatientMeetsAgeRequirement and HasDiabetes

define Numerator: Denominator and LatestGlucoseAbove200

In this example for a given patient record, the code selects for individuals under 20 where their most recent glucose reading was above 200. Although this is a simple example, it’s made simple because CQL provides a solid foundation for which to define and act on medical information and concepts.

By Evan Gordon and Suyash Kumar – Software Engineers 
Health AI Team: Ryan Brush, Kai Bailey, Ed Nanale, Chris Grenz

Google Ads API support for importing and editing conversions from Google Analytics

What's changing
Starting October 9, 2023, the Google Ads API will allow the following types of mutate operations for a ConversionAction imported from a Google Analytics 4 (GA4) property:
  1. An update that modifies status, primary_for_goal, category, name, or value_settings.
  2. A remove that removes the conversion action.
Why this is important
For many Google Ads users, the conversions they import from Google Analytics are a critical component of bidding and reporting. Until now, you could use the Google Analytics Admin API to create a link between your Google Analytics and Ads accounts, but you could not use the Google Ads API to complete the following remaining steps in the linking process: With this change, the Google Ads API supports both of these steps and provides a complete API-based solution for linking your Google Analytics 4 property to your Google Ads account.

In addition to the attributes needed for proper configuration of conversion goals, you can now modify the following attributes of an imported GA4 ConversionAction:
  • name
  • value_settings
Requests that attempt to modify any other attributes of an imported GA4 ConversionAction will continue to fail, as will requests that attempt to remove or update a ConversionAction imported from a Universal Analytics (UA) property.

What you should do
Modify any code in your integration that depends on the Google Ads API rejecting a ConversionActionOperation with a MUTATE_NOT_ALLOWED error if it attempts to update or remove an imported GA4 conversion. For example, if your integration relies on this behavior to detect if a conversion action is an imported GA4 conversion, modify it to instead check if the type of the ConversionAction is either GOOGLE_ANALYTICS_4_CUSTOM or GOOGLE_ANALYTICS_4_PURCHASE.

In addition, if you currently complete the process of linking Google Analytics to Google Ads accounts using the UI, consider whether switching to an API-based solution is appropriate for your use case.

How to get help
If you have any questions or need help, check out the Google Ads API support page for options.

Upcoming changes to Google Analytics audiences and conversions in Google Ads

What's changing

Starting in April 2023, Google Analytics 4 (GA4) will automatically set up a basic GA4 property linked to your Google Ads account if the Google Ads account still uses Universal Analyticsconversions and/or audiences.

During this process, GA4 will configure corresponding conversions and/or audiences in GA4 and apply them in your Google Ads account. This will happen even if you already have a GA4 property but still use Universal Analytics conversions and/or audiences in Google Ads.

Options for handling these changes

The configuration created by GA4 may not be set up to meet your specific business goals or capture all the historical data you need, so we recommend you start manually moving your conversions and/or audiences to GA4 now.

If you don’t want the GA4 Setup Assistant to make these changes, you may opt out by the end of April.

If you don’t want an automatically set up GA4 property at all, you can also opt out of the entire process.

What you should know

Universal Analytics standard properties will stop processing new data from July 1, 2023 onwards. GA4, our next-generation measurement solution, will become the sole Google Analytics standard property type.

This impacts Universal Analytics conversions, audiences, and site stats currently used in your Google Ads campaigns. We recommend that you switch to GA4 now to ensure your campaigns and ad groups are effectively moved to GA4 conversions, site stats, and audiences. If you’re unsure whether a GA4 property has been created, please contact the admin user for your Universal Analytics property in Google Analytics to verify.

Resources to help you migrate to Google Analytics 4

For an overview of functionality and features in UA and GA4, including APIs, check out the Universal Analytics to GA4 migration reference.

For API integrations:

  • If you previously used the Google Analytics Management API v3 to manage your Universal Analytics properties, migrate to the Admin API v1.
  • If you previously used the Google Analytics Reporting API v4 to run reports in your Universal Analytics properties, migrate to the Data API v1.

How to get help