{
  "resourceType" : "Library",
  "id" : "moduledefinition-example",
  "meta" : {
    "profile" : ["http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-moduledefinitionlibrary"]
  },
  "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\">Example Logic Library - Module Definition</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\">2.0.0</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\">EXMLogic</td>\n\n\n</tr>\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.38.28.7</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    US from <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">urn:iso:std:iso:3166</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\">Health Level 7 International - Clinical Quality Information 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>This library is used as an example module definition in the FHIR Quality Measure Implementation Guide</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    module-definition from <a href=\"http://terminology.hl7.org/7.1.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>: Code system Diagnosis Role\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</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>: Value set Emergency Department Visit\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.113883.3.117.1.7.1.292-20210611\">Emergency Department Visit</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</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>: Value set Psychiatric/Mental Health Patient\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.113883.3.117.1.7.1.299-20170816\">Psychiatric/Mental Health Diagnosis</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299</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>: Value set Hospital Settings\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1111.126-20200305\">Hospital Settings</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126</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>: Value set ONC Administrative Sex\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.113762.1.4.1-20150331\">Administrative Sex MF</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1</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>: Value set Race\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.114222.4.11.836-20121025\">Race</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836</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>: Value set Ethnicity\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.114222.4.11.837-20121025\">Ethnicity</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837</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>: Value set Payer\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.114222.4.11.3591-20250419\">Payer Type</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</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>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <code>http://example.org/fhir/us/qicore/StructureDefinition/qicore-patient</code>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')\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>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <code>http://example.org/fhir/us/qicore/StructureDefinition/qicore-encounter</code>\n    <br/>        \n  \n   \n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.113883.3.117.1.7.1.292-20210611\">Emergency Department Visit</a>\n    <br/> \n  \n  \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>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <code>http://example.org/fhir/us/qicore/StructureDefinition/qicore-Condition</code>\n    <br/>        \n  \n   \n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: id</span>\n    <br/>\n  \n  \n  \n  \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>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <code>http://example.org/fhir/us/qicore/StructureDefinition/qicore-coverage</code>\n    <br/>        \n  \n   \n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://tx.fhir.org/r4/ValueSet/2.16.840.1.114222.4.11.3591-20250419\">Payer Type</a>\n    <br/> \n  \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>Measurement Period</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Period</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>Inpatient Encounter</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Initial Population</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Measure Population</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Stratifier 1</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Stratifier 2</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Stratifier 3</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Stratifier 4</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Ethnicity</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Coding</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Payer</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Resource</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Race</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Coding</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Sex</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Coding</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  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.5 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
  },
  "url" : "http://hl7.org/fhir/uv/crmi/Library/moduledefinition-example",
  "identifier" : [{
    "use" : "official",
    "system" : "http://example.org/fhir/cqi/ecqm/Library/Identifier",
    "value" : "EXMLogic"
  },
  {
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:oid:2.16.840.1.113883.4.642.40.38.28.7"
  }],
  "version" : "2.0.0",
  "name" : "EXMLogicModuleDefinition",
  "title" : "Example Logic Library - Module Definition",
  "status" : "active",
  "experimental" : true,
  "type" : {
    "coding" : [{
      "system" : "http://terminology.hl7.org/CodeSystem/library-type",
      "code" : "module-definition"
    }]
  },
  "date" : "2019-09-03",
  "publisher" : "Health Level 7 International - Clinical Quality Information Work Group",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/cqi/index.cfm"
    }]
  }],
  "description" : "This library is used as an example module definition in the FHIR Quality Measure Implementation Guide",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "urn:iso:std:iso:3166",
      "code" : "US"
    }]
  }],
  "relatedArtifact" : [{
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Code system Diagnosis Role",
    "resource" : "http://terminology.hl7.org/CodeSystem/diagnosis-role"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Emergency Department Visit",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Psychiatric/Mental Health Patient",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Hospital Settings",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set ONC Administrative Sex",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Race",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Ethnicity",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837"
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-dependencyRole",
      "valueCode" : "default"
    }],
    "type" : "depends-on",
    "display" : "Value set Payer",
    "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
  }],
  "parameter" : [{
    "name" : "Measurement Period",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "type" : "Period"
  },
  {
    "name" : "Patient",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "type" : "Patient"
  },
  {
    "name" : "Inpatient Encounter",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Initial Population",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Measure Population",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 1",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 2",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 3",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "Stratifier 4",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Encounter"
  },
  {
    "name" : "SDE Ethnicity",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Coding"
  },
  {
    "name" : "SDE Payer",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Resource"
  },
  {
    "name" : "SDE Race",
    "use" : "out",
    "min" : 0,
    "max" : "*",
    "type" : "Coding"
  },
  {
    "name" : "SDE Sex",
    "use" : "out",
    "min" : 0,
    "max" : "1",
    "type" : "Coding"
  }],
  "dataRequirement" : [{
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Patient?_id={{context.patientId}}"
    }],
    "type" : "Patient",
    "profile" : ["http://example.org/fhir/us/qicore/StructureDefinition/qicore-patient"],
    "mustSupport" : ["extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity')"],
    "_mustSupport" : [{
      "extension" : [{
        "url" : "http://hl7.org/fhir/StructureDefinition/rendered-value",
        "valueString" : "ethnicity"
      }]
    }]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Encounter?status=finished&subject=Patient/{{context.patientId}}&type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-isSelective",
      "valueBoolean" : true
    },
    {
      "extension" : [{
        "url" : "path",
        "valueString" : "status"
      },
      {
        "url" : "comparator",
        "valueCode" : "eq"
      },
      {
        "url" : "value",
        "valueString" : "finished"
      }],
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-valueFilter"
    }],
    "type" : "Encounter",
    "profile" : ["http://example.org/fhir/us/qicore/StructureDefinition/qicore-encounter"],
    "codeFilter" : [{
      "path" : "type",
      "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
    }]
  },
  {
    "type" : "Condition",
    "profile" : ["http://example.org/fhir/us/qicore/StructureDefinition/qicore-Condition"],
    "codeFilter" : [{
      "path" : "id"
    }]
  },
  {
    "extension" : [{
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern",
      "valueString" : "Coverage?policy-holder=Patient/{{context.patientId}}&type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
    }],
    "type" : "Coverage",
    "profile" : ["http://example.org/fhir/us/qicore/StructureDefinition/qicore-coverage"],
    "codeFilter" : [{
      "path" : "type",
      "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"
    }]
  }]
}