Using CQL With FHIR
3.0.0-ballot - STU 3 Ballot

Using CQL With FHIR - Downloaded Version null See the Directory of published versions

## : Parameter Example

Page standards status: Informative

Raw json | Download

    {
      "resourceType" : "Library",
      "id" : "ParameterExample",
      "language" : "en",
      "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\">Parameter 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\">3.0.0-ballot</td>\n\n\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">urn:oid:2.16.840.1.113883.4.642.40.37.28.5</td>\n\n\n</tr>\n\n\n\n\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    World\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 / Clinical Decision Support</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 CQL library with a parameter defined, used to illustrate calling the $cql and Library/$evaluate operations with libraries that have parameters</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    logic-library from <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-library-type.html\">http://terminology.hl7.org/CodeSystem/library-type</a> \n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library FHIRHelpers\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Library-FHIRHelpers.html\">FHIR Helpers</a> version: 4.0.2-ballot\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.2-ballot</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\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://tx.fhir.org/r4/ValueSet/x-loinc2.82\">LOINC</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://loinc.org</tt>\n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/observation.html\">Observation</a>\n    <br/>        \n  \n   \n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code(s)</em>: \n    \n      \n      <a href=\"https://loinc.org/2339-0\">LOINC: 2339-0</a> (Glucose Bld-mCnc)\n      \n    \n    </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>GlucoseThreshold</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Quantity</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Blood Glucose Observations</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Observation</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\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\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library ParameterExample\n\nusing FHIR version '4.0.1'\n\ninclude FHIRHelpers version '4.0.2-ballot'\n\ncodesystem LOINC: 'http://loinc.org'\ncode &quot;Blood Glucose&quot;: '2339-0' from LOINC display 'Glucose Bld-mCnc'\n\nparameter GlucoseThreshold Quantity\n\ncontext Patient\n\ndefine &quot;Blood Glucose Observations&quot;:\n  [Observation: &quot;Blood Glucose&quot;] BG\n    where BG.value &gt; GlucoseThreshold\n</code></pre>\n      </td>\n    </tr>\n    \n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">ELM JSON Content</th>\n      <td>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code>Encoded data </code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.6-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "contained" : [
        {
          "resourceType" : "Parameters",
          "id" : "options",
          "parameter" : [
            {
              "name" : "translatorVersion",
              "valueString" : "3.9.0"
            },
            {
              "name" : "enableAnnotations",
              "valueBoolean" : true
            },
            {
              "name" : "enableLocators",
              "valueBoolean" : true
            },
            {
              "name" : "disableListDemotion",
              "valueBoolean" : true
            },
            {
              "name" : "disableListPromotion",
              "valueBoolean" : true
            },
            {
              "name" : "format",
              "valueString" : "JSON"
            },
            {
              "name" : "format",
              "valueString" : "XML"
            },
            {
              "name" : "analyzeDataRequirements",
              "valueBoolean" : false
            },
            {
              "name" : "collapseDataRequirements",
              "valueBoolean" : true
            },
            {
              "name" : "compatibilityLevel",
              "valueString" : "1.5"
            },
            {
              "name" : "enableCqlOnly",
              "valueBoolean" : false
            },
            {
              "name" : "errorLevel",
              "valueString" : "Info"
            },
            {
              "name" : "signatureLevel",
              "valueString" : "Overloads"
            },
            {
              "name" : "validateUnits",
              "valueBoolean" : true
            },
            {
              "name" : "verifyOnly",
              "valueBoolean" : false
            }
          ]
        }
      ],
      "extension" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions",
          "valueReference" : {
            "reference" : "#options"
          }
        }
      ],
      "url" : "http://hl7.org/fhir/uv/cql/Library/ParameterExample",
      "identifier" : [
        {
          "system" : "urn:ietf:rfc:3986",
          "value" : "urn:oid:2.16.840.1.113883.4.642.40.37.28.5"
        }
      ],
      "version" : "3.0.0-ballot",
      "name" : "ParameterExample",
      "title" : "Parameter Example",
      "status" : "active",
      "experimental" : true,
      "type" : {
        "coding" : [
          {
            "system" : "http://terminology.hl7.org/CodeSystem/library-type",
            "code" : "logic-library"
          }
        ]
      },
      "date" : "2026-08-14T03:31:27+10:00",
      "publisher" : "HL7 International / Clinical Decision Support",
      "contact" : [
        {
          "telecom" : [
            {
              "system" : "url",
              "value" : "http://www.hl7.org/Special/committees/dss"
            }
          ]
        }
      ],
      "description" : "Example CQL library with a parameter defined, used to illustrate calling the $cql and Library/$evaluate operations with libraries that have parameters",
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
              "code" : "001",
              "display" : "World"
            }
          ]
        }
      ],
      "relatedArtifact" : [
        {
          "type" : "depends-on",
          "display" : "Library FHIRHelpers",
          "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.2-ballot"
        },
        {
          "type" : "depends-on",
          "display" : "Code System LOINC",
          "resource" : "http://loinc.org"
        }
      ],
      "parameter" : [
        {
          "name" : "GlucoseThreshold",
          "use" : "in",
          "min" : 0,
          "max" : "1",
          "type" : "Quantity"
        },
        {
          "name" : "Patient",
          "use" : "out",
          "min" : 0,
          "max" : "1",
          "type" : "Patient"
        },
        {
          "name" : "Blood Glucose Observations",
          "use" : "out",
          "min" : 0,
          "max" : "*",
          "type" : "Observation"
        }
      ],
      "dataRequirement" : [
        {
          "type" : "Observation",
          "profile" : [
            🔗 "http://hl7.org/fhir/StructureDefinition/Observation"
          ],
          "codeFilter" : [
            {
              "path" : "code",
              "code" : [
                {
                  "system" : "http://loinc.org",
                  "code" : "2339-0",
                  "display" : "Glucose Bld-mCnc"
                }
              ]
            }
          ]
        }
      ],
      "content" : [
        {
          "contentType" : "text/cql",
          "data" : "bGlicmFyeSBQYXJhbWV0ZXJFeGFtcGxlCgp1c2luZyBGSElSIHZlcnNpb24gJzQuMC4xJwoKaW5jbHVkZSBGSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMi1iYWxsb3QnCgpjb2Rlc3lzdGVtIExPSU5DOiAnaHR0cDovL2xvaW5jLm9yZycKY29kZSAiQmxvb2QgR2x1Y29zZSI6ICcyMzM5LTAnIGZyb20gTE9JTkMgZGlzcGxheSAnR2x1Y29zZSBCbGQtbUNuYycKCnBhcmFtZXRlciBHbHVjb3NlVGhyZXNob2xkIFF1YW50aXR5Cgpjb250ZXh0IFBhdGllbnQKCmRlZmluZSAiQmxvb2QgR2x1Y29zZSBPYnNlcnZhdGlvbnMiOgogIFtPYnNlcnZhdGlvbjogIkJsb29kIEdsdWNvc2UiXSBCRwogICAgd2hlcmUgQkcudmFsdWUgPiBHbHVjb3NlVGhyZXNob2xkCg=="
        },
        {
          "contentType" : "application/elm+json",
          "data" : " "
        }
      ]
    }