Clinical Quality Language (CQL) Bryn Rhodes Chris Moesel Mark Kramer.

Slides:



Advertisements
Similar presentations
Advanced SQL (part 1) CS263 Lecture 7.
Advertisements

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos & A. Pavlo Lecture#6: Rel. model - SQL part1 (R&G, chapter.
Quality Measurement – Clinical Decision Support Harmonization Proposal.
COMP 3715 Spring 05. Working with data in a DBMS Any database system must allow user to  Define data Relations Attributes Constraints  Manipulate data.
Concepts of Database Management Sixth Edition
Structure Query Language (SQL) COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Introduction to Structured Query Language (SQL)
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Concepts of Database Management Sixth Edition
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
Chapter 11.1 and 11.2 Data Manipulation: Relational Algebra and SQL Brian Cobarrubia Introduction to Database Management Systems October 4, 2007.
Clinical Quality Language (CQL)
Chapter 4 Relational Databases and Enterprise Systems
Environment Change Information Request Change Definition has subtype of Business Case based upon ConceptPopulation Gives context for Statistical Program.
Concepts of Database Management, Fifth Edition
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Introduction to Databases Chapter 6: Understanding the SQL Language.
Relational DBs and SQL Designing Your Web Database (Ch. 8) → Creating and Working with a MySQL Database (Ch. 9, 10) 1.
Chapter 3 Single-Table Queries
Introduction to Databases Chapter 7: Data Access and Manipulation.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
HAP 709 – Healthcare Databases SQL Data Manipulation Language (DML) Updated Fall, 2009.
Analyzing Data For Effective Decision Making Chapter 3.
This material was developed by Duke University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information.
Clinical Quality Framework (CQF) Update cqframework.info Kensaku Kawamoto, MD, PhD, MHS Co-Initiative Coordinator, CQF Public Health Tiger Team August.
1 CS 430 Database Theory Winter 2005 Lecture 12: SQL DML - SELECT.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Aggregation.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
04 | Grouping and Aggregating Data Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
Dimitrios Skoutas Alkis Simitsis
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Environment Change Information Request Change Definition has subtype of Business Case based upon ConceptPopulation Gives context for Statistical Program.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Health eDecisions Use Case 2: CDS Guidance Service Strawman of Core Concepts Use Case 2 1.
In this session, you will learn to: Use functions to customize the result set Summarize and group data Objectives.
Chapter 5 Relational Algebra and Relational Calculus Pearson Education © 2009.
Queries SELECT [DISTINCT] FROM ( { }| ),... [WHERE ] [GROUP BY [HAVING ]] [ORDER BY [ ],...]
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
Data Access Framework (DAF) Relationship to Other ONC Initiatives 1.
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections UTPA – Fall 2011.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
Query Health Technical WG 6/14/2012. Agenda TopicTime Slot Announcements2:05 – 2:10 pm RI and Spec Updates2:05 – 2:10 pm QRDA Discussion2:10 – 3:00 pm.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 6 This material was developed by Oregon Health & Science.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
SQL. Originally developed by IBM Standardized in 80’s by ANSI and ISO Language to access relational database and English-like non-procedural Predominant.
Aggregator  Performs aggregate calculations  Components of the Aggregator Transformation Aggregate expression Group by port Sorted Input option Aggregate.
Functional Processing of Collections (Advanced) 6.0.
Retrieving Information Pertemuan 3 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Chapter 11 – Data Manipulation: Relational Algebra and SQL1 Unit 9: Data Manipulation: Relational Algebra and SQL IT238: Data Modeling and Database Design.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Teacher Workshop Database Design Pearson Education © 2014.
In this session, you will learn to:
Relational Database Design
Basic select statement
Test Review Computer Science History
SQL Structured Query Language 11/9/2018 Introduction to Databases.
Metadata Framework as the basis for Metadata-driven Architecture
Contents Preface I Introduction Lesson Objectives I-2
Shelly Cashman: Microsoft Access 2016
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

Clinical Quality Language (CQL) Bryn Rhodes Chris Moesel Mark Kramer

CQL Background Part of CQM-CDS harmonization project Objective is to define an author-friendly and human-readable language to define quality measures and decision support rules (QDM heritage) Must be computable and implementable (HeD heritage) Functional requirements defined in “Harmonization of Health Quality Artifact Reasoning and Expression Logic”

Probably Sexually Active Initial Population Definition Condition, Occurrence Patient FHIR Logic CCDA Logic FHIR API CCDA Generator EHR Medication Treatment, Ordered Chlamydia Test Recommended … EHR Custom EHR Logic … Defined by Rule/Measure authors using CQL REST API e.g. SQL Overview of CQL Conceptual Architecture Integration with back- end data stores Concepts defined in Quality Logical Model (QUICK) Intermediate inference Mappings from quality logical model to underlying data models EHR

CQL File Structure Each library is a readable, plain text file May include other libraries by reference Logic in each file is potentially reusable by other libraries Declarations Data Retrieval Computation Inputs (parameters) Outputs May be comingled

CQL Declarations library declaration – Defines the name and optional version of the library using declaration – Define the data model(s) in use in file include declaration – Define other libraries (CQL files) referenced context declaration – Define the context for subsequent statements(e.g. Patient or Population) – Anchors references in the file parameter declaration – Define available “inputs” valueset declaration – Define user-friendly labels for value sets within the library

Declaration Examples

Retrieve Retrieves information from the data layer – Respects current context (Patient, Population) Specified in terms of Data Model – '[' namedTypeSpecifier ']' – [Encounter] – [ProcedureRequest] – [DeviceUse] Optionally filter by “primary” Code – [Encounter: "Inpatient"] Optionally filter by specific Code – [Encounter: severity in "Severities"]

Data Types Simple Types – Boolean, String, Number, Date/Time – true, 16, Clinical Types – Quantities, Value Sets – 3 months, 6 'gm/cm3' – "Female Administrative Sex" Structured Types – Model Classes, Tuples – [Encounter] – Tuple { Name: 'Patrick', DOB: Date(2014, 1, 1) } List Types – { 1, 2, 3, 4, 5 } Interval Types – Interval(today - 1 years, today]

Simple Expressions Logic – A and B – A and not (B or C) Comparison – A >= B – A <> B Arithmetic – A + B – A + B * C

Timing/Interval Operations Full set from QDM – starts before start, starts same day as Timing Phrases – starts 3 days before start – starts 3 days or less before start – starts within 3 days of start Interval operators – meets, overlaps, during Boundary access – start of MeasurementPeriod Membership – X in interval[4, 6]

Interval Operators

Date/Time Manipulation Date Construction – Date(2014, 1, 1, 12, 0, 0, -6) – convert ' T12:00:00-06:00' to DateTime Date Arithmetic – today + 3 months - 2 days – months between start of X and end of X – difference in days between X and Y – duration in months of X Date/Time extraction – date of D // returns the date without the time – time of D // returns the time without the date Component extraction – month of D // returns the number of whole units

List Operations Selector – builds a list – { 1, 2, 3, 4, 5 } Membership – determine if an element is in a list – X in { 1, 2, 3, 4, 5 } – { 1, 2, 3, 4, 5 } contains X Comparison – L = { 4, 5, 6 } // true if L has the same elements – L includes { 4, 5, 6 } // true if L includes each element – { 4, 5, 6 } included in L // inverse of includes Indexer/Position – { 4, 5, 6 }[1] // 1-based, evaluates to 4 Count – Count({ 4, 5, 6 }) // evaluates to 3 First/Last – First({ 4, 5, 6 }) // evaluates to 4

Queries The “query” construct is used to perform various operations, including filtering, shaping, sorting, and relating results. Simplest query involves only a single source: The alias “E” allows the source to be referenced anywhere within the query.

Filtering A “where” clause returns only those elements that satisfy the condition:

Shaping The “return” clause allows the shape of the result to be described:

Sorting “sort by” allows the results of a query to be ordered. Sorting is evaluated after any “return”

Filtering by Relationships Use the “with” keyword to introduce a filtering relationship: NOTE: This operation is known as a semi-join in database languages.

Multi-Source Queries Queries can specify multiple sources to be combined:

Set Operations CQL supports standard set operations: – union, intersection, and difference (except)

Conditional Expressions CQL supports an “if” expression, as well as a SQL-style “case” expression:

Aggregate Expressions CQL supports a full complement of aggregate expressions including: – Count, Sum, Min, Max, Avg – Std Dev, Variance, Median, Mode

Define Statements “define” statements can be used to break expressions into smaller chunks:

Defining Functions CQL allows functions to be defined:

Using Libraries Each library defines a name and optional version Elements referenced from a library must be qualified Element names within a library must be unique Library names must be unique within a repository Version number is optional for library definition – If none given, references cannot use a version Version is optional for include definition – If specified, that version must be used – If none given, the “most recent” version is used

Next Steps CQL Specification – Author’s Guide provides a more detailed introduction – Developer’s Guide provides more technical detail – CQL Reference provides detailed descriptions of all available operators CQL Office hours weekly, Wed 11:00 Eastern – – Dial , Participant Code: CQL Github Repository –