Metadata
Title | Treatment Prescribed for Acute Migraine Attacks
Version | Draft based on 0.1.000
Short Name | CMS1234TreatmentForAcuteMigraine
GUID (Version Independent) | urn:uuid:838e367b-1633-4f03-9746-7f78dd3f68a3
GUID (Version Specific) | urn:uuid:26bb2e8e-d539-480b-8522-8a20e12ea7b6
Effective Period | 2026-01-01 through 2026-12-31
Status | draft
Steward (Publisher) | American Academy of Neurology
Developer | Lantana Consulting Group
Description | Percentage of patients age 6 years and older with a diagnosis of migraine who were prescribed a guideline recommended or Food and Drug Administration (FDA) approved/cleared treatment for acute migraine attacks during the measurement period.
Purpose | Only 29% of patients are satisfied with their acute migraine treatment. Among people with episodic migraine, 18.31% reported current use of triptans for acute headache treatment. Triptan use increased with headache frequency, headache-related disability and allodynia, but decreased among people with depression. Less than 1 in 5 people with migraine in the US who were respondents to this survey used triptans for acute headache treatment over the course of a year. In a population sample of individuals with episodic migraine, more than 40% have at least one unmet need in the area of acute treatment. The leading reasons for unmet needs, which include headache-related disability and dissatisfaction with current acute treatment, suggest opportunities for improving outcomes for people with episodic migraine (EM). In an analysis of data from the 2005 American Migraine Prevalence and Prevention (AMPP) study, authors reported that 91.7% of respondents meeting criteria for EM used acute treatment for their headaches. Of these respondents, only 36.1% used migraine-specific medications. Triptans were used by 18.3% of the sample, opioids were used by 11.7% of the sample, and barbiturate medications were used by 6.1% of the sample. According to another study, 21.87% of patients use triptans for acute treatment of migraine, 20% use ergots, 20.87% use opioids, and 13.52% use barbiturates. Using the guideline recommended first-line acute treatments would provide superior pain relief for migraine. Triptans and ergots are considered first-line acute treatments for migraine according to the latest American Headache Society guideline (2015). The leading reasons for unmet needs, which include headache related disability and dissatisfaction with current acute treatment, suggest opportunities for improving outcomes for people with EM.
Copyright | Copyright: (C)2023 American Academy of Neurology Institute (AANI). All rights reserved.
Disclaimer | Quality Measures published by the American Academy of Neurology and its affiliates are assessments of current scientific and clinical information provided as an educational service. The information: 1) should not be considered inclusive of all proper treatments, methods of care, or as a statement of the standard of care; 2) is not continually updated and may not reflect the most recent evidence (new evidence may emerge between the time information is developed and when it is published or read); 3) addresses only the question(s) or topic(s) specifically identified; 4) does not mandate any particular course of medical care; and 5) is not intended to substitute for the independent professional judgment of the treating provider, as the information does not account for individual variation among patients. In all cases, the selected course of action should be considered by the treating provider in the context of treating the individual patient. Use of the information is voluntary. AAN provides this information on an “as is” basis, and makes no warranty, expressed or implied, regarding the information. AAN specifically disclaims any warranties of merchantability or fitness for a particular use or purpose. AAN assumes no responsibility for any injury or damage to persons or property arising out of or related to any use of this information or for any errors or omissions. Limited proprietary coding is contained in the measure specifications for convenience. Users of the proprietary coding sets should obtain all necessary licenses from the owners of these code sets. The AAN and its members disclaim all liability for use or accuracy of any Current Procedural Terminology (CPT®) or other coding contained in the specifications. ICD10 copyright 2022 International Health Terminology Standards Development Organization CPT(R) contained in the Measure specifications is copyright 2004-2022 American Medical Association. LOINC(R) is copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 is copyright 2022 World Health Organization. All Rights Reserved.
Rationale | By providing appropriate guideline recommended treatments, it is anticipated that headache severity and duration of headache would be reduced for patients that have acute attacks.
Clinical Recommendation Statement | AANI, please provide.
Citation | Bigal ME, Buse DC, Hen YT, et al. Rates and predictors of starting a triptan: results from the American Migraine Prevalence and Prevention Study. Headache 2010; 50:1440-8
Citation | Bigal, M. E., Buse, D. C., Hen, Y. T., et al. (2010). Rates and predictors of starting a triptan: Results from the American Migraine Prevalence and Prevention Study. Headache: The Journal of Head and Face Pain, 50(9), 1440–1448 https://doi.org/10.1111/j.1526-4610.2010.01726.
Citation | Lipton, R. B., & Stewart, W. F. (1999). Acute migraine therapy: Do doctors understand what patients with migraine want from therapy? Headache: The Journal of Head and Face Pain, 39(Suppl. 2), S20–S26. https://doi.org/10.1111/j.1526-4610.1999.390720
Citation | Lipton, R. B., Buse, D. C., Serrano, D., et al. (2009). Acute medication use patterns in episodic migraine: Results of the American Migraine Prevalence and Prevention (AMPP) study. Cephalalgia, 29(Suppl. 1), 17. Presented at the 14th Congress of the International Headache Society, September 10–13, 2009.
Citation | Lipton, R. B., Buse, D. C., Serrano, D., et al. (2013). Examination of unmet treatment needs among persons with episodic migraine: Results of the American Migraine Prevalence and Prevention (AMPP) Study. Headache: The Journal of Head and Face Pain, 53(8), 1300–1311. https://doi.org/10.1111/head.12154
Citation | Marmura, M. J., Silberstein, S. D., & Schwedt, T. J. (2015). The acute treatment of migraine in adults: The American Headache Society evidence assessment of migraine pharmacotherapies. Headache: The Journal of Head and Face Pain, 55(1), 3–20. https://doi.org/10.1111/head.12499
Definition | Definition: Guideline recommended or FDA approved/cleared acute migraine medications: include the following but are not limited to: triptans, dihydroergotamine (DHE), NSAIDs, D2 antagonists and may include neuromodulation.
Guidance (Usage) | Acute treatment prescribed for migraine – Acute treatments include, but are not limited to: triptans, dihydroergotamine, Nonsteroidal Anti-inflammatory Drugs (NSAIDs), D2 antagonists. Guideline recommended or FDA approved/cleared acute migraine attack treatment may include neuromodulation. A patient and/or caregiver reserve the right to decline a prescription. Some patients may have contraindications to all medications or medications are ineffective. Patients may already be on an effective over the counter medication or have an acute migraine treatment prescribed by another clinician. Patients with a history of acute migraine medication overuse or no pain with migraine may require a different treatment approach. Clinicians should use their best judgment to prescribe a treatment for acute migraine attacks to meet the specific needs of the individual patient. Note: The list of acute migraine medications/treatments are based on clinical guidelines and other evidence and may not be all-inclusive or current. Physicians and other health care professionals should refer to the Food and Drug Administration’s (FDA) web site page entitled “Drug Safety Communications” for up-to-date drug recall and alert information when prescribing medications. Emergency department and urgent care visits on date of presentation are not included.
Measure Group (Rate) (ID: Group_1)
Basis | boolean
Scoring | [http://terminology.hl7.org/CodeSystem/measure-scoring#proportion: 'Proportion']
Type | [http://terminology.hl7.org/CodeSystem/measure-type#process: 'Process']
Improvement Notation | [http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']
Initial Population | ID: InitialPopulation_1 Description: patients age 6 years or older with a diagnosis of migraine and who have an office visit, telephone consultation, or outpatient consultation during the measurement period. Logic Definition: Initial Population
Denominator | ID: Denominator_1 Description: Initial Population Logic Definition: Denominator
Numerator | ID: Numerator_1 Description: Patients who were prescribed a guideline recommended or FDA approved/cleared treatment* for acute migraine attacks once during the measurement period. Logic Definition: Numerator
Denominator Exception | ID: DenominatorException_1 Description: Migraine Medication Not Ordered Due To Patient Or Medical Reasons or Patient Has An Allergy Or Adverse Event To Migraine Treatment or Patient Has a History of Migraine Treatment Overuse or Patient Reports Acute Migraine without Pain Logic Definition: Denominator Exceptions
Supplemental Data Guidance | For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Supplemental Data Elements
Supplemental Data Element | ID: sde-ethnicity Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Ethnicity Logic Definition: SDE Ethnicity
Supplemental Data Element | ID: sde-payer Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Payer Logic Definition: SDE Payer
Supplemental Data Element | ID: sde-race Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Race Logic Definition: SDE Race
Supplemental Data Element | ID: sde-sex Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: SDE Sex Logic Definition: SDE Sex
Measure Logic
Primary Library | https://madie.cms.gov/Library/TreatmentForAcuteMigraineAttacks
Contents | Population Criteria Logic Definitions Terminology Dependencies Data Requirements
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
    define "Initial Population":
      exists ( "Acute Migraine Encounter During Measurement Period For Ages 6 And Older" )
Denominator
    define "Denominator":
      "Initial Population"
Numerator
    define "Numerator":
      exists ( "FDA Approved Medication Or Neuromodulation During Measurement Period" )
Denominator Exception
    define "Denominator Exceptions":
      "Has Migraine Medication Not Ordered Due To Patient Or Medical Reasons"
        or "Has Allergy Or Adverse Event To Migraine Treatment"
        or "Has Migraine Treatment Overuse"
        or "Has Acute Migraine Without Pain"
        or "Has No Neuromodulation Device Due To Patient Or Medical Reason"
Logic Definitions
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Sex":
      case
        when Patient.sex = '248153007' then "Male (finding)"
        when Patient.sex = '248152002' then "Female (finding)"
        else null
      end
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Payer":
      [Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Ethnicity":
      Patient.ethnicity E
        return Tuple {
          codes: { E.ombCategory } union E.detailed,
          display: E.text
        }
Logic Definition | Library Name: SupplementalDataElements
    define "SDE Race":
      Patient.race R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "SDE Sex":
      SDE."SDE Sex"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "FDA Approved Medication":
      [MedicationRequest: "Prescribable NSAIDs and Acute Migraine Attack Medication"] FDAApprovedTX
        where FDAApprovedTX.authoredOn during "Measurement Period"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Neuromodulation Device":
      ( [DeviceRequest: "Neuromodulation for migraine"] NeuroDeviceOrder
          where NeuroDeviceOrder.authoredOn during day of "Measurement Period"
            and NeuroDeviceOrder.intent ~ 'order'
            and NeuroDeviceOrder.status in { 'active', 'completed' }
            and not exists ( ["TaskRejected"] TaskReject
                where TaskReject.focus.references ( NeuroDeviceOrder )
                  and TaskReject.code ~ QICoreCommon."Fulfill"
            )
      )
        union ( [Procedure: "Neuromodulation for migraine"] ProcedurePerformed
            where ProcedurePerformed.performed.toInterval ( ) during day of "Measurement Period"
              and ProcedurePerformed.status ~ 'completed'
        )
        union ( [DeviceUseStatement] DeviceInUse
          where DeviceInUse.recordedOn during day of "Measurement Period"
            and DeviceInUse.status ~ 'active' ) DeviceUse
          where exists ( [Device: "Neuromodulation for migraine"] )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    //Numerator

    define "FDA Approved Medication Or Neuromodulation During Measurement Period":
      ( "FDA Approved Medication"
          union "Neuromodulation Device"
      )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Numerator":
      exists ( "FDA Approved Medication Or Neuromodulation During Measurement Period" )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Acute Migraine Encounter During Measurement Period For Ages 6 And Older":
      ( [Encounter: "Office Visit"]
        union [Encounter: "Online Evaluation and Management Encounters"]
        union [Encounter: "Telephone Visits All"] ) MigraineEncounter
        where ( MigraineEncounter.reasonCode in "Migraine Diagnosis (ICD)"
            or MigraineEncounter.encounterDiagnosis ( ).code in "Migraine Diagnosis (ICD)"
        )
          and AgeInYearsAt(date from start of MigraineEncounter.period) >= 6
          and MigraineEncounter.period during "Measurement Period"
          and not exists ( [Encounter: "Emergency Department Visit"] EDVisit
              where EDVisit.period during day of MigraineEncounter.period
          )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Initial Population":
      exists ( "Acute Migraine Encounter During Measurement Period For Ages 6 And Older" )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Denominator":
      "Initial Population"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "SDE Payer":
      SDE."SDE Payer"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "SDE Race":
      SDE."SDE Race"
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    //Exceptions

    define "Has Migraine Medication Not Ordered Due To Patient Or Medical Reasons":
      exists ( [MedicationNotRequested: "Prescribable NSAIDs and Acute Migraine Attack Medication"] FDAApprovedTX
          where FDAApprovedTX.reasonCode in "Medical Reason"
            or FDAApprovedTX.reasonCode in "Patient Refusal of Medication (SNOMED)"
              and FDAApprovedTX.status = 'completed'
              and FDAApprovedTX.doNotPerform is true
      )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Has Allergy Or Adverse Event To Migraine Treatment":
      exists ( [AllergyIntolerance: "Prescribable NSAIDs and Acute Migraine Attack Medication"] AllergyToTx
          with "Acute Migraine Encounter During Measurement Period For Ages 6 And Older" ValidEncounter
            such that AllergyToTx.clinicalStatus is null
              or ( AllergyToTx.clinicalStatus ~ QICoreCommon."allergy-active"
                  and AllergyToTx.onset before end of "Measurement Period"
              )
      )
        or exists ( [AdverseEvent: "Prescribable NSAIDs and Acute Migraine Attack Medication"] AdverseEventToTX
            where AdverseEventToTX.recordedDate before end of "Measurement Period"
              and AdverseEventToTX.actuality ~ 'actual'
        )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Has Migraine Treatment Overuse":
      exists ( [ConditionProblemsHealthConcerns: "Acute migraine medication overuse"] Overuse
          where Overuse.prevalenceInterval ( ) starts during "Measurement Period"
      )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Has Acute Migraine Without Pain":
      exists ( ( [ConditionProblemsHealthConcerns: "Acute migraine (disorder)"] AcuteMigraine
            where not exists [ConditionProblemsHealthConcerns: "Pain (finding)"] Pain
              and AcuteMigraine.prevalenceInterval ( ) starts during "Measurement Period"
        )
          union ( [ConditionProblemsHealthConcerns: "Migraine aura without headache (disorder)"] NoHA
              where NoHA.prevalenceInterval ( ) starts during "Measurement Period"
          )
      )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Has No Neuromodulation Device Due To Patient Or Medical Reason":
      exists ( [DeviceNotRequested: "Neuromodulation for migraine"] DeviceNotRequested
          where DeviceNotRequested.authoredOn during day of "Measurement Period"
            and DeviceNotRequested.doNotPerformReason in "Medical Reason For Not Providing Treatment"
            and DeviceNotRequested.status ~ 'completed'
      )
        or exists ( [ProcedureNotDone: "Neuromodulation for migraine"] NoProcedure
            where NoProcedure.recorded during day of "Measurement Period"
              or NoProcedure.statusReason in "Medical Reason For Not Providing Treatment"
                and NoProcedure.status ~ 'not-done'
        )
        or exists ( from
            ( [DeviceRequest: "Neuromodulation for migraine"] ) DeviceOrderReject,
            [TaskRejected] T
            where DeviceOrderReject.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
              and DeviceOrderReject.status = 'active'
              and T.focus.references ( DeviceOrderReject )
              and T.code ~ QICoreCommon."Fulfill"
              and DeviceOrderReject.authoredOn during day of "Measurement Period"
              and ( T.statusReason in "Medical Reason For Not Providing Treatment"
                  or T.statusReason in "Patient Refusal"
              )
            return {
              id: DeviceOrderReject.id,
              requestStatusReason: T.statusReason,
              authoredOn: DeviceOrderReject.authoredOn
            }
        )
Logic Definition | Library Name: TreatmentForAcuteMigraineAttacks
    define "Denominator Exceptions":
      "Has Migraine Medication Not Ordered Due To Patient Or Medical Reasons"
        or "Has Allergy Or Adverse Event To Migraine Treatment"
        or "Has Migraine Treatment Overuse"
        or "Has Acute Migraine Without Pain"
        or "Has No Neuromodulation Device Due To Patient Or Medical Reason"
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Condition resources referenced by the diagnosis element of the Encounter
    */
    define fluent function encounterDiagnosis(Encounter Encounter ):
      Encounter.reasonReference D
        return singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where D.references(C.id))
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value uri): value.value
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
    */
    define function ToConcept(concept FHIR.CodeableConcept):
        if concept is null then
            null
        else
            System.Concept {
                codes: concept.coding C return ToCode(C),
                display: concept.text.value
            }
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
    */
    define function ToCode(coding FHIR.Coding):
        if coding is null then
            null
        else
            System.Code {
              code: coding.code.value,
              system: coding.system.value,
              version: coding.version.value,
              display: coding.display.value
            }
Logic Definition | Library Name: FHIRHelpers
    /*
    @description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
    value to a CQL DateTime Interval
    @comment: If the start value of the given period is unspecified, the starting
    boundary of the resulting interval will be open (meaning the start of the interval
    is unknown, as opposed to interpreted as the beginning of time).
    */
    define function ToInterval(period FHIR.Period):
        if period is null then
            null
        else
            if period."start" is null then
                Interval(period."start".value, period."end".value]
            else
                Interval[period."start".value, period."end".value]
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if the given reference is to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference Reference, resource Resource):
      resource.id = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
    @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types
    to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
    representations for timing-valued elements in QICore, allowing this function to be used across any resource.
    The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>.
    The intent of this function is to provide a clear and concise mechanism to treat single
    elements that have multiple possible representations as intervals so that logic doesn't have to account
    for the variability. More complex calculations (such as medication request period or dispense period
    calculation) need specific guidance and consideration. That guidance may make use of this function, but
    the focus of this function is on single element calculations where the semantics are unambiguous.
    If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime.
    If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age,
    and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later.
    If the input is a DateTime Interval, the result is the input.
    If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result
    is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending
    immediately before one year later than the date the patient turned the age given as the end of the quantity interval.
    If the input is a Timing, an error will be thrown indicating that Timing calculations are not implemented. Any other input will reslt in a null DateTime Interval
    */
    define fluent function toInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>, Timing>):
      case
    	  when choice is DateTime then
        	Interval[choice as DateTime, choice as DateTime]
    		when choice is Interval<DateTime> then
      		choice as Interval<DateTime>
    		when choice is Quantity then
    		  Interval[Patient.birthDate + (choice as Quantity),
    			  Patient.birthDate + (choice as Quantity) + 1 year)
    		when choice is Interval<Quantity> then
    		  Interval[Patient.birthDate + (choice.low as Quantity),
    			  Patient.birthDate + (choice.high as Quantity) + 1 year)
    		when choice is Timing then
          Message(null, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported') as Interval<DateTime>
    		else
    			null as Interval<DateTime>
    	end
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns true if the given reference is to the given resourceId
    @comment: Returns true if the `resourceId` parameter exactly equals the tail of the given reference.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(reference Reference, resourceId String):
      resourceId = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns an interval representing the normalized prevalence period of a given Condition.
    @comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from
    onset to abatement as specified in the given Condition. If the condition is active, or has an abatement date the resulting
    interval will have a closed ending boundary. Otherwise, the resulting interval will have an open ending boundary.
    */
    define fluent function prevalenceInterval(condition Choice<"ConditionEncounterDiagnosis", "ConditionProblemsHealthConcerns">):
    if condition.clinicalStatus ~ "active"
      or condition.clinicalStatus ~ "recurrence"
      or condition.clinicalStatus ~ "relapse" then
      Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
    else
        (end of condition.abatementInterval()) abatementDate
        return if abatementDate is null then
          Interval[start of condition.onset.toInterval(), abatementDate)
        else
          Interval[start of condition.onset.toInterval(), abatementDate]
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Returns an interval representing the normalized abatement of a given Condition.
    @comment: If the abatement element of the Condition is represented as a DateTime, the result
    is an interval beginning and ending on that DateTime.
    If the abatement is represented as a Quantity, the quantity is expected to be a calendar-duration and is interpreted as the age of the patient. The
    result is an interval from the date the patient turned that age to immediately before one year later.
    If the abatement is represented as a Quantity Interval, the quantities are expected to be calendar-durations and are interpreted as an age range during
    which the abatement occurred. The result is an interval from the date the patient turned the starting age of the quantity interval, and ending immediately
    before one year later than the date the patient turned the ending age of the quantity interval.
    */
    define fluent function abatementInterval(condition Choice<"ConditionEncounterDiagnosis", "ConditionProblemsHealthConcerns">):
    	if condition.abatement is DateTime then
    	  Interval[condition.abatement as DateTime, condition.abatement as DateTime]
    	else if condition.abatement is Quantity then
    		Interval[Patient.birthDate + (condition.abatement as Quantity),
    			Patient.birthDate + (condition.abatement as Quantity) + 1 year)
    	else if condition.abatement is Interval<Quantity> then
    	  Interval[Patient.birthDate + (condition.abatement.low as Quantity),
    		  Patient.birthDate + (condition.abatement.high as Quantity) + 1 year)
    	else if condition.abatement is Interval<DateTime> then
    	  Interval[condition.abatement.low, condition.abatement.high)
    	else null as Interval<DateTime>
Terminology
Code System | Description: Code system SNOMEDCT Resource: http://snomed.info/sct Canonical URL: `http://snomed.info/sct`
Code System | Description: Code system TaskCodeSystem Resource: http://hl7.org/fhir/CodeSystem/task-code Canonical URL: `http://hl7.org/fhir/CodeSystem/task-code`
Code System | Description: Code system AllergyIntoleranceClinicalStatusCodes Resource: http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical Canonical URL: `http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical`
Code System | Description: Code system ConditionClinicalStatusCodes Resource: http://terminology.hl7.org/CodeSystem/condition-clinical Canonical URL: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Value Set | Description: Value set Prescribable NSAIDs and Acute Migraine Attack Medication Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664`
Value Set | Description: Value set Neuromodulation for migraine Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641`
Value Set | Description: Value set Office Visit Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.11.1005 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.11.1005`
Value Set | Description: Value set Online Evaluation and Management Encounters Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.539 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.539`
Value Set | Description: Value set Telephone Visits All Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1260.161 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1260.161`
Value Set | Description: Value set Migraine Diagnosis (ICD) Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.663 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.663`
Value Set | Description: Value set Emergency Department Visit Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292`
Value Set | Description: Value set Payer Type Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591`
Value Set | Description: Value set Medical Reason Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.313 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.2.313`
Value Set | Description: Value set Patient Refusal of Medication (SNOMED) Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.221 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.221`
Value Set | Description: Value set Acute migraine medication overuse Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.579 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.579`
Value Set | Description: Value set Medical Reason For Not Providing Treatment Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473`
Value Set | Description: Value set Patient Refusal Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.93 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.93`
Direct Reference Code | Display: Male (finding) Code: 248153007 System: `http://snomed.info/sct`
Direct Reference Code | Display: Female (finding) Code: 248152002 System: `http://snomed.info/sct`
Direct Reference Code | Display: Fulfill Code: fulfill System: `http://hl7.org/fhir/CodeSystem/task-code`
Direct Reference Code | Display: Active Code: active System: `http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical`
Direct Reference Code | Display: Active Code: active System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Display: Recurrence Code: recurrence System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Display: Relapse Code: relapse System: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Direct Reference Code | Display: Acute migraine (disorder) Code: 471661000124108 System: `http://snomed.info/sct`
Direct Reference Code | Display: Pain (finding) Code: 22253000 System: `http://snomed.info/sct`
Direct Reference Code | Display: Migraine aura without headache (disorder) Code: 230465000 System: `http://snomed.info/sct`
Dependencies
Dependency | Description: QICore model information Resource: http://hl7.org/fhir/Library/QICore-ModelInfo Canonical URL: `http://hl7.org/fhir/Library/QICore-ModelInfo`
Dependency | Description: Library SDE Resource: https://madie.cms.gov/Library/SupplementalDataElements|5.1.000 Canonical URL: `https://madie.cms.gov/Library/SupplementalDataElements|5.1.000`
Dependency | Description: Library FHIRHelpers Resource: https://madie.cms.gov/Library/FHIRHelpers|4.4.000 Canonical URL: `https://madie.cms.gov/Library/FHIRHelpers|4.4.000`
Dependency | Description: Library QICoreCommon Resource: https://madie.cms.gov/Library/QICoreCommon|4.0.000 Canonical URL: `https://madie.cms.gov/Library/QICoreCommon|4.0.000`
Dependency | Description: Library CQMCommon Resource: https://madie.cms.gov/Library/CQMCommon|4.1.000 Canonical URL: `https://madie.cms.gov/Library/CQMCommon|4.1.000`
Data Requirements
Data Requirement | Type: Patient Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Must Support Elements: extension, birthDate, birthDate.value, url
Data Requirement | Type: MedicationRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest Must Support Elements: medication, authoredOn, authoredOn.value Code Filter(s): Path: medication ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664
Data Requirement | Type: MedicationRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest Must Support Elements: medication.reference.value, authoredOn, authoredOn.value
Data Requirement | Type: Medication Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication Must Support Elements: id.value, code
Data Requirement | Type: Resource Profile(s): http://hl7.org/fhir/StructureDefinition/Resource Must Support Elements: id, id.value
Data Requirement | Type: DeviceRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicerequest Must Support Elements: code, authoredOn, authoredOn.value, intent, intent.value, status, status.value, id, id.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641
Data Requirement | Type: Task Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-taskrejected Must Support Elements: focus, code, statusReason
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, performed, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641
Data Requirement | Type: Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-deviceusestatement Must Support Elements: recordedOn, recordedOn.value, status, status.value
Data Requirement | Type: Device Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device Must Support Elements: type Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns Must Support Elements: code Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.579
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns Must Support Elements: code Code Filter(s): Path: code Code(s): http://snomed.info/sct#471661000124108: 'Acute migraine (disorder)'
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns Must Support Elements: code Code Filter(s): Path: code Code(s): http://snomed.info/sct#22253000: 'Pain (finding)'
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns Must Support Elements: code Code Filter(s): Path: code Code(s): http://snomed.info/sct#230465000: 'Migraine aura without headache (disorder)'
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, reasonCode, period Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.11.1005
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, reasonCode, period Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.539
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, reasonCode, period Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1260.161
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, period, reasonCode Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Data Requirement | Type: Coverage Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage Must Support Elements: type, period Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Data Requirement | Type: MedicationRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationnotrequested Must Support Elements: medication, reasonCode, status, status.value, doNotPerform, doNotPerform.value Code Filter(s): Path: medication ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664
Data Requirement | Type: AllergyIntolerance Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance Must Support Elements: code, clinicalStatus, onset Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664
Data Requirement | Type: AdverseEvent Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-adverseevent Must Support Elements: event, recordedDate, recordedDate.value, actuality, actuality.value Code Filter(s): Path: event ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.664
Data Requirement | Type: DeviceRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicenotrequested Must Support Elements: code, authoredOn, authoredOn.value, extension, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedurenotdone Must Support Elements: code, extension, statusReason, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1034.641
Generated using version 0.4.8 of the sample-content-ig Liquid templates