# AHRQ indicators and OpenEHR **Category:** [Clinical (archive)](https://discourse.openehr.org/c/clinical-archive/153) **Created:** 2008-10-24 07:44 UTC **Views:** 2 **Replies:** 2 **URL:** https://discourse.openehr.org/t/ahrq-indicators-and-openehr/14837 --- ## Post #1 by @Marco_Sedda Hello all, I'm working in a project to build a system for clinicals data capture and data analisys refers at some indicators which you can find at [http://www.qualityindicators.ahrq.gov/](http://www.qualityindicators.ahrq.gov/) This indicators, defined by AHRQ (Agency for Healthcare Research and Quality) can indicate for example "Diabetes short-term complication admission rate" with specifics like: "all non-maternal/non-neonatal discharges of age 18 years and older with ICD-9-CM principal diagnosis codes for diabetes short-term complications (ketoacidosis, hyperosmolarity, coma) I've to give a formal description for AHRQ indicators; I've looked at Archetype Query Language AQL and maybe can be the best candidate for this purpose. Someone has had experiences about it? --- ## Post #2 by @system Hi Marco, Below are two AQL examples for your query specified in your previous email. I am not very familiar with ICD-9-CM. Ocean AQL query engine supports SNOMED, so I use SNOMED code in the examples. Query 1: All discharges with SNOMED-CT diagnosis codes for diabetes complications. Please note that this AQL query uses matches operator and a terminology URI to check for the criteria of “all diagnosis that is a child of diabetes complications (conceptId=7427003)”. This would include both diabetes short term and long-term complications: SELECT discharge FROM EHR e CONTAINS COMPOSITION discharge[openEHR-EHR-COMPOSITION.discharge.v1.adl] CONTAINS diagnosis [openEHR-EHR-EVALUATION.problem-diagnosis.v1] WHERE diagnosis/data[at0001]/items[at0002.1]/value/defining_code matches {terminology://SNOMED-CT/hierarchy?conceptId= 74627003 } Query 2: All discharges with SNOMED-CT diagnosis codes for diabetes short-term complications, i.e. ketoacidosis, hyperosmolarity, and coma. As I cannot find a single generic concept for diabetes short-term complications in SNOMED, so I have to have three concept codes: · 420422005 - Ketoacidosis in diabetes mellitus (disorder) - includes type 1 and type 2 diabetes with ketoacidosis; · 14735008 is the only one concept for hyperosmolarity in SNOMED, · 267384006 - Hypoglycemic coma (disorder) - includes both type 1 and type 2 diabetes with Hypoglycemic coma): SELECT discharge FROM EHR e CONTAINS COMPOSITION discharge[openEHR-EHR-COMPOSITION.discharge.v1.adl] CONTAINS diagnosis [openEHR-EHR-EVALUATION.problem-diagnosis.v1] WHERE diagnosis/data[at0001]/items[at0002.1]/value/defining_code matches {terminology://SNOMED-CT/hierarchy?conceptId= 420422005} OR diagnosis/data[at0001]/items[at0002.1]/value/defining_code/code_string = ‘14735008’ OR diagnosis/data[at0001]/items[at0002.1]/value/defining_code matches {terminology://SNOMED-CT/hierarchy?conceptId= 267384006} Two things I need to mention: 1. I am not sure about the criteria of non-maternal/non-neonatal discharges, i.e. how we would know the a discharge is non-maternal /non-neonatal, can we use patient location (point of care unit) to inference the discharge type? 2. The two AQL examples mentioned above don’t have any criteria on patient’s age. Patient’s age is type of demographic information. Generally, you can query the corresponding demographic service to get all EHR ids for the patients who is 18 years and older. Then you use the EHR IDs to get appropriate clinical data (uses matches operator with a string list), e.g. the AQL could look like: SELECT discharge FROM EHR e CONTAINS COMPOSITION discharge[openEHR-EHR-COMPOSITION.discharge.v1.adl] CONTAINS diagnosis [openEHR-EHR-EVALUATION.problem-diagnosis.v1] WHERE diagnosis/data[at0001]/items[at0002.1]/value/defining_code matches {terminology://SNOMED-CT/hierarchy?conceptId= 74627003 } AND e/ehr_id/value matches {‘ehrId1’, ‘ehrId2’, ‘ehrid3’…} Hope this helps. Cheers, Chunlan --- ## Post #3 by @Marco_Sedda Hi Chunlan, thanks for answering and for your AQL examples! I've looked at ICD-9-CM codes and i've founded codes to describe maternal or neonatal diagnosis for diabetes. I think I can use this codes on the query to exclude maternal or neonatal discharges --- **Canonical:** https://discourse.openehr.org/t/ahrq-indicators-and-openehr/14837 **Original content:** https://discourse.openehr.org/t/ahrq-indicators-and-openehr/14837