<?xml version="1.0" encoding="UTF-8"?>

<Library xmlns="http://hl7.org/fhir">
  <id value="SupplementalDataElements"/>
  <text>
    <status value="extensions"/><div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>

<tr>


<th scope="row" class="row-header">Title</th>



<td class="content-container">Supplemental Data Elements</td>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">2026.1.0</td>


</tr>
















<tr>


<th scope="row" class="row-header">Topic</th>



<td class="content-container">FHIR
</td>


</tr>

<tr>


<th scope="row" class="row-header">Topic</th>



<td class="content-container">CQL
</td>


</tr>













<tr>


<th scope="row" class="row-header">Description</th>



<td class="content-container"><div><p>SupplementalDataElements logic.</p>
</div></td>


</tr>






<tr>


<th scope="row" class="row-header">Type</th>



<td class="content-container">
    logic-library from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</a> 


</td>


</tr>




  <tr>


<th colspan="2" scope="row" class="row-header">Library Content</th>


</tr>
  
    
    <tr>
      <th scope="row" class="row-header">CQL Content</th>
      <td>
        <a name="cql-content"> </a>
        <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Supplemental data elements for use in digital quality measure specifications in CMS programs

NOTE: This library is not published in this IG, it is included here for convenience. The source of truth for
this library will be the MADiE environment once it fully supports use of QICore STU6-derived.
*/
library SupplementalDataElements version '6.1.000'

using USQualityCore version '0.5.0'
using USCore version '6.1.0-derived'
using FHIR version '4.0.1'

include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers
include hl7.fhir.uv.cql.FHIRCommon version '2.0.0' called FHIRCommon
include hl7.fhir.us.cql.USCoreCommon version '2.0.0-ballot' called USCommon

codesystem &quot;SNOMEDCT&quot;: 'http://snomed.info/sct'

valueset &quot;Ethnicity&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'
valueset &quot;Federal Administrative Sex&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.121'
valueset &quot;Payer Type&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'
valueset &quot;Race&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'

code &quot;Male (finding)&quot;: '248153007' from &quot;SNOMEDCT&quot; display 'Male (finding)'
code &quot;Female (finding)&quot;: '248152002' from &quot;SNOMEDCT&quot; display 'Female (finding)'

context Patient

define &quot;SDE Ethnicity&quot;:
  (Patient.ethnicity()) E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }

define &quot;SDE Payer&quot;:
  [USQualityCore.Coverage: type in &quot;Payer Type&quot;] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }

define &quot;SDE Race&quot;:
  (Patient.race()) R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }

define &quot;SDE Sex&quot;:
  case
    when Patient.sex() = '248153007' then &quot;Male (finding)&quot;
    when Patient.sex() = '248152002' then &quot;Female (finding)&quot;
    else null
  end</code></pre>
      </td>
    </tr>
    
    
    
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.0 of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="1"/>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="cds"/>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="informative"/>
  </extension>
  <url value="https://madie.cms.gov/Library/SupplementalDataElements"/>
  <version value="2026.1.0"/>
  <name value="SupplementalDataElements"/>
  <title value="Supplemental Data Elements"/>
  <status value="active"/>
  <experimental value="false"/>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
      <code value="logic-library"/>
    </coding>
  </type>
  <date value="2026-06-16T17:19:32+00:00"/>
  <description value="SupplementalDataElements logic."/>
  <topic>
    <text value="FHIR"/>
  </topic>
  <topic>
    <text value="CQL"/>
  </topic>
  <content>
    <contentType value="text/cql"/>
    <data value="LyoKQGRlc2NyaXB0aW9uOiBTdXBwbGVtZW50YWwgZGF0YSBlbGVtZW50cyBmb3IgdXNlIGluIGRpZ2l0YWwgcXVhbGl0eSBtZWFzdXJlIHNwZWNpZmljYXRpb25zIGluIENNUyBwcm9ncmFtcwoKTk9URTogVGhpcyBsaWJyYXJ5IGlzIG5vdCBwdWJsaXNoZWQgaW4gdGhpcyBJRywgaXQgaXMgaW5jbHVkZWQgaGVyZSBmb3IgY29udmVuaWVuY2UuIFRoZSBzb3VyY2Ugb2YgdHJ1dGggZm9yCnRoaXMgbGlicmFyeSB3aWxsIGJlIHRoZSBNQURpRSBlbnZpcm9ubWVudCBvbmNlIGl0IGZ1bGx5IHN1cHBvcnRzIHVzZSBvZiBRSUNvcmUgU1RVNi1kZXJpdmVkLgoqLwpsaWJyYXJ5IFN1cHBsZW1lbnRhbERhdGFFbGVtZW50cyB2ZXJzaW9uICc2LjEuMDAwJwoKdXNpbmcgVVNRdWFsaXR5Q29yZSB2ZXJzaW9uICcwLjUuMCcKdXNpbmcgVVNDb3JlIHZlcnNpb24gJzYuMS4wLWRlcml2ZWQnCnVzaW5nIEZISVIgdmVyc2lvbiAnNC4wLjEnCgppbmNsdWRlIGhsNy5maGlyLnV2LmNxbC5GSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMScgY2FsbGVkIEZISVJIZWxwZXJzCmluY2x1ZGUgaGw3LmZoaXIudXYuY3FsLkZISVJDb21tb24gdmVyc2lvbiAnMi4wLjAnIGNhbGxlZCBGSElSQ29tbW9uCmluY2x1ZGUgaGw3LmZoaXIudXMuY3FsLlVTQ29yZUNvbW1vbiB2ZXJzaW9uICcyLjAuMC1iYWxsb3QnIGNhbGxlZ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