Canonical Resource Management Infrastructure Implementation Guide
1.0.0-ballot - Ballot International flag

This page is part of the Canonical Resource Management Infrastructure Implementation Guide (v1.0.0-ballot: STU1 Ballot 1) based on FHIR R4. . For a full list of available versions, see the Directory of published versions

: publishable-example-measure - XML Representation

Draft as of 2023-03-13

Raw xml | Download



<Measure xmlns="http://hl7.org/fhir">
  <id value="publishable-example"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablemeasure"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative: Measure</b><a name="publishable-example"> </a></p><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource Measure &quot;publishable-example&quot; </p><p style="margin-bottom: 0px">Profile: <a href="StructureDefinition-crmi-publishablemeasure.html">CRMI Publishable Measure</a></p></div><p><b>CRMI Software System</b>: <a href="Device-cqf-tooling.html">Device/cqf-tooling</a></p><p><b>CRMI Effective Data Requirements</b>: <a name="effective-data-requirements"> </a></p><blockquote><p/><p><a name="effective-data-requirements"> </a></p><p><b>Direct reference code</b>: 10-14 years (Details: http://example.org/CodeSystem/iso-8601-derived-periods code P10Y--P14Y = 'P10Y--P14Y', stated as '10-14 years')</p><p><b>Direct reference code</b>: 15-19 years (Details: http://example.org/CodeSystem/iso-8601-derived-periods code P15Y--P19Y = 'P15Y--P19Y', stated as '15-19 years')</p><p><b>Direct reference code</b>: 20+ years (Details: http://example.org/CodeSystem/iso-8601-derived-periods code P20Y--P9999Y = 'P20Y--P9999Y', stated as '20+ years')</p><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCBaseDataElements</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Antenatal care contact</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: define &quot;Antenatal care contact&quot;:
  [&quot;Encounter&quot;: type in BCx.&quot;Antenatal care contact&quot;]</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 0</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: First antenatal care contact</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: define &quot;First antenatal care contact&quot;:
  BaseData.&quot;Antenatal care contact&quot; C
    where C.reasonCode in Cx.&quot;First Antenatal Care Contact Choices&quot;</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 1</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCContactDataElements</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Gestational age</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
  @dataElement: ANC.B6.DE17 Gestational age
  @activity: ANC.B6 Profile
  @description: Gestational age in weeks and/or days depending on the source of gestational age
*/
define &quot;Gestational age&quot;:
  WC.MostRecent(
  [Observation: Cx.&quot;Gestational age&quot;] O
    where O.status in { 'final', 'amended', 'corrected' }
      and Coalesce(WC.ModifierExtension(O, 'who-notDone').value, false) is false
      and Last(Split(O.encounter.reference, '/')) = Last(Split(encounter, '/'))
  ).value as FHIR.Quantity</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 2</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Numerator</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
Numerator: Number of pregnant women who had their first ANC contact before 12 weeks (facility level)
Numerator Computation: Count of women whose gestational age &lt;= 12 weeks at the time of first contact
*/
define Numerator:
  exists (
    &quot;First antenatal care contact&quot; C
      where C.period starts during &quot;Measurement Period&quot;
        and ContactData.&quot;Gestational age&quot; &lt;= 12 weeks
  )</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 3</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCStratifiers</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: By Age</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
By Patient Age as of the start of the Measurement Period
Age (10-14, 15-19, 20+)
*/
define &quot;By Age&quot;:
  case
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[10, 14] then &quot;P10Y--P14Y&quot;
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[15, 19] then &quot;P15Y--P19Y&quot;
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 20 then &quot;P20Y--P9999Y&quot;
    else null
  end</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 4</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Age Stratifier</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
Disaggregation: Age (10-14, 15-19, 20+)
*/
define &quot;Age Stratifier&quot;:
  Stratifiers.&quot;By Age&quot;</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 5</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Denominator</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
Denominator: Total number of antenatal clients with a first contact
Denominator Computation: Count of all women who had first contact within the last reporting period
*/
define Denominator:
  exists (
    &quot;First antenatal care contact&quot; C
      where C.period starts during &quot;Measurement Period&quot;
  )</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 6</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCStratifiers</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: By Education Level</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
By Patient Education Level (none, don't know, primary, secondary, higher)
*/
define &quot;By Education Level&quot;:
  Patient.extension E
    where E.url = 'http://fhir.org/guides/who/anc-cds/StructureDefinition/educationlevel'
    return E.value as CodeableConcept</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 7</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Education Level Stratifier</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
Disaggregation: Education Level (none, don't know, primary, secondary, higher)
*/
define &quot;Education Level Stratifier&quot;:
  Stratifiers.&quot;By Education Level&quot;</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 8</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCBaseDataElements</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Antenatal care case</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
define &quot;Pregnant&quot;:
  &quot;Pregnancy&quot; is not null
    or &quot;Pregnancy status&quot; in BCx.&quot;Pregnancy status - pregnant&quot;

define &quot;Pregnancy status&quot;:
  FHIRHelpers.ToConcept(
    Last(
      [Observation: BCx.&quot;Pregnancy status&quot;] O
        where O.status = 'final'
        sort by FHIRHelpers.ToDateTime(effective as FHIR.dateTime)
    ).value
  )
*/
define &quot;Antenatal care case&quot;:
  [&quot;EpisodeOfCare&quot;: type in BCx.&quot;Antenatal care case&quot;]</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 9</p></blockquote><blockquote><p><b>Logic definition</b></p><blockquote><p><b>url</b></p><code>libraryName</code></blockquote><p><b>value</b>: ANCIND01</p><blockquote><p><b>url</b></p><code>name</code></blockquote><p><b>value</b>: Initial Population</p><blockquote><p><b>url</b></p><code>statement</code></blockquote><p><b>value</b>: /*
Initial population: Antenatal clients
*/
define &quot;Initial Population&quot;:
  exists (BaseData.&quot;Antenatal care case&quot;)</p><blockquote><p><b>url</b></p><code>displaySequence</code></blockquote><p><b>value</b>: 10</p></blockquote><p><b>status</b>: active</p><p><b>type</b>: Module Definition <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-library-type.html">LibraryType</a>#module-definition)</span></p><h3>RelatedArtifacts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Type</b></td><td><b>Display</b></td><td><b>Resource</b></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Library ANCCohort</td><td><a href="Library-ANCCohort.html">ANC Cohort</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Library FHIRHelpers</td><td><a href="http://fhir.org/guides/cqf/common/Library/FHIRHelpers">http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Example Code system ISO-8601-Derived Periods</td><td><a href="http://example.org/CodeSystem/iso-8601-derived-periods">http://example.org/CodeSystem/iso-8601-derived-periods</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Value set Antenatal care contact</td><td><a href="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact">http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Value set First Antenatal Care Contact Choices</td><td><a href="http://fhir.org/guides/who/anc-cds/ValueSet/anc-b5-de2">http://fhir.org/guides/who/anc-cds/ValueSet/anc-b5-de2</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Value set Gestational age</td><td><a href="http://fhir.org/guides/who/anc-cds/ValueSet/anc-b6-de17">http://fhir.org/guides/who/anc-cds/ValueSet/anc-b6-de17</a></td></tr><tr><td style="display: none">*</td><td>depends-on</td><td>Value set Antenatal care case</td><td><a href="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-case">http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-case</a></td></tr></table><h3>Parameters</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Name</b></td><td><b>Use</b></td><td><b>Min</b></td><td><b>Max</b></td><td><b>Type</b></td></tr><tr><td style="display: none">*</td><td>Measurement Period</td><td>in</td><td>0</td><td>1</td><td>Period</td></tr><tr><td style="display: none">*</td><td>encounter</td><td>in</td><td>0</td><td>1</td><td>string</td></tr><tr><td style="display: none">*</td><td>Numerator</td><td>out</td><td>0</td><td>1</td><td>boolean</td></tr><tr><td style="display: none">*</td><td>Age Stratifier</td><td>out</td><td>0</td><td>1</td><td>Coding</td></tr><tr><td style="display: none">*</td><td>Denominator</td><td>out</td><td>0</td><td>1</td><td>boolean</td></tr><tr><td style="display: none">*</td><td>Education Level Stratifier</td><td>out</td><td>0</td><td>*</td><td>CodeableConcept</td></tr><tr><td style="display: none">*</td><td>Initial Population</td><td>out</td><td>0</td><td>1</td><td>boolean</td></tr></table><blockquote><p><b>dataRequirement</b></p><p><b>Is Selective</b>: true</p><p><b>type</b>: Encounter</p><p><b>profile</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a></p><p><b>mustSupport</b>: type, reasonCode, period</p><blockquote><p><b>codeFilter</b></p></blockquote></blockquote><blockquote><p><b>dataRequirement</b></p><p><b>Is Selective</b>: true</p><p><b>type</b>: Observation</p><p><b>profile</b>: <a href="http://hl7.org/fhir/R4/observation.html">Observation</a></p><p><b>mustSupport</b>: code, status, encounter, encounter.reference</p><blockquote><p><b>codeFilter</b></p></blockquote></blockquote><blockquote><p><b>dataRequirement</b></p><p><b>type</b>: Patient</p><p><b>profile</b>: <a href="http://hl7.org/fhir/R4/patient.html">Patient</a></p><p><b>mustSupport</b>: url, value</p></blockquote><blockquote><p><b>dataRequirement</b></p><p><b>type</b>: EpisodeOfCare</p><p><b>profile</b>: <a href="http://hl7.org/fhir/R4/episodeofcare.html">EpisodeOfCare</a></p><p><b>mustSupport</b>: type</p><blockquote><p><b>codeFilter</b></p></blockquote></blockquote></blockquote><p><b>url</b>: <code>http://hl7.org/fhir/uv/crmi/Measure/publishable-example</code></p><p><b>version</b>: 1.0.0-ballot</p><p><b>name</b>: ANCIND01</p><p><b>title</b>: ANC.IND.01 Percentage of pregnant women with first ANC contact in the first trimester</p><p><b>status</b>: draft</p><p><b>experimental</b>: false</p><p><b>date</b>: 2023-03-13 22:32:10-0600</p><p><b>publisher</b>: Clinical Decision Support WG</p><p><b>contact</b>: <a href="http://www.hl7.org/Special/committees/dss">http://www.hl7.org/Special/committees/dss</a></p><p><b>description</b>: Percentage of pregnant women with first ANC contact in the first trimester (before 12 weeks of gestation)</p><p><b>jurisdiction</b>: World <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (m49.htm#001)</span></p><blockquote><p><b>relatedArtifact</b></p><p><b>Is Primary Citation</b>: true</p><p><b>type</b>: citation</p><p><b>citation</b>: WHO, UN Women, UNFPA. Health care for women subjected to intimate partner violence or sexual violence – a clinical handbook. Geneva: World Health Organization; 2014</p><p><b>url</b>: <a href="https://apps.who.int/iris/bitstream/handle/10665/136101/WHO_RHR_14.26_eng.pdf">https://apps.who.int/iris/bitstream/handle/10665/136101/WHO_RHR_14.26_eng.pdf</a></p><blockquote><p><b>document</b></p></blockquote></blockquote><p><b>library</b>: <a href="Library-ANCCohort.html">ANC Cohort</a></p><p><b>scoring</b>: Proportion <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-scoring.html">MeasureScoring</a>#proportion)</span></p><p><b>type</b>: Process <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-type.html">MeasureType</a>#process)</span></p><p><b>improvementNotation</b>: Increased score indicates improvement <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-improvement-notation.html">MeasureImprovementNotation</a>#increase)</span></p><blockquote><p><b>group</b></p><blockquote><p><b>id</b></p>group-1</blockquote><blockquote><p><b>population</b></p><blockquote><p><b>id</b></p>initial-population</blockquote><p><b>code</b>: Initial Population <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-population.html">MeasurePopulationType</a>#initial-population)</span></p><h3>Criteria</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style="display: none">*</td><td>text/cql-identifier</td><td>Initial Population</td></tr></table></blockquote><blockquote><p><b>population</b></p><blockquote><p><b>id</b></p>denominator</blockquote><p><b>code</b>: Denominator <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-population.html">MeasurePopulationType</a>#denominator)</span></p><h3>Criteria</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style="display: none">*</td><td>text/cql-identifier</td><td>Denominator</td></tr></table></blockquote><blockquote><p><b>population</b></p><blockquote><p><b>id</b></p>numerator</blockquote><p><b>code</b>: Numerator <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-measure-population.html">MeasurePopulationType</a>#numerator)</span></p><h3>Criteria</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style="display: none">*</td><td>text/cql-identifier</td><td>Numerator</td></tr></table></blockquote><blockquote><p><b>stratifier</b></p><blockquote><p><b>id</b></p>by-age</blockquote><p><b>code</b>: Age <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> ()</span></p><h3>Criteria</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style="display: none">*</td><td>text/cql-identifier</td><td>Age Stratifier</td></tr></table></blockquote><blockquote><p><b>stratifier</b></p><blockquote><p><b>id</b></p>by-education-level</blockquote><p><b>code</b>: Education Level <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> ()</span></p><h3>Criteria</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style="display: none">*</td><td>text/cql-identifier</td><td>Education Level Stratifier</td></tr></table></blockquote></blockquote></div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://example.org/CodeSystem/iso-8601-derived-periods"/>
          <code value="P10Y--P14Y"/>
          <display value="10-14 years"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://example.org/CodeSystem/iso-8601-derived-periods"/>
          <code value="P15Y--P19Y"/>
          <display value="15-19 years"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://example.org/CodeSystem/iso-8601-derived-periods"/>
          <code value="P20Y--P9999Y"/>
          <display value="20+ years"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCBaseDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="Antenatal care contact"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Antenatal care contact&quot;:
  [&quot;Encounter&quot;: type in BCx.&quot;Antenatal care contact&quot;]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="First antenatal care contact"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;First antenatal care contact&quot;:
  BaseData.&quot;Antenatal care contact&quot; C
    where C.reasonCode in Cx.&quot;First Antenatal Care Contact Choices&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCContactDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="Gestational age"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
  @dataElement: ANC.B6.DE17 Gestational age
  @activity: ANC.B6 Profile
  @description: Gestational age in weeks and/or days depending on the source of gestational age
*/
define &quot;Gestational age&quot;:
  WC.MostRecent(
  [Observation: Cx.&quot;Gestational age&quot;] O
    where O.status in { 'final', 'amended', 'corrected' }
      and Coalesce(WC.ModifierExtension(O, 'who-notDone').value, false) is false
      and Last(Split(O.encounter.reference, '/')) = Last(Split(encounter, '/'))
  ).value as FHIR.Quantity"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
Numerator: Number of pregnant women who had their first ANC contact before 12 weeks (facility level)
Numerator Computation: Count of women whose gestational age &lt;= 12 weeks at the time of first contact
*/
define Numerator:
  exists (
    &quot;First antenatal care contact&quot; C
      where C.period starts during &quot;Measurement Period&quot;
        and ContactData.&quot;Gestational age&quot; &lt;= 12 weeks
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCStratifiers"/>
        </extension>
        <extension url="name">
          <valueString value="By Age"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
By Patient Age as of the start of the Measurement Period
Age (10-14, 15-19, 20+)
*/
define &quot;By Age&quot;:
  case
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[10, 14] then &quot;P10Y--P14Y&quot;
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) in Interval[15, 19] then &quot;P15Y--P19Y&quot;
    when AgeInYearsAt(start of &quot;Measurement Period&quot;) &gt;= 20 then &quot;P20Y--P9999Y&quot;
    else null
  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="Age Stratifier"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
Disaggregation: Age (10-14, 15-19, 20+)
*/
define &quot;Age Stratifier&quot;:
  Stratifiers.&quot;By Age&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
Denominator: Total number of antenatal clients with a first contact
Denominator Computation: Count of all women who had first contact within the last reporting period
*/
define Denominator:
  exists (
    &quot;First antenatal care contact&quot; C
      where C.period starts during &quot;Measurement Period&quot;
  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCStratifiers"/>
        </extension>
        <extension url="name">
          <valueString value="By Education Level"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
By Patient Education Level (none, don't know, primary, secondary, higher)
*/
define &quot;By Education Level&quot;:
  Patient.extension E
    where E.url = 'http://fhir.org/guides/who/anc-cds/StructureDefinition/educationlevel'
    return E.value as CodeableConcept"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="Education Level Stratifier"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
Disaggregation: Education Level (none, don't know, primary, secondary, higher)
*/
define &quot;Education Level Stratifier&quot;:
  Stratifiers.&quot;By Education Level&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCBaseDataElements"/>
        </extension>
        <extension url="name">
          <valueString value="Antenatal care case"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
define &quot;Pregnant&quot;:
  &quot;Pregnancy&quot; is not null
    or &quot;Pregnancy status&quot; in BCx.&quot;Pregnancy status - pregnant&quot;

define &quot;Pregnancy status&quot;:
  FHIRHelpers.ToConcept(
    Last(
      [Observation: BCx.&quot;Pregnancy status&quot;] O
        where O.status = 'final'
        sort by FHIRHelpers.ToDateTime(effective as FHIR.dateTime)
    ).value
  )
*/
define &quot;Antenatal care case&quot;:
  [&quot;EpisodeOfCare&quot;: type in BCx.&quot;Antenatal care case&quot;]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="ANCIND01"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
Initial population: Antenatal clients
*/
define &quot;Initial Population&quot;:
  exists (BaseData.&quot;Antenatal care case&quot;)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library ANCCohort"/>
        <resource value="http://hl7.org/fhir/uv/crmi/Library/ANCCohort"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Example Code system ISO-8601-Derived Periods"/>
        <resource
                  value="http://example.org/CodeSystem/iso-8601-derived-periods"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Antenatal care contact"/>
        <resource
                  value="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set First Antenatal Care Contact Choices"/>
        <resource
                  value="http://fhir.org/guides/who/anc-cds/ValueSet/anc-b5-de2"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Gestational age"/>
        <resource
                  value="http://fhir.org/guides/who/anc-cds/ValueSet/anc-b6-de17"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Antenatal care case"/>
        <resource
                  value="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-case"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="encounter"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Age Stratifier"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Coding"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Education Level Stratifier"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="CodeableConcept"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <dataRequirement>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/cqf-isSelective">
          <valueBoolean value="true"/>
        </extension>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <extension
                   url="http://hl7.org/fhir/StructureDefinition/cqf-isSelective">
          <valueBoolean value="true"/>
        </extension>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="encounter"/>
        <mustSupport value="encounter.reference"/>
        <codeFilter>
          <path value="code"/>
          <valueSet
                    value="http://fhir.org/guides/who/anc-cds/ValueSet/anc-b6-de17"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
        <mustSupport value="url"/>
        <mustSupport value="value"/>
      </dataRequirement>
      <dataRequirement>
        <type value="EpisodeOfCare"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"/>
        <mustSupport value="type"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-case"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements" id="effective-data-requirements">
    <valueReference>
      <reference value="#effective-data-requirements"/>
    </valueReference>
  </extension>
  <url value="http://hl7.org/fhir/uv/crmi/Measure/publishable-example"/>
  <version value="1.0.0-ballot"/>
  <name value="ANCIND01"/>
  <title
         value="ANC.IND.01 Percentage of pregnant women with first ANC contact in the first trimester"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2023-03-13T22:32:10-06:00"/>
  <publisher value="Clinical Decision Support WG"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/dss"/>
    </telecom>
  </contact>
  <description
               value="Percentage of pregnant women with first ANC contact in the first trimester (before 12 weeks of gestation)"/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
      <display value="World"/>
    </coding>
  </jurisdiction>
  <relatedArtifact>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-isPrimaryCitation">
      <valueBoolean value="true"/>
    </extension>
    <type value="citation"/>
    <citation
              value="WHO, UN Women, UNFPA. Health care for women subjected to intimate partner violence or sexual violence – a clinical handbook. Geneva: World Health Organization; 2014"/>
    <url
         value="https://apps.who.int/iris/bitstream/handle/10665/136101/WHO_RHR_14.26_eng.pdf"/>
    <document>
      <url
           value="https://apps.who.int/iris/bitstream/handle/10665/136101/WHO_RHR_14.26_eng.pdf"/>
    </document>
  </relatedArtifact>
  <library value="http://hl7.org/fhir/uv/crmi/Library/ANCCohort"/>
  <scoring>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
      <code value="proportion"/>
    </coding>
  </scoring>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
      <code value="process"/>
    </coding>
  </type>
  <improvementNotation>
    <coding>
      <system
              value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
      <code value="increase"/>
    </coding>
  </improvementNotation>
  <group id="group-1">
    <population id="initial-population">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="denominator">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="numerator">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
    <stratifier id="by-age">
      <code>
        <text value="Age"/>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Age Stratifier"/>
      </criteria>
    </stratifier>
    <stratifier id="by-education-level">
      <code>
        <text value="Education Level"/>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Education Level Stratifier"/>
      </criteria>
    </stratifier>
  </group>
</Measure>