Your User Friendly Name for MyContentIG Here
0.5.1-cibuild - CI Build
Your User Friendly Name for MyContentIG Here, published by HL7 International - [Some] Work Group. This guide is not an authorized publication; it is the continuous build for version 0.5.1-cibuild built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/sample-content-ig/ and changes regularly. See the Directory of published versions
Draft as of 2025-08-14 |
{
"resourceType" : "Measure",
"id" : "QuestionnaireMeasureExample",
"meta" : {
"profile" : [
🔗 "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"
]
},
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <table class=\"narrative-table\">\n <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">Questionnaire Measure Example</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">0.5.1-cibuild</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Jurisdiction</th>\n\n\n\n<td class=\"content-container\">\n 001 from <a href=\"http://unstats.un.org/unsd/methods/m49/m49.htm\">http://unstats.un.org/unsd/methods/m49/m49.htm</a> \n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n\n<td class=\"content-container\">HL7 International - [Some] Work Group</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n\n<td class=\"content-container\"><div><p>Example measure illustrating a continuous variable measure calculating scores from multiple questionnaires</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Scoring</th>\n\n\n\n<td class=\"content-container\">\n Continuous Variable\n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Improvement Notation</th>\n\n\n\n<td class=\"content-container\">\n increase from <a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-measure-improvement-notation.html\">http://terminology.hl7.org/CodeSystem/measure-improvement-notation</a> \n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Type</th>\n\n\n\n<td class=\"content-container\">\n process from <a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-measure-type.html\">http://terminology.hl7.org/CodeSystem/measure-type</a> \n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: group-1)</th>\n\n\n</tr>\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: 8A48538B-80BB-4E8B-9716-559C657278FD\n <br/>\n \n \n \n <em>Description</em>: No description provided\n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#group-1-8A48538B-80BB-4E8B-9716-559C657278FD\">Initial Population</a> \n \n \n \n \n \n \n </td>\n </tr>\n \n\n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Measure Population</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: 8FBD6CFA-99E4-4108-B083-91067C55170E\n <br/>\n \n \n \n <em>Description</em>: No description provided\n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#group-1-8FBD6CFA-99E4-4108-B083-91067C55170E\">Measure Population</a> \n \n \n \n \n \n \n </td>\n </tr>\n \n\n \n \n \n <tr>\n \n \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n \n <td class=\"content-container\">\n \n <em>ID</em>: 8B71AD15-47EB-4939-8318-1DF60CABCFD6\n <br/>\n \n \n \n <em>Description</em>: No description provided\n \n \n \n \n \n \n <em>Criteria</em>: <a href=\"#group-1-8B71AD15-47EB-4939-8318-1DF60CABCFD6\">MeasureObservation</a> \n \n \n \n \n \n <br/><em>Input Population</em>: 8FBD6CFA-99E4-4108-B083-91067C55170E\n \n \n <em>AggregateMethod</em>: average\n \n </td>\n </tr>\n \n\n \n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n\n\n<td class=\"content-container\"><a href=\"Library-QuestionnaireMeasureExample.html\">QuestionnaireMeasureExample</a></td>\n\n\n</tr>\n\n\n\n\n<tr>\n <th scope=\"row\" class=\"row-header\">Contents</th>\n <td class=\"content-container\">\n <em><a href=\"#population-criteria\">Population Criteria</a></em>\n <br/>\n <em><a href=\"#definitions\">Logic Definitions</a></em>\n <br/>\n <em><a href=\"#terminology\">Terminology</a></em>\n <br/>\n <em><a href=\"#dependencies\">Dependencies</a></em>\n <br/>\n <em><a href=\"#data-requirements\">Data Requirements</a></em>\n <br/>\n </td>\n</tr>\n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"population-criteria\"> </a>Population Criteria</th>\n\n\n</tr>\n \n \n \n\n \n \n \n \n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: group-1)</th>\n\n\n</tr>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Initial Population\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"group-1-8A48538B-80BB-4E8B-9716-559C657278FD\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Initial Population":\n AgeInYearsAt(start of "Measurement Period") >= 18</code></pre>\n \n \n <a href=\"#questionnairemeasureexample-initial-population\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Measure Population\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"group-1-8FBD6CFA-99E4-4108-B083-91067C55170E\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">// Likely some condition or other relevant characteristic such as a depression diagnosis\ndefine "Measure Population":\n true</code></pre>\n \n \n <a href=\"#questionnairemeasureexample-measure-population\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n \n Measure Observation\n \n </th>\n</tr>\n<tr>\n\n <td>\n \n \n \n \n \n <a name=\"group-1-8B71AD15-47EB-4939-8318-1DF60CABCFD6\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\nMeasure observation is a function defined in terms of the types of members of the measure\npopulation, Patient in this case. In a population evaluation scenario, the measure\nobservation is evaluated for every member of the population.\n\nIn an individual report scenario, however, the measure observation is evaluated for\nthe current patient. Note that the patient context is flowing through the call here\n*/\ndefine function "MeasureObservation"(patient Patient):\n PHQ9Logic.CalculateTotalScore</code></pre>\n \n \n <a href=\"#questionnairemeasureexample-measureobservation\"><em>Definition</em></a>\n \n </td>\n\n</tr>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"definitions\"> </a>Logic Definitions</th>\n\n\n</tr>\n \n \n \n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> QuestionnaireMeasureExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"questionnairemeasureexample-initial-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "Initial Population":\n AgeInYearsAt(start of "Measurement Period") >= 18</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> QuestionnaireMeasureExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"questionnairemeasureexample-measure-population\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">// Likely some condition or other relevant characteristic such as a depression diagnosis\ndefine "Measure Population":\n true</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> QuestionnaireMeasureExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"questionnairemeasureexample-measureobservation\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\nMeasure observation is a function defined in terms of the types of members of the measure\npopulation, Patient in this case. In a population evaluation scenario, the measure\nobservation is evaluated for every member of the population.\n\nIn an individual report scenario, however, the measure observation is evaluated for\nthe current patient. Note that the patient context is flowing through the call here\n*/\ndefine function "MeasureObservation"(patient Patient):\n PHQ9Logic.CalculateTotalScore</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n\n \n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> PHQ9LogicExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"phq9logicexample-questionnaireresponse\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">// Use the QuestionnaireResponse provided as a parameter if available\n// Otherwise look it up from the record\ndefine "QuestionnaireResponse":\n if response is not null then\n response\n else\n Last(\n [QuestionnaireResponse] QR\n where QR.questionnaire = 'http://somewhere.org/fhir/uv/mycontentig/Questionnaire/phq-9-questionnaire'\n sort by (authored as FHIR.dateTime) desc\n )</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> PHQ9LogicExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"phq9logicexample-responses\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">// NOTE: This ties this logic directly to this particular rendering of the Questionnaire.\n// Ideally the items would be filtered based on Code of the Item, rather than the LinkId,\n// but that would require pulling in the Questionnaire because the QuestionnaireResponse\n// only has the LinkId.\ndefine "Responses":\n "QuestionnaireResponse" QR\n return QR.item I where I.linkId in {\n 'LittleInterest',\n 'FeelingDown',\n 'TroubleSleeping',\n 'FeelingTired',\n 'BadApetite',\n 'FeelingBadAboutSelf',\n 'TroubleConcetrating',\n 'MovingSpeaking'\n }</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> PHQ9LogicExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"phq9logicexample-calculatetotalscore\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define "CalculateTotalScore":\n Sum("Responses" R return all AnswerCardinality(First(R.answer.value)))</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> PHQ9LogicExample</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"phq9logicexample-answercardinality\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@source: https://www.med.umich.edu/1info/FHP/practiceguides/depress/score.pdf\n*/\ndefine function "AnswerCardinality"(answer Coding):\n case\n when answer ~ "Not at all" then 0\n when answer ~ "Several days" then 1\n when answer ~ "More than half the days" then 2\n when answer ~ "Nearly every day" then 3\n else null\n end</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n\n \n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value uri): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tostring\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value string): value.value</code></pre>\n </td>\n\n</tr>\n\n\n\n \n\n\n\n \n\n\n<tr>\n <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n Logic Definition\n </th>\n\n <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n <td>\n \n \n \n \n <a name=\"fhirhelpers-tocode\"> </a>\n \n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToCode(coding FHIR.Coding):\n if coding is null then\n null\n else\n System.Code {\n code: coding.code.value,\n system: coding.system.value,\n version: coding.version.value,\n display: coding.display.value\n }</code></pre>\n </td>\n\n</tr>\n\n\n\n\n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"terminology\"> </a>Terminology</th>\n\n\n</tr>\n \n \n \n\n \n\n \n\n\n<tr>\n \n \n \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n \n <td class=\"content-container\">\n \n <em>Description</em>: Code system LOINC\n \n <br/>\n \n \n \n \n \n \n <em>Resource</em>: <a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html\">Logical Observation Identifiers, Names and Codes (LOINC)</a>\n <br/>\n <em>Canonical URL</em>: <tt>http://loinc.org</tt>\n \n </td>\n</tr>\n \n\n\n \n <tr>\n <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n <td class=\"content-container\">\n \n <em>Code</em>: LA6568-5\n <br/>\n <em>System</em>: <tt>http://loinc.org</tt>\n </td>\n </tr>\n\n <tr>\n <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n <td class=\"content-container\">\n \n <em>Code</em>: LA6569-3\n <br/>\n <em>System</em>: <tt>http://loinc.org</tt>\n </td>\n </tr>\n\n <tr>\n <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n <td class=\"content-container\">\n \n <em>Code</em>: LA6570-1\n <br/>\n <em>System</em>: <tt>http://loinc.org</tt>\n </td>\n </tr>\n\n <tr>\n <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n <td class=\"content-container\">\n \n <em>Code</em>: LA6571-9\n <br/>\n <em>System</em>: <tt>http://loinc.org</tt>\n </td>\n </tr>\n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"dependencies\"> </a>Dependencies</th>\n\n\n</tr>\n \n \n \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n\n<td class=\"content-container\">None</td>\n\n\n</tr>\n\n \n \n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"data-requirements\"> </a>Data Requirements</th>\n\n\n</tr>\n \n \n \n<tr>\n <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n <td class=\"content-container\">\n <em>Type</em>: QuestionnaireResponse\n <br/>\n \n <em>Profile(s)</em>: \n \n <a href=\"http://hl7.org/fhir/R4/questionnaireresponse.html\">QuestionnaireResponse</a>\n <br/> \n \n \n \n <em>Must Support Elements</em>: questionnaire, item, answer\n <br/>\n \n \n </td>\n</tr>\n\n<tr>\n <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n <td class=\"content-container\">\n <em>Type</em>: Patient\n <br/>\n \n <em>Profile(s)</em>: \n \n <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n <br/> \n \n \n \n \n </td>\n</tr>\n\n \n \n\n<tr>\n <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.1-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n </tbody>\n </table>\n</div>"
},
"contained" : [
{
"resourceType" : "Library",
"id" : "effective-data-requirements",
"extension" : [
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
"valueCoding" : {
"system" : "http://loinc.org",
"code" : "LA6568-5"
}
},
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
"valueCoding" : {
"system" : "http://loinc.org",
"code" : "LA6569-3"
}
},
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
"valueCoding" : {
"system" : "http://loinc.org",
"code" : "LA6570-1"
}
},
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-directReferenceCode",
"valueCoding" : {
"system" : "http://loinc.org",
"code" : "LA6571-9"
}
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "PHQ9LogicExample"
},
{
"url" : "name",
"valueString" : "QuestionnaireResponse"
},
{
"url" : "statement",
"valueString" : "// Use the QuestionnaireResponse provided as a parameter if available\n// Otherwise look it up from the record\ndefine \"QuestionnaireResponse\":\n if response is not null then\n response\n else\n Last(\n [QuestionnaireResponse] QR\n where QR.questionnaire = 'http://somewhere.org/fhir/uv/mycontentig/Questionnaire/phq-9-questionnaire'\n sort by (authored as FHIR.dateTime) desc\n )"
},
{
"url" : "displaySequence",
"valueInteger" : 0
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "PHQ9LogicExample"
},
{
"url" : "name",
"valueString" : "Responses"
},
{
"url" : "statement",
"valueString" : "// NOTE: This ties this logic directly to this particular rendering of the Questionnaire.\n// Ideally the items would be filtered based on Code of the Item, rather than the LinkId,\n// but that would require pulling in the Questionnaire because the QuestionnaireResponse\n// only has the LinkId.\ndefine \"Responses\":\n \"QuestionnaireResponse\" QR\n return QR.item I where I.linkId in {\n 'LittleInterest',\n 'FeelingDown',\n 'TroubleSleeping',\n 'FeelingTired',\n 'BadApetite',\n 'FeelingBadAboutSelf',\n 'TroubleConcetrating',\n 'MovingSpeaking'\n }"
},
{
"url" : "displaySequence",
"valueInteger" : 1
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "PHQ9LogicExample"
},
{
"url" : "name",
"valueString" : "CalculateTotalScore"
},
{
"url" : "statement",
"valueString" : "define \"CalculateTotalScore\":\n Sum(\"Responses\" R return all AnswerCardinality(First(R.answer.value)))"
},
{
"url" : "displaySequence",
"valueInteger" : 2
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "QuestionnaireMeasureExample"
},
{
"url" : "name",
"valueString" : "Initial Population"
},
{
"url" : "statement",
"valueString" : "define \"Initial Population\":\n AgeInYearsAt(start of \"Measurement Period\") >= 18"
},
{
"url" : "displaySequence",
"valueInteger" : 3
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "QuestionnaireMeasureExample"
},
{
"url" : "name",
"valueString" : "Measure Population"
},
{
"url" : "statement",
"valueString" : "// Likely some condition or other relevant characteristic such as a depression diagnosis\ndefine \"Measure Population\":\n true"
},
{
"url" : "displaySequence",
"valueInteger" : 4
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "QuestionnaireMeasureExample"
},
{
"url" : "name",
"valueString" : "MeasureObservation"
},
{
"url" : "statement",
"valueString" : "/*\nMeasure observation is a function defined in terms of the types of members of the measure\npopulation, Patient in this case. In a population evaluation scenario, the measure\nobservation is evaluated for every member of the population.\n\nIn an individual report scenario, however, the measure observation is evaluated for\nthe current patient. Note that the patient context is flowing through the call here\n*/\ndefine function \"MeasureObservation\"(patient Patient):\n PHQ9Logic.CalculateTotalScore"
},
{
"url" : "displaySequence",
"valueInteger" : 5
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value uri): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 6
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToString"
},
{
"url" : "statement",
"valueString" : "define function ToString(value string): value.value"
},
{
"url" : "displaySequence",
"valueInteger" : 7
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "PHQ9LogicExample"
},
{
"url" : "name",
"valueString" : "AnswerCardinality"
},
{
"url" : "statement",
"valueString" : "/*\n@source: https://www.med.umich.edu/1info/FHP/practiceguides/depress/score.pdf\n*/\ndefine function \"AnswerCardinality\"(answer Coding):\n case\n when answer ~ \"Not at all\" then 0\n when answer ~ \"Several days\" then 1\n when answer ~ \"More than half the days\" then 2\n when answer ~ \"Nearly every day\" then 3\n else null\n end"
},
{
"url" : "displaySequence",
"valueInteger" : 8
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
},
{
"extension" : [
{
"url" : "libraryName",
"valueString" : "FHIRHelpers"
},
{
"url" : "name",
"valueString" : "ToCode"
},
{
"url" : "statement",
"valueString" : "define function ToCode(coding FHIR.Coding):\n if coding is null then\n null\n else\n System.Code {\n code: coding.code.value,\n system: coding.system.value,\n version: coding.version.value,\n display: coding.display.value\n }"
},
{
"url" : "displaySequence",
"valueInteger" : 9
}
],
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-logicDefinition"
}
],
"name" : "EffectiveDataRequirements",
"status" : "active",
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "module-definition"
}
]
},
"relatedArtifact" : [
{
"type" : "depends-on",
"display" : "Library PHQ9Logic",
"resource" : "http://somewhere.org/fhir/uv/mycontentig/Library/PHQ9LogicExample"
},
{
"type" : "depends-on",
"display" : "Library FHIRHelpers",
"resource" : "http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1"
},
{
"type" : "depends-on",
"display" : "Code system LOINC",
"resource" : "http://loinc.org"
}
],
"parameter" : [
{
"name" : "response",
"use" : "in",
"min" : 0,
"max" : "1",
"type" : "QuestionnaireResponse"
},
{
"name" : "Measurement Period",
"use" : "in",
"min" : 0,
"max" : "1",
"type" : "Period"
},
{
"name" : "Initial Population",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
},
{
"name" : "Measure Population",
"use" : "out",
"min" : 0,
"max" : "1",
"type" : "boolean"
}
],
"dataRequirement" : [
{
"type" : "QuestionnaireResponse",
"profile" : [
🔗 "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"
],
"mustSupport" : [
"questionnaire",
"item",
"answer"
]
},
{
"type" : "Patient",
"profile" : [
🔗 "http://hl7.org/fhir/StructureDefinition/Patient"
]
}
]
}
],
"extension" : [
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem",
"valueReference" : {
🔗 "reference" : "Device/cqf-tooling"
}
},
{
"id" : "effective-data-requirements",
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements",
"valueReference" : {
"reference" : "#effective-data-requirements"
}
}
],
"url" : "http://somewhere.org/fhir/uv/mycontentig/Measure/QuestionnaireMeasureExample",
"version" : "0.5.1-cibuild",
"name" : "QuestionnaireMeasureExample",
"title" : "Questionnaire Measure Example",
"status" : "draft",
"experimental" : true,
"date" : "2025-08-14T10:02:17-07:00",
"publisher" : "HL7 International - [Some] Work Group",
"contact" : [
{
"telecom" : [
{
"system" : "url",
"value" : "http://hl7.org/Special/committees/[something]"
}
]
}
],
"description" : "Example measure illustrating a continuous variable measure calculating scores from multiple questionnaires",
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001"
}
]
}
],
"library" : [
🔗 "http://somewhere.org/fhir/uv/mycontentig/Library/QuestionnaireMeasureExample"
],
"scoring" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-scoring",
"code" : "continuous-variable",
"display" : "Continuous Variable"
}
]
},
"type" : [
{
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-type",
"code" : "process"
}
]
}
],
"improvementNotation" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
"code" : "increase"
}
]
},
"group" : [
{
"id" : "group-1",
"population" : [
{
"id" : "8A48538B-80BB-4E8B-9716-559C657278FD",
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "initial-population",
"display" : "Initial Population"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Initial Population"
}
},
{
"id" : "8FBD6CFA-99E4-4108-B083-91067C55170E",
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "measure-population",
"display" : "Measure Population"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "Measure Population"
}
},
{
"id" : "8B71AD15-47EB-4939-8318-1DF60CABCFD6",
"extension" : [
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-aggregateMethod",
"valueCode" : "average"
},
{
"url" : "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-criteriaReference",
"valueString" : "8FBD6CFA-99E4-4108-B083-91067C55170E"
}
],
"code" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/measure-population",
"code" : "measure-observation",
"display" : "Measure Observation"
}
]
},
"criteria" : {
"language" : "text/cql-identifier",
"expression" : "MeasureObservation"
}
}
]
}
]
}