Metadata
Title | Hospital Harm - Postoperative Venous ThromboembolismFHIR
Version | Draft based on 0.0.020
Short Name | CMS1061FHIR
GUID (Version Independent) | urn:uuid:16a3b273-01e1-4533-bf2b-eae1f912e05f
GUID (Version Specific) | urn:uuid:68fc1823-ea16-4ef9-a8e0-b792269a1f34
CMS Identifier | 1061FHIR
Effective Period | 2026-01-01 through 2026-12-31
Status | draft
Steward (Publisher) | Centers for Medicare & Medicaid Services (CMS)
Developer | American Institutes for Research (AIR)
Description | The proportion of inpatient encounters for patients age 18 and older, who have at least one surgical procedure performed inside the operating room during the encounter, and who suffer the harm of a postoperative venous thromboembolism (VTE) during the encounter or within 30 days after the first surgical procedure.
Copyright | Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. American Institutes for Research, formerly IMPAQ International, disclaims all liability for use or accuracy of any third party codes contained in the specifications. LOINC(R) copyright 2004-2021 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2021 International Health Terminology Standards Development Organisation. ICD-10 copyright 2021 World Health Organization. All Rights Reserved.
Disclaimer | This measure and specifications are subject to further revisions. This performance measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].
Rationale | In-hospital postoperative venous thromboembolism (VTE) encompasses both deep vein thrombosis (DVTs) and pulmonary embolisms (PEs). DVT is associated with poor clinical outcomes, including post-thrombotic syndrome in the leg, anticoagulation-related bleeding, and death (Bysshe et al., 2017). Even though VTE is linked to adverse patient outcomes, there are evidence-based strategies for preventing VTE in hospital settings. During 2019, 2021, and 2022, patients in the United States experienced 51,586 perioperative VTEs (AHRQ, 2024). This volume of detected, preventable safety events illustrates that there are continued opportunities to reduce the rate of postoperative VTEs. In terms of processes of care that clinicians can utilize to prevent these safety events, one study found evidence that combining hospital interventions, such as mechanical and pharmacological prophylaxis, can reduce the incidence of DVT among patients undergoing surgery or admitted with trauma (Kakkos et al., 2022). Another study found that interruptions or delays in the prescription of VTE prophylaxis in surgical patients are associated with a 2- to 3- fold increased risk of VTE (Henke et al., 2020). Furthermore, there are clinical guidelines (noted in the clinical recommendation statement section) to support and improve clinical decision making in the prevention of VTE. As such, hospitals have evidence-based strategies to prevent VTEs in the inpatient setting. These findings suggest that there are opportunities to lower postoperative VTE rates through hospital intervention.
Clinical Recommendation Statement | Current clinical practice guidelines recommend the administration of mechanical and/or pharmacologic prophylaxis along with the implementation of a formal strategy within the hospital as appropriate methods to prevent VTE postoperatively. The American College of Chest Physicians (CHEST) provides the following recommendations as they pertain to general and abdominal-pelvic surgery patients (Gould et al., 2012): 3.6.3. For general and abdominal-pelvic surgery patients at moderate risk for VTE (∼3.0%; Rogers score, > 10; Caprini score, 3-4) who are not at high risk for major bleeding complications, we suggest low-molecular-weight heparin (LMWH) (Grade 2B), low-dose unfractionated heparin (LDUH) (Grade 2B), or mechanical prophylaxis, preferably with IPC (Grade 2C), over no prophylaxis. 3.6.5. For general and abdominal-pelvic surgery patients at high risk for VTE (∼6.0%; Caprini score, ≥ 5) who are not at high risk for major bleeding complications, we recommend pharmacologic prophylaxis with LMWH (Grade 1B) or LDUH (Grade 1B) over no prophylaxis. We suggest that mechanical prophylaxis with elastic stockings (ES) or IPC should be added to pharmacologic prophylaxis (Grade 2C). CHEST provides the following recommendation as it pertains to cardiac surgery patients (Gould et al., 2012): 4.4.2 For cardiac surgery patients whose hospital course is prolonged by one or more no hemorrhagic surgical complications, we suggest adding pharmacologic prophylaxis with LDUH or LMWH to mechanical prophylaxis (Grade 2C). CHEST provides the following recommendation as it pertains to thoracic surgery patients (Gould et al., 2012): 5.4.2 For thoracic surgery patients at high risk for VTE who are not at high risk for perioperative bleeding, we suggest LDUH or LMWH over no prophylaxis (Grade 1C). CHEST provides the following recommendation as it pertains to craniotomy patients (Gould et al., 2012): 6.4.2 For craniotomy patients at very high risk for VTE (e.g., those undergoing craniotomy for malignant disease), we suggest adding pharmacologic prophylaxis to mechanical prophylaxis once adequate hemostasis is established and the risk of bleeding decreases (Grade 2C). CHEST provides the following recommendation as it pertains to spinal surgery patients (Gould et al., 2012): 7.4.2 For patients undergoing spinal surgery at high risk for VTE (including those with malignant disease or those undergoing surgery with a combined anterior-posterior approach), we suggest adding pharmacologic prophylaxis to mechanical prophylaxis once adequate hemostasis is established and the risk of bleeding decreases (Grade 2C). The American Society of Hematology (ASH) provides the following guidelines (Anderson et al., 2019): Recommendation 4. For patients undergoing major surgery who receive pharmacologic prophylaxis, the ASH guideline panel suggests using combined prophylaxis with mechanical and pharmacological methods over prophylaxis with pharmacological agents alone. Recommendation 5. For patients undergoing major surgery, the ASH guideline panel suggests depending on the individual patient and the type of surgical procedure, using combined prophylaxis or mechanical prophylaxis alone. Recommendation 6. For patients undergoing major surgery, the ASH guideline panel suggests against using inferior vena cava (IVC) filters for prophylaxis of VTE. Recommendation 10. In patients undergoing total hip or total knee arthroplasty, conditional recommendations included using either aspirin or anticoagulants, as well as for a direct oral anticoagulant over low-molecular-weight heparin (LMWH).
Citation | Agency for Healthcare Research and Quality. About the National Quality Strategy. https://www.ahrq.gov/workingforquality/about/index.html. Published 2017. Accessed July 23, 2020.
Citation | Agency for Healthcare Research and Quality. National Scorecard on Hospital-Acquired conditions Updated Baseline Rates and Preliminary Results 2014-2017.
Citation | Agency for Healthcare Research and Quality. Patient Safety Indicator 12 (PSI 12) Perioperative Pulmonary Embolism or Deep Vein Thrombosis Rate. 2019. https://www.qualityindicators.ahrq.gov/Downloads/Modules/PSI/V2019/TechSpecs/PSI_12_Perioperative_Pulmonary_Embolism_or_Deep_Vein_Thrombosis_Rate.pdf.
Citation | Anderson DR, Morgano GP, Bennett C, et al. American Society of Hematology 2019 guidelines for management of venous thromboembolism: Prevention of venous thromboembolism in surgical hospitalized patients. Blood Adv. 2019;3(23):3898-3944. doi:10.1182/bloodadvances.2019000975.
Citation | Avorn J, Winkelmayer WC. Comparing the costs, risks, and benefits of competing strategies for the primary prevention of venous thromboembolism. Circulation. 2004;110(Suppl IV):IV 25-IV32. doi:10.1161/01.CIR.0000150642.10916.ea.
Citation | Bysshe T, Yue Gao M, Krysta Heaney-Huls M, et al. Draft Final Report Estimating the Additional Hospital Inpatient Cost and Mortality Associated with Selected Hospital Acquired Conditions.; 2017. www.ahrq.gov.
Citation | Caprini JA. Thrombosis risk assessment as a guide to quality patient care. Disease-a-Month. 2005;51:70-78. doi:10.1016/j.disamonth.2005.02.003.
Citation | Carey K, Stefos T. Measuring the cost of hospital adverse patient safety events. Health Econ. 2011;20:1417-1430. doi:10.1002/hec.1680.
Citation | CDC. Diagnosis and Treatment of Venous Thromboembolism. https://www.cdc.gov/ncbddd/dvt/diagnosis-treatment.html#:~:text=Duplex ultrasonography is an imaging,when a clot breaks up. Published 2020.
Citation | Chandrasekaran S, Ariaretnam SK, Tsung J, Dickison D. Early mobilization after total knee replacement reduces the incidence of deep venous thrombosis. ANZ J Surg. 2009;79:526-529. doi:10.1111/j.1445-2197.2009.04982.x.
Citation | Excellence NI for H and C. Venous Thromboembolism in over 16s: Reducing the Risk of Hospital-Acquired Deep Vein Thrombosis or Pulmonary Embolism.; 2018. https://www.nice.org.uk/guidance/ng89/resources/venous-thromboembolism-in-over-16s-reducing-the-risk-of-hospitalacquired-deep-vein-thrombosis-or-pulmonary-embolism-pdf-1837703092165.
Citation | Falck-Ytter Y, Francis CW, Johanson NA, et al. Prevention of VTE in orthopedic surgery patients. Antithrombotic therapy and prevention of thrombosis, 9th ed: American College of Chest Physicians evidence-based clinical practice guidelines. Chest. 2012;141(2):e278S-e325S. doi:10.1378/chest.11-2404.
Citation | Geerts WH, Bergqvist D, Pineo GF, et al. Prevention of venous thromboembolism: American College of Chest Physicians evidence-based clinical practice guidelines (8th edition). Chest. 2008;133(6):381S-453S. doi:10.1378/chest.08-0656.
Citation | Gidwani R, Bhattacharya J. CMS Reimbursement Reform and the Incidence of Hospital-Acquired Pulmonary Embolism or Deep Vein Thrombosis. J Gen Intern Med. 2015;30(5):588-596. doi:10.1007/s11606-014-3087-3.
Citation | Gould MK, Garcia DA, Wren SM, et al. Prevention of VTE in nonorthopedic surgical patients. Antithrombotic therapy and prevention of thrombosis, 9th ed: American College of Chest Physicians evidence-based clinical practice guidelines. Chest. 2012;141(2):e227S-e277S. doi:10.1378/chest.11-2297.
Citation | Kahn SR, Diendéré G, Morrison DR, et al. Effectiveness of interventions for the implementation of thromboprophylaxis in hospitalised patients at risk of venous thromboembolism: An updated abridged Cochrane systematic review and meta-analysis of randomised controlled trials. BMJ Open. 2019;9:e024444. doi:10.1136/bmjopen-2018-024444.
Citation | Katsoularis I, Fonseca-Rodríguez O, Farrington P, et al. Risks of deep vein thrombosis, pulmonary embolism, and bleeding after covid-19: nationwide self-controlled case series and matched cohort study. BMJ 2022;377:e069590.
Citation | Kearon C, Akl EA, Ornelas J, et al. Antithrombotic Therapy for VTE Disease. Chest. 2016;149(2):315-352. doi:10.1016/j.chest.2015.11.026.
Citation | Konstantinides S V., Meyer G, Bueno H, et al. 2019 ESC Guidelines for the diagnosis and management of acute pulmonary embolism developed in collaboration with the European respiratory society (ERS). Eur Heart J. 2020;41(4):543-603. doi:10.1093/eurheartj/ehz405.
Citation | Lim W, Le Gal G, Bates SM, et al. American Society of Hematology 2018 guidelines for management of venous thromboembolism: Diagnosis of venous thromboembolism. Blood Adv. 2018;2(22):3226-3256. doi:10.1182/bloodadvances.2018024828.
Citation | Mansory EM, Srigunapalan S, Lazo-Langner A. Venous Thromboembolism in Hospitalized Critical and Noncritical COVID-19 Patients: A Systematic Review and Meta-analysis. TH Open 2021;5:e286-94. doi:10.1055/s-0041-1730967.
Citation | Marashi SM. Venous thromboembolism (VTE) harm measurement and risk assessment in real-time using electronic health records (EHR). 2018.
Citation | Maynard G. Preventing Hospital-Associated Venous Thromboembolism: A Guide for Effective Quality Improvement. 2nd ed. Rockville, MD: Agency for Healthcare Research and Quality; 2016. https://www.ahrq.gov/patient-safety/resources/vtguide/appc.html.
Citation | O’Donnell M, Weitz JI. Thromboprophylaxis in surgical patients. Can J Surg. 2003;46(2):129-135.
Citation | Ortel TL, Neumann I, Ageno W, et al. American Society of Hematology 2020 guidelines for management of venous thromboembolism: treatment of deep vein thrombosis and pulmonary embolism. Blood Adv. 2020;4(19):4693-4738. doi:10.1182/bloodadvances.2020001830.
Citation | Pearse EO, Caldwell BF, Lockwood RJ, Hollard J. Early mobilisation after conventional knee replacement may reduce the risk of post-operative venous thromboembolism. J Bone Jt Surg - Ser B. 2007;89-B(3):316-322. doi:10.1302/0301-620X.89B3.18196.
Citation | Rogers SO, Kilaru RK, Hosokawa P, Henderson WG, Zinner MJ, Khuri SF. Multivariable Predictors of Postoperative Venous Thromboembolic Events after General and Vascular Surgery: Results from the Patient Safety in Surgery Study. J Am Coll Surg. 2007;204(6):1211-1221. doi:10.1016/j.jamcollsurg.2007.02.072.
Citation | Sadeghi B, Romano PS, Maynard G, et al. Mechanical and suboptimal pharmacologic prophylaxis and delayed mobilization but not morbid obesity are associated with venous thromboembolism after total knee arthroplasty: A case-control study. J Hosp Med. 2012;7(9):665-671. doi:10.1002/jhm.1962.
Citation | Saving Lives and Saving Money: Hospital-Acquired Conditions Update. Rockville, MD; 2016. https://www.ahrq.gov/hai/pfp/2014-final.html.
Citation | The Joint Commission. VTE-6 Hospital Acquired Potentially-Preventable Venous Thromboembolism.
Citation | White RH, Keenan CR. Effects of race and ethnicity on the incidence of venous thromboembolism. Thromb Res. 2009;123(SUPPL. 4). doi:10.1016/S0049-3848(09)70136-7.
Guidance (Usage) | To calculate the observed hospital-level measure result, divide the total numerator events by the total number of denominator eligible inpatient encounters (denominator-denominator exclusions). To generate the hospital’s risk adjusted rates, CMS uses a regression model to account for sex, age, cancer, catheterization insertion, history of venous thromboembolism (VTE), fractures, and obesity. Please see risk adjustment methodology details available within the Hospital Harm – Postoperative Venous Thromboembolism Risk Adjustment Methodology Report on the eCQM-specific page on the eCQI Resource Center website. Only one harm (numerator event) is counted per qualifying inpatient encounter and within the 30 day evaluation period. This eCQM is an episode-based measure. An episode is defined as each inpatient encounter that ends during the measurement period. This version of the eCQM uses QDM version 5.6. Please refer to the eCQI resource center (https://ecqi.healthit.gov/qdm) for more information on the QDM.
Measure Group (Rate) (ID: Group_1)
Basis | Encounter
Scoring | [http://terminology.hl7.org/CodeSystem/measure-scoring#proportion: 'Proportion']
Type | [http://terminology.hl7.org/CodeSystem/measure-type#outcome: 'Outcome']
Rate Aggregation | None
Improvement Notation | [http://terminology.hl7.org/CodeSystem/measure-improvement-notation#increase: 'Increased score indicates improvement']
Initial Population | ID: InitialPopulation_1 Description: Inpatient encounters for patients age 18 and older where a surgical procedure was performed inside the operating room during the encounter. Logic Definition: Initial Population
Denominator | ID: Denominator_1 Description: Equals Initial Population Logic Definition: Denominator
Denominator Exclusion | ID: DenominatorExclusion_1 Description: Inpatient encounters for - Patients with an obstetric-related diagnosis during the inpatient encounter - Patients with a venous thromboembolism (VTE) diagnosis present on admission - Patients who had extracorporeal membrane oxygenation (ECMO) during the inpatient encounter - Patients with acute brain or spinal injury or hemorrhage present on admission - Patients who had a thrombectomy procedure which occurred before or on the same day as the first surgical procedure during the inpatient encounter - Patients who had intracranial or spinal surgery during the inpatient encounter who were discharged less than 5 days after the end of the surgery - Patients who have a duration of stay less than 2 calendar days Logic Definition: Denominator Exclusion
Numerator | ID: Numerator_1 Description: Inpatient encounters for patients with a postoperative venous thromboembolism (VTE) within 30 days of the first surgical procedure. Evidence of a postoperative VTE is determined by either Criterion A, B or C: Criterion A: A qualifying inpatient encounter, excluding encounters where the first surgical procedure was an intracranial or spinal surgery procedure, with a diagnostic imaging study performed during the qualifying inpatient encounter and within 30 days or less after the end of the first surgical procedure performed and at least one of the following : - An anticoagulation medication order within 24 hours after the end of the diagnostic imaging study during the qualifying inpatient encounter. An anticoagulation medication order is evidenced by: - Enoxaparin (Lovenox) >80 mg per day - Apixaban (Eliquis) >=10 mg per day - Rivaroxaban (Xarelto) >=20 mg per day - Fondaparinux (Arixtra) >= 5 mg per day - Dalteparin sodium (Fragmin)>= 10,000 IU per day; or - A heparin intravenous administration within 24 hours after the end of the diagnostic imaging study, with at least 2 aPTT heparin therapy monitoring tests or at least 2 Anti Factor Xa Assays within 35 hours of the start of heparin intravenous therapy administration all which occur during the qualifying inpatient encounter; or - Placement of an inferior vena cava (IVC) filter within 24 hours after the end of the diagnostic imaging study and during the qualifying inpatient encounter; or - A diagnosis of VTE which was not present on admission during the qualifying inpatient encounter. OR Criterion B: A qualifying inpatient encounter, where the first surgical procedure was for an intracranial or spinal surgery, and a diagnostic imaging study was performed during the qualifying inpatient encounter and the diagnostic imagining study occurred between 5 days and up to 30 days after the end of the first surgical procedure and at least one of the following: - An anticoagulation medication order within 24 hours after the end of the diagnostic imaging study during the qualifying inpatient encounter. An anticoagulation medication order is evidenced by: - Enoxaparin (Lovenox) >80 mg per day - Apixaban (Eliquis) >=10 mg per day - Rivaroxaban (Xarelto) >=20 mg per day - Fondaparinux (Arixtra) >= 5 mg per day - Dalteparin sodium (Fragmin)>= 10,000 IU per day; or - A heparin intravenous administration within 24 hours after the diagnostic imaging study, with at least 2 aPTT heparin therapy monitoring tests or at least 2 Anti Factor Xa Assays within 35 hours of the start of heparin intravenous therapy administration, all of which occur during the qualifying inpatient encounter; or - Placement of an inferior vena cava (IVC) filter within 24 hours after the end of the diagnostic imaging study and during the qualifying inpatient encounter; or - A diagnosis of VTE which was not present on admission during the qualifying inpatient encounter. OR Criterion C: A VTE that occurs during a subsequent inpatient encounter and within 30 days or less after the end of the first surgical procedure that occurred during the qualifying inpatient encounter as evidenced by: - A diagnosis of VTE during the subsequent encounter; and - Anticoagulation therapy ordered or prescribed during the subsequent encounter. Logic Definition: Numerator
Supplemental Data Guidance | For every patient evaluated by this measure also identify payer, race, ethnicity and sex
Supplemental Data Guidance | None
Supplemental Data Elements
Supplemental Data Element | ID: dose-value Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Dose Value Logic Definition: Dose Value
Supplemental Data Element | ID: dose-quantity-exists Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Dose Quantity Exists Logic Definition: Dose Quantity Exists
Supplemental Data Element | ID: doseandrate-exists Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: DoseAndRate Exists Logic Definition: DoseAndRate Exists
Supplemental Data Element | ID: dosageinstruction-exists Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: DosageInstruction Exists Logic Definition: DosageInstruction Exists
Supplemental Data Element | ID: test-dose-output Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Test Dose Output Logic Definition: Test Dose Output
Supplemental Data Element | ID: dalteparin Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Dalteparin Logic Definition: Dalteparin
Supplemental Data Element | ID: dalteparin-med Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Dalteparin Med Logic Definition: Dalteparin Med
Supplemental Data Element | ID: dose-value-test Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#supplemental-data] Description: Dose Value Test Logic Definition: Dose Value Test
Supplemental Data Element | ID: risk-variable-bleeding-disorder Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Bleeding Disorder Logic Definition: Risk Variable Bleeding Disorder
Supplemental Data Element | ID: risk-variable-cancer Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Cancer Logic Definition: Risk Variable Cancer
Supplemental Data Element | ID: risk-variable-catheter-insertion Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Catheter Insertion Logic Definition: Risk Variable Catheter Insertion
Supplemental Data Element | ID: risk-variable-diabetes Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Diabetes Logic Definition: Risk Variable Diabetes
Supplemental Data Element | ID: risk-variable-fractures Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Fractures Logic Definition: Risk Variable Fractures
Supplemental Data Element | ID: risk-variable-hip-knee-replacement Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Hip Knee Replacement Logic Definition: Risk Variable Hip Knee Replacement
Supplemental Data Element | ID: risk-variable-history-of-vte Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable History of VTE Logic Definition: Risk Variable History of VTE
Supplemental Data Element | ID: risk-variable-hormone-therapy Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Hormone Therapy Logic Definition: Risk Variable Hormone Therapy
Supplemental Data Element | ID: risk-variable-immobility Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Immobility Logic Definition: Risk Variable Immobility
Supplemental Data Element | ID: risk-variable-obesity Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Obesity Logic Definition: Risk Variable Obesity
Supplemental Data Element | ID: risk-variable-respiratory-operations Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Respiratory Operations Logic Definition: Risk Variable Respiratory Operations
Supplemental Data Element | ID: risk-variable-stroke Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Stroke Logic Definition: Risk Variable Stroke
Supplemental Data Element | ID: risk-variable-tobacco-use Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Tobacco Use Logic Definition: Risk Variable Tobacco Use
Supplemental Data Element | ID: risk-variable-vascular-surgery Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Vascular Surgery Logic Definition: Risk Variable Vascular Surgery
Supplemental Data Element | ID: risk-variable-age-18-29 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 18-29 Logic Definition: Risk Variable Age 18-29
Supplemental Data Element | ID: risk-variable-age-30-39 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 30-39 Logic Definition: Risk Variable Age 30-39
Supplemental Data Element | ID: risk-variable-age-40-49 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 40-49 Logic Definition: Risk Variable Age 40-49
Supplemental Data Element | ID: risk-variable-age-50-59 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 50-59 Logic Definition: Risk Variable Age 50-59
Supplemental Data Element | ID: risk-variable-age-60-69 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 60-69 Logic Definition: Risk Variable Age 60-69
Supplemental Data Element | ID: risk-variable-age-70-79 Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 70-79 Logic Definition: Risk Variable Age 70-79
Supplemental Data Element | ID: risk-variable-age-80+ Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Age 80+ Logic Definition: Risk Variable Age 80+
Supplemental Data Element | ID: risk-variable-male Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Male Logic Definition: Risk Variable Male
Supplemental Data Element | ID: risk-variable-female Usage Code: [http://terminology.hl7.org/CodeSystem/measure-data-usage#risk-adjustment-factor] Description: Risk Variable Female Logic Definition: Risk Variable Female
Measure Logic
Primary Library | https://madie.cms.gov/Library/PostopVTEFHIR
Contents | Population Criteria Logic Definitions Terminology Dependencies Data Requirements
Population Criteria
Measure Group (Rate) (ID: Group_1)
Initial Population
    define "Initial Population":
      "Encounter with Procedure with Anesthesia in the Operating Room"
Denominator
    define "Denominator":
      "Initial Population"
Denominator Exclusion
    define "Denominator Exclusion":
      "Encounter with Surgical Procedure and with Obstetrical Condition"
        union "Encounter with VTE Present on Admission"
        union "Encounter with ECMO Procedure"
        union "Encounter with Acute Brain or Spinal Injury or Hemorrhage Present on Admission"
        union "Encounter with Thrombectomy Before or Same Day As Another Procedure"
        union "Intracranial or Spinal Surgery Encounter with Discharge Less Than 5 Days After Surgery"
        union "Encounter with Length of Stay Less Than 2 Days"
Numerator
    define "Numerator":
      "Encounter with PostOp Imaging Study without Intracranial or Spinal Surgery with Evidence of VTE"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study with Evidence of VTE"
        union "Subsequent Encounter with VTE within 30 Days PostOp"
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: 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: 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
    define function ToString(value uri): value.value
Logic Definition | Library Name: CQMCommon
    /*
    @description: Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.
    */
    define fluent function hospitalizationWithObservationAndOutpatientSurgeryService(TheEncounter "Encounter" ):
      TheEncounter Visit
    	  let ObsVisit: Last([Encounter: "Observation Services"] LastObs
    		  	where LastObs.status = 'finished'
              and LastObs.period ends 1 hour or less on or before start of Visit.period
    			  sort by	end of period
        	),
        	VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
        	EDVisit: Last([Encounter: "Emergency Department Visit"] LastED
    			  where LastED.status = 'finished'
              and LastED.period ends 1 hour or less on or before VisitStart
    			  sort by	end of period
        	),
        	VisitStartWithED: Coalesce(start of EDVisit.period, VisitStart),
        	OutpatientSurgeryVisit: Last([Encounter: "Outpatient Surgery Service"] LastSurgeryOP
    			  where LastSurgeryOP.period ends 1 hour or less on or before VisitStartWithED
    			  sort by	end of period
        	)
      	return Interval[Coalesce(start of OutpatientSurgeryVisit.period, VisitStartWithED), end of Visit.period]
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Location resource specified by the given reference.
    */
    define fluent function getLocation(reference Reference):
      singleton from (
        [Location] L where reference.references(L)
      )
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the claim diagnosis elements for the given encounter
    @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
    */
    define fluent function claimDiagnosis(encounter Encounter):
      encounter E
        let
          claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),
          claimItem: (claim.item I where I.encounter.references(E))
        return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the Condition resource for the given reference
    */
    define fluent function getCondition(reference Reference):
      singleton from (([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C where reference.references(C.id))
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: CQMCommon
    /*
     @description: Returns true if the given diagnosis is present on admission, based on the given poaValueSet
     @comment: See the QICore 6 Authoring Patterns discussion on [Principal Diagnosis and Present on Admission](https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Authoring-Patterns-QICore-v6.0.0#conditions-present-on-admission-and-principal-diagnoses) for more information
     */
     define fluent function isDiagnosisPresentOnAdmission(encounter Encounter, diagnosisValueSet ValueSet, poaValueSet ValueSet):
       exists (
         (encounter.claimDiagnosis()) CD
           where CD.onAdmission in poaValueSet
             and (
               CD.diagnosis in diagnosisValueSet
                 or CD.diagnosis.getCondition().code in diagnosisValueSet
             )
       )
Logic Definition | Library Name: CQMCommon
    /*
    @description: Calculates the difference in calendar days between the start and end of the given interval.
    @deprecated: This function in deprecated. Use the fluent function `lengthInDays()` instead.
    */
    define function "LengthInDays"(Value Interval<DateTime> ):
      difference in days between start of Value and end of Value
Logic Definition | Library Name: CQMCommon
    /*
    @description: Returns the medication code for the given MedicationRequest
    */
    define fluent function getMedicationCode(request MedicationRequest):
      if request.medication is Concept then
      	  request.medication as Concept
      	else
      	  (singleton from ([Medication] M where request.medication.references(M))).code
Logic Definition | Library Name: CumulativeMedicationDuration
    define fluent function medicationRequestPeriod(Request "MedicationRequest"):
      Request R
        let
          dosage: singleton from R.dosageInstruction,
          doseAndRate: singleton from dosage.doseAndRate,
          timing: dosage.timing,
          frequency: Coalesce(timing.repeat.frequencyMax, timing.repeat.frequency),
          period: Quantity(timing.repeat.period, timing.repeat.periodUnit),
          doseRange: doseAndRate.dose,
          doseQuantity: doseAndRate.dose,
          dose: Coalesce(end of doseRange, doseQuantity),
          dosesPerDay: Coalesce(ToDaily(frequency, period), Count(timing.repeat.timeOfDay), 1.0),
          boundsPeriod: timing.repeat.bounds as Interval<DateTime>,
          daysSupply: (convert R.dispenseRequest.expectedSupplyDuration to days).value,
          quantity: R.dispenseRequest.quantity,
          refills: Coalesce(R.dispenseRequest.numberOfRepeatsAllowed, 0),
          startDate:
            Coalesce(
              date from start of boundsPeriod,
              date from R.authoredOn,
              date from start of R.dispenseRequest.validityPeriod
            ),
          totalDaysSupplied: Coalesce(daysSupply, quantity.value / (dose.value * dosesPerDay)) * (1 + refills)
        return
          if startDate is not null and totalDaysSupplied is not null then
            Interval[startDate, startDate + Quantity(totalDaysSupplied - 1, 'day') ]
          else if startDate is not null and boundsPeriod."high" is not null then
            Interval[startDate, date from end of boundsPeriod]
          else
            null
Logic Definition | Library Name: CumulativeMedicationDuration
    /**********************************************************************/
    /* Functions in this region are copied from opioid-mme-r4             */
    /**********************************************************************/

    define function Quantity(value Decimal, unit String):
      if value is not null then
        System.Quantity { value: value, unit: unit }
      else
        null
Logic Definition | Library Name: CumulativeMedicationDuration
    /*
     Goal is to get to number of days
     Two broad approaches to the calculation:
      1) Based on supply and frequency, calculate the number of expected days the medication will cover/has covered
      2) Based on relevant period, determine a covered interval and calculate the length of that interval in days
    This topic covers several use cases and illustrates how to calculate Cumulative
    Medication Duration for each type of medication resource using the supply and
    frequency approach.
    */

    /*
      For the first approach, we need to get from frequency to a frequency/day
      So we define ToDaily
    */

    /*
      Calculates daily frequency given frequency within a period
    */
    define function ToDaily(frequency System.Integer, period System.Quantity):
      case period.unit
        when 'h' then frequency * (24.0 / period.value)
        when 'min' then frequency * (24.0 / period.value) * 60
        when 's' then frequency * (24.0 / period.value) * 60 * 60
        when 'd' then frequency * (24.0 / period.value) / 24
        when 'wk' then frequency * (24.0 / period.value) / (24 * 7)
        when 'mo' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
        when 'a' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
        when 'hour' then frequency * (24.0 / period.value)
        when 'minute' then frequency * (24.0 / period.value) * 60
        when 'second' then frequency * (24.0 / period.value) * 60 * 60
        when 'day' then frequency * (24.0 / period.value) / 24
        when 'week' then frequency * (24.0 / period.value) / (24 * 7)
        when 'month' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
        when 'year' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
        when 'hours' then frequency * (24.0 / period.value)
        when 'minutes' then frequency * (24.0 / period.value) * 60
        when 'seconds' then frequency * (24.0 / period.value) * 60 * 60
        when 'days' then frequency * (24.0 / period.value) / 24
        when 'weeks' then frequency * (24.0 / period.value) / (24 * 7)
        when 'months' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
        when 'years' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
        else Message(null, true, 'CMDLogic.ToDaily.UnknownUnit', ErrorLevel, 'Unknown unit ' & period.unit)
      end
Logic Definition | Library Name: PostopVTEFHIR
    define "Dose Value":
      First(["MedicationRequest"]).dosageInstruction[0].doseAndRate[0].dose as Quantity
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with Age Range":
      [Encounter: "Encounter Inpatient"] EncounterIP
        where EncounterIP.period ends during day of "Measurement Period"
          and AgeInYearsAt(date from start of EncounterIP.period) >= 18
          and EncounterIP.status = 'finished'
Logic Definition | Library Name: PostopVTEFHIR
    /*
    define "Encounter with Procedure with Anesthesia in the Operating Room":
      "Encounter with Age Range" AgeEncounter
        with [Procedure: "General and Neuraxial Anesthesia"] AnesthesiaProcedure
          such that AnesthesiaProcedure.performed.toInterval() during AgeEncounter.hospitalizationWithObservationAndOutpatientSurgeryService()
            and exists ( AgeEncounter.location EncounterLocation
                        where AnesthesiaProcedure.performed.toInterval() starts during EncounterLocation.period
                           and  "Operating Room/Suite" in singleton from AgeEncounter.locationTypes()
                      ) */

    define "Encounter with Procedure with Anesthesia in the Operating Room":
      "Encounter with Age Range" AgeEncounter
        with [Procedure: "General and Neuraxial Anesthesia"] AnesthesiaProcedure
          such that AnesthesiaProcedure.performed.toInterval ( ) during AgeEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
            and exists ( AgeEncounter.location EncounterLocation
                let ResolvedLocation: EncounterLocation.location.getLocation ( )
                where AnesthesiaProcedure.performed.toInterval ( ) starts during EncounterLocation.period
                  and exists ( ResolvedLocation.type T
                      where T ~ "Operating Room/Suite"
                  )
            )
Logic Definition | Library Name: PostopVTEFHIR
    define "Initial Population":
      "Encounter with Procedure with Anesthesia in the Operating Room"
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 18-29":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 18
            and AgeInYearsAt(date from start of EncounterIP.period) <= 29
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "DoseAndRate Exists":
      exists ( First(["MedicationRequest"]).dosageInstruction[0].doseAndRate )
Logic Definition | Library Name: PostopVTEFHIR
    define "Dose Quantity Exists":
      First(["MedicationRequest"]).dosageInstruction[0].doseAndRate[0].dose is Quantity
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Stroke":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Stroke" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Stroke" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Vascular Surgery":
      [Procedure: "Vascular Surgeries ICD10PCS"] VascularSurgery
        with "Initial Population" EncounterIP
          such that VascularSurgery.performed.toInterval ( ) during EncounterIP.period
        return Tuple {
          procedureCode: VascularSurgery.code
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Diabetes":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Diabetes" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Diabetes" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Immobility":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Functional and Mobility Impairment" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Functional and Mobility Impairment" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 50-59":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 50
            and AgeInYearsAt(date from start of EncounterIP.period) <= 59
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Dalteparin":
      ["MedicationRequest"] Dalt
        return Dalt.dosage ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "SDE Sex":
      SDE."SDE Sex"
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Female":
      exists ( "Initial Population" EncounterIP
          with "SDE Sex" Sex
            such that Sex ~ "Female (finding)"
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with Surgical Procedure and with Obstetrical Condition":
      "Encounter with Procedure with Anesthesia in the Operating Room" EncounterWithSurgery
        where EncounterWithSurgery.encounterDiagnosis ( ).code in "Obstetrics and VTE Obstetrics"
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with VTE Present on Admission":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        where InpatientEncounter.isDiagnosisPresentOnAdmission ( "Venous Thromboembolism", "Present on Admission or Clinically Undetermined" )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with ECMO Procedure":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with [Procedure: "Extracorporeal Membrane Oxygenation"] ECMO
          such that ECMO.status = 'completed'
            and ECMO.performed.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with Acute Brain or Spinal Injury or Hemorrhage Present on Admission":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        where InpatientEncounter.isDiagnosisPresentOnAdmission ( "Acute Brain or Spinal Injury or Hemorrhage", "Present on Admission or Clinically Undetermined" )
Logic Definition | Library Name: PostopVTEFHIR
    /*
    define "Encounter with PostOp Imaging Study within 30 Days of Surgery":
      from
        "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter,
        "Imaging Study for VTE" ImagingStudy
      let HospitalWithObservationPeriod: InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService(),
          ImageTime: ImagingStudy.effective,
          SurgeryTime: InpatientEncounter.firstProcedure().performed
      where ImagingStudy.status in { 'final', 'amended', 'corrected' }
        and ImageTime during HospitalWithObservationPeriod
        and ImageTime >= SurgeryTime
        and ImageTime <= SurgeryTime + 30 days
      return InpatientEncounter    */

    define "Encounter with Thrombectomy Before or Same Day As Another Procedure":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with [Procedure: "Pulmonary Arterial Thrombectomy"] Thrombectomy
          such that Thrombectomy.status = 'completed'
            and Thrombectomy.performed.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
            and Thrombectomy.performed.toInterval ( ) starts on or before day of start of InpatientEncounter.firstProcedure ( ).performed.toInterval ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery":
      [Procedure: "Intracranial Neurosurgery"] intN
        union [Procedure: "Spinal Surgery"] spS
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with Discharge Less Than 5 Days After Surgery":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with "Intracranial or Spinal Surgery" BrainSpineSurgery
          such that BrainSpineSurgery.status = 'completed'
            and BrainSpineSurgery.performed.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
            and InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( ) ends less than 5 days after end of BrainSpineSurgery.performed.toInterval ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with Length of Stay Less Than 2 Days":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        where InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryServiceLengthOfStay ( ) < 2
Logic Definition | Library Name: PostopVTEFHIR
    define "Denominator Exclusion":
      "Encounter with Surgical Procedure and with Obstetrical Condition"
        union "Encounter with VTE Present on Admission"
        union "Encounter with ECMO Procedure"
        union "Encounter with Acute Brain or Spinal Injury or Hemorrhage Present on Admission"
        union "Encounter with Thrombectomy Before or Same Day As Another Procedure"
        union "Intracranial or Spinal Surgery Encounter with Discharge Less Than 5 Days After Surgery"
        union "Encounter with Length of Stay Less Than 2 Days"
Logic Definition | Library Name: PostopVTEFHIR
    define "Dalteparin Med":
      ["MedicationRequest"] Dalt
        return Dalt.dosageInstruction[0].doseAndRate[0]
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 40-49":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 40
            and AgeInYearsAt(date from start of EncounterIP.period) <= 49
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Cancer":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Cancer" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Cancer" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Catheter Insertion":
      [Procedure: "CVC Insertion Procedure"] CatheterInsertion
        with "Initial Population" EncounterIP
          such that CatheterInsertion.performed.toInterval ( ) during EncounterIP.period
        return Tuple {
          procedureCode: CatheterInsertion.code
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 80+":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 80
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Male":
      exists ( "Initial Population" EncounterIP
          with "SDE Sex" Sex
            such that Sex ~ "Male (finding)"
      )
Logic Definition | Library Name: PostopVTEFHIR
    /* Do not highlight
    define "Risk Variable Hormone Therapy":
        ["MedicationRequest": "Hormone Therapy"] HormoneTherapy
            with "Initial Population" EncounterIP
            such that HormoneTherapy.medicationRequestPeriod() starts before EncounterIP.period
                or HormoneTherapy.medicationRequestPeriod() starts during EncounterIP.period
        return Tuple {
            medicationCode: HormoneTherapy.medication
        }
    */

    define "Risk Variable Hormone Therapy":
      ["MedicationRequest"] HormoneTherapy
        with "Initial Population" EncounterIP
          such that HormoneTherapy.status ~ 'active'
            and HormoneTherapy.getMedicationCode ( ) in "Hormone Therapy"
            and ( HormoneTherapy.medicationRequestPeriod ( ) starts before EncounterIP.period
                or HormoneTherapy.medicationRequestPeriod ( ) starts during EncounterIP.period
            )
        return Tuple {
          medicationCode: HormoneTherapy.medication
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 70-79":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 70
            and AgeInYearsAt(date from start of EncounterIP.period) <= 79
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "DosageInstruction Exists":
      exists ( First(["MedicationRequest"]).dosageInstruction )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Respiratory Operations":
      [Procedure: "Respiratory Procedures"] RespiratoryProcedure
        with "Initial Population" EncounterIP
          such that RespiratoryProcedure.performed.toInterval ( ) during EncounterIP.period
        return Tuple {
          procedureCode: RespiratoryProcedure.code
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Imaging Study for VTE":
      ["LaboratoryResultObservation": "CT Angiography of Chest"] CT
        union ["LaboratoryResultObservation": "Pulmonary Ventilation/Perfusion (VQ) Scan"] PV
        union ["LaboratoryResultObservation": "Ultrasound of Lower Extremities"] UsLe
        union ["LaboratoryResultObservation": "Abdominal or Pelvic CT Scan with Contrast"] PCT
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study within 30 Days of Surgery":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with "Imaging Study for VTE" ImagingStudy
          such that ImagingStudy.effective.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
            and ImagingStudy.status in { 'final', 'amended', 'corrected' }
            and ImagingStudy.effective.toInterval ( ) starts 30 days or less after end of InpatientEncounter.firstProcedure ( ).performed.toInterval ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with "Intracranial or Spinal Surgery" BrainSpineSurgery
          such that BrainSpineSurgery.status = 'completed'
            and BrainSpineSurgery.performed.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
            and InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( ) ends less than 5 days after end of BrainSpineSurgery.performed.toInterval ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter without Intracranial or Spinal Surgery with PostOp Imaging Study within 30 Days After Surgery":
      "Encounter with PostOp Imaging Study within 30 Days of Surgery" ImagingStudyEncounter
        without "Intracranial or Spinal Surgery Encounter" SurgeryEncounter
          such that SurgeryEncounter.period during ImagingStudyEncounter.period
Logic Definition | Library Name: PostopVTEFHIR
    define "Apixiban Greater Than or Equal to 10mg Daily":
      ["MedicationRequest"] Apixiban
        where Apixiban.status ~ 'active'
          and Apixiban.getMedicationCode ( ) in "Apixaban"
          and Apixiban.dosage ( ) >= 10 'mg'
          and Apixiban.frequency ( ) ~ "Once daily (qualifier value)"
          or ( Apixiban.dosage ( ) >= 5 'mg'
              and Apixiban.frequency ( ) ~ "Twice a day (qualifier value)"
          )
Logic Definition | Library Name: PostopVTEFHIR
    define "Dalteparin Greater Than or Equal to 10,000 [IU]/mL Daily":
      ["MedicationRequest"] Dalteparin
        where Dalteparin.status ~ 'active'
          and Dalteparin.getMedicationCode ( ) in "Dalteparin Anticoagulant"
          and Dalteparin.dosage ( ) >= 10000 '[IU]/mL'
          and Dalteparin.frequency ( ) ~ "Once daily (qualifier value)"
Logic Definition | Library Name: PostopVTEFHIR
    define "Enoxaparin Greater Than 80mg Daily":
      ["MedicationRequest"] Enoxaparin
        where Enoxaparin.status ~ 'active'
          and Enoxaparin.getMedicationCode ( ) in "Enoxaparin Anticoagulant"
          and Enoxaparin.dosage ( ) >= 40 'mg'
          and Enoxaparin.frequency ( ) ~ "Twice a day (qualifier value)"
          or ( Enoxaparin.dosage ( ) >= 70 'mg'
              and Enoxaparin.frequency ( ) ~ "Once daily (qualifier value)"
          )
Logic Definition | Library Name: PostopVTEFHIR
    define "Rivaroxaban Greater Than or Equal to 20 mg Daily":
      ["MedicationRequest"] Rivaroxaban
        where Rivaroxaban.status ~ 'active'
          and Rivaroxaban.getMedicationCode ( ) in "Rivaroxaban Anticoagulant"
          and Rivaroxaban.dosage ( ) >= 20 'mg'
          and Rivaroxaban.frequency ( ) ~ "Once daily (qualifier value)"
          or ( Rivaroxaban.dosage ( ) >= 15 'mg'
              and Rivaroxaban.frequency ( ) ~ "Twice a day (qualifier value)"
          )
Logic Definition | Library Name: PostopVTEFHIR
    /*
    define "Dalteparin Greater Than or Equal to 10,000 kg Daily":
      ["MedicationRequest"] Dalteparin
      let DalDose: Dalteparin.dosageInstruction.doseAndRate,
      DalDoseRate: DalDose.dose
        where Dalteparin.status ~ 'active'
          and Dalteparin.getMedicationCode() in "Dalteparin Anticoagulant"
          and DalDoseRate as Quantity
          and DalDoseRate.value >= 10000
          and DalDoseRate.unit ~ 'kg'
          and Dalteparin.frequency() ~ "Once daily (qualifier value)"  */

    /*
    define "Dalteparin Greater Than or Equal to 10,000 kg Daily":
      ["MedicationRequest"] Dalteparin
      let DalDose: singleton from Dalteparin.dosageInstruction,
          DalDoseRate: singleton from DalDose.doseAndRate
      where Dalteparin.status ~ 'active'
        and Dalteparin.getMedicationCode() in "Dalteparin Anticoagulant"
        and DalDoseRate.dose.value >= 10000
    //    and DalDoseRate.dose.unit ~ 'kg'
    //    and Dalteparin.frequency() ~ "Once daily (qualifier value)"
    */

    define "Fondaparinux Greater Than or Equal to 5mg Daily":
      ["MedicationRequest"] Fondaparinux
        where Fondaparinux.status ~ 'active'
          and Fondaparinux.getMedicationCode ( ) in "Fondaparinux Anticoagulant"
          and ( Fondaparinux.dosage ( ) >= 2.5 'mg'
              and Fondaparinux.frequency ( ) ~ "Twice a day (qualifier value)"
              or Fondaparinux.dosage ( ) >= 5 'mg'
                and Fondaparinux.frequency ( ) ~ "Once daily (qualifier value)"
          )
Logic Definition | Library Name: PostopVTEFHIR
    define "Non Heparin Therapeutic Medication Order":
      "Apixiban Greater Than or Equal to 10mg Daily"
        union "Dalteparin Greater Than or Equal to 10,000 [IU]/mL Daily"
        union "Enoxaparin Greater Than 80mg Daily"
        union "Rivaroxaban Greater Than or Equal to 20 mg Daily"
        union "Fondaparinux Greater Than or Equal to 5mg Daily"
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and Non Heparin Therapeutic Anticoagulant without Intracranial or Spinal Surgery":
      from
        "Encounter without Intracranial or Spinal Surgery with PostOp Imaging Study within 30 Days After Surgery" QualifyingEncounter,
        "Imaging Study for VTE" ImagingStudy,
        "Non Heparin Therapeutic Medication Order" Anticoagulant
        where ImagingStudy.effective.toInterval ( ) starts during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and Anticoagulant.authoredOn during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and Anticoagulant.authoredOn 24 hours or less after end of ImagingStudy.effective.toInterval ( )
        return QualifyingEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and Intravenous Heparin without Intracranial or Spinal Surgery":
      from
        "Encounter without Intracranial or Spinal Surgery with PostOp Imaging Study within 30 Days After Surgery" QualifyingEncounter,
        "Imaging Study for VTE" ImagingStudy,
        ["MedicationAdministration": "Heparin for VTE Treatment"] HeparinGiven
        where HeparinGiven.status = 'completed'
          and ImagingStudy.status in { 'final', 'amended', 'corrected' }
          and HeparinGiven.effective starts 24 hours or less after end of ImagingStudy.effective
        return QualifyingEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 AntiFactorXa Tests without Intracranial or Spinal Surgery":
      "Encounter with PostOp Imaging Study and Intravenous Heparin without Intracranial or Spinal Surgery" ImagingHeparinEncounter
        where Count(ImagingHeparinEncounter.antiFactorXaAssayHeparinMonitoringTests()) > 1
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 aPTT Tests without Intracranial or Spinal Surgery":
      "Encounter with PostOp Imaging Study and Intravenous Heparin without Intracranial or Spinal Surgery" ImagingHeparinEncounter
        where Count(ImagingHeparinEncounter.aPTTHeparinMonitoringTests()) > 1
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and IVC Filter Placement without Intracranial or Spinal Surgery":
      from
        "Encounter without Intracranial or Spinal Surgery with PostOp Imaging Study within 30 Days After Surgery" QualifyingEncounter,
        "Imaging Study for VTE" ImagingStudy,
        [Procedure: "Inferior Vena Cava (IVC) Filter Placement"] IVCFilterPlacement
        where IVCFilterPlacement.status = 'completed'
          and ImagingStudy.status in { 'final', 'amended', 'corrected' }
          and ImagingStudy.effective.toInterval ( ) starts during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and IVCFilterPlacement.performed.toInterval ( ) starts during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and IVCFilterPlacement.performed.toInterval ( ) starts 24 hours or less after end of ImagingStudy.effective.toInterval ( )
        return QualifyingEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study and VTE Diagnosis Not Present on Admission without Intracranial or Spinal Surgery":
      "Encounter without Intracranial or Spinal Surgery with PostOp Imaging Study within 30 Days After Surgery" QualifyingEncounter
        where QualifyingEncounter.isDiagnosisPresentOnAdmission ( "Venous Thromboembolism", "Not Present On Admission or Documentation Insufficient to Determine" )
Logic Definition | Library Name: PostopVTEFHIR
    define "Encounter with PostOp Imaging Study without Intracranial or Spinal Surgery with Evidence of VTE":
      "Encounter with PostOp Imaging Study and Non Heparin Therapeutic Anticoagulant without Intracranial or Spinal Surgery"
        union "Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 AntiFactorXa Tests without Intracranial or Spinal Surgery"
        union "Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 aPTT Tests without Intracranial or Spinal Surgery"
        union "Encounter with PostOp Imaging Study and IVC Filter Placement without Intracranial or Spinal Surgery"
        union "Encounter with PostOp Imaging Study and VTE Diagnosis Not Present on Admission without Intracranial or Spinal Surgery"
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study Between 5 and 30 Days After Surgery":
      from
        "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter,
        "Intracranial or Spinal Surgery" BrainSpineSurgery,
        "Imaging Study for VTE" ImagingStudy
        where BrainSpineSurgery.performed.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and ImagingStudy.effective.toInterval ( ) during day of InpatientEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and ImagingStudy.status in { 'final', 'amended', 'corrected' }
          and ImagingStudy.effective during day of Interval[end of InpatientEncounter.firstProcedure ( ).performed.toInterval ( ) + 5 days, end of InpatientEncounter.firstProcedure ( ).performed.toInterval ( ) + 30 days]
        return InpatientEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Non Heparin Therapeutic Anticoagulant":
      from
        "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study Between 5 and 30 Days After Surgery" BrainSpinalEncounter,
        "Imaging Study for VTE" ImagingStudy,
        "Non Heparin Therapeutic Medication Order" Anticoagulant
        where ImagingStudy.effective.toInterval ( ) starts during BrainSpinalEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and Anticoagulant.authoredOn during BrainSpinalEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and Anticoagulant.authoredOn 24 hours or less after end of ImagingStudy.effective.toInterval ( )
        return BrainSpinalEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Intravenous Heparin Administration":
      ["MedicationAdministration": "Heparin"] HeparinMed
        where HeparinMed.dosage.route in "Intravenous Heparin Administration Route"
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin":
      from
        "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study Between 5 and 30 Days After Surgery" BrainSpinalEncounter,
        "Imaging Study for VTE" ImagingStudy,
        "Intravenous Heparin Administration" IntravenousHeparin
        where IntravenousHeparin.effective.toInterval ( ) starts 24 hours or less after end of ImagingStudy.effective.toInterval ( )
        return BrainSpinalEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 AntiFactorXa Tests":
      "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin" SurgicalHeparinEncounter
        where ( Count(SurgicalHeparinEncounter.antiFactorXaAssayHeparinMonitoringTests()) > 1 )
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 aPTT Tests":
      "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin" SurgicalHeparinEncounter
        where ( Count(SurgicalHeparinEncounter.aPTTHeparinMonitoringTests()) > 1 )
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and IVC Filter Placement":
      from
        "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study Between 5 and 30 Days After Surgery" BrainSpinalEncounter,
        "Imaging Study for VTE" ImagingStudy,
        [Procedure: "Inferior Vena Cava (IVC) Filter Placement"] IVCFilterPlacement
        where IVCFilterPlacement.status = 'completed'
          and ImagingStudy.status in { 'final', 'amended', 'corrected' }
          and ImagingStudy.effective.toInterval ( ) starts during BrainSpinalEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and IVCFilterPlacement.performed.toInterval ( ) during day of BrainSpinalEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and IVCFilterPlacement.performed.toInterval ( ) starts 24 hours or less after end of ImagingStudy.effective.toInterval ( )
        return BrainSpinalEncounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and VTE Diagnosis Not Present on Admission":
      "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study Between 5 and 30 Days After Surgery" BrainSpinalEncounter
        where BrainSpinalEncounter.isDiagnosisPresentOnAdmission ( "Venous Thromboembolism", "Not Present On Admission or Documentation Insufficient to Determine" )
Logic Definition | Library Name: PostopVTEFHIR
    define "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study with Evidence of VTE":
      "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Non Heparin Therapeutic Anticoagulant"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 AntiFactorXa Tests"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and Intravenous Heparin with at Least 2 aPTT Tests"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and IVC Filter Placement"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study and VTE Diagnosis Not Present on Admission"
Logic Definition | Library Name: PostopVTEFHIR
    define "Subsequent Qualifying Encounter":
      ( [Encounter: "Emergency Department Visit"]
        union [Encounter: "Encounter Inpatient"]
        union [Encounter: "Observation Services"] ) ValidEncounter
        where ( not exists ( ValidEncounter.diagnosis diagnosis //No FHIR mapping for 'diagnoses'

              where diagnosis.condition.getCondition ( ).code in "Obstetrics and VTE Obstetrics"
          )
        )
          and AgeInYearsAt(date from start of ValidEncounter.period) >= 18
          and ValidEncounter.period ends during day of "Measurement Period"
Logic Definition | Library Name: PostopVTEFHIR
    /*
    define "VTE Medication Ordered or Prescribed":
      ["MedicationRequest": "Non Heparin Anticoagulants for VTE Treatment"]
        union ["MedicationRequest": "Heparin for VTE Treatment"]
     */

    define "VTE Medication Ordered or Prescribed":
      ["MedicationRequest"] MR
        where MR.status ~ 'active'
          and MR.getMedicationCode ( ) in "Non Heparin Anticoagulants for VTE Treatment"
          or MR.getMedicationCode ( ) in "Heparin for VTE Treatment"
Logic Definition | Library Name: PostopVTEFHIR
    define "Subsequent Encounter with VTE Diagnosis and VTE Medication":
      from
        "Subsequent Qualifying Encounter" Encounter,
        ["ConditionEncounterDiagnosis": "Venous Thromboembolism"] VTEDiagnosis,
        "VTE Medication Ordered or Prescribed" VTEMeds
        where ( QICoreCommon.ToPrevalenceInterval ( VTEDiagnosis ) starts during Encounter.period )//No FHIR mapping for 'prevalencePeriod'

          and VTEMeds.authoredOn during Encounter.period
        return Encounter
Logic Definition | Library Name: PostopVTEFHIR
    define "Subsequent Encounter with VTE within 30 Days PostOp":
      "Encounter with Procedure with Anesthesia in the Operating Room" InpatientEncounter
        with "Subsequent Encounter with VTE Diagnosis and VTE Medication" VTE
          such that VTE.period starts after end of InpatientEncounter.period
            and VTE.period starts 30 days or less after end of InpatientEncounter.firstProcedure ( ).performed.toInterval ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Numerator":
      "Encounter with PostOp Imaging Study without Intracranial or Spinal Surgery with Evidence of VTE"
        union "Intracranial or Spinal Surgery Encounter with PostOp Imaging Study with Evidence of VTE"
        union "Subsequent Encounter with VTE within 30 Days PostOp"
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Hip Knee Replacement":
      ( [Procedure: "Hip Replacement Surgery"]
        union [Procedure: "Knee Replacement Surgery"] ) ReplacementSurgery
        with "Initial Population" EncounterIP
          such that ReplacementSurgery.performed.toInterval ( ) during EncounterIP.period
        return Tuple {
          procedureCode: ReplacementSurgery.code
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 30-39":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 30
            and AgeInYearsAt(date from start of EncounterIP.period) <= 39
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Bleeding Disorder":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Bleeding Disorder" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Bleeding Disorder" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Dose Value Test":
      ( First(["MedicationRequest"]).dosageInstruction[0].doseAndRate[0].dose as Quantity ).value
Logic Definition | Library Name: PostopVTEFHIR
    define "Denominator":
      "Initial Population"
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Obesity":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Obesity" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Obesity" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Tobacco Use":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Smoking status" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Smoking status" )
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Age 60-69":
      exists ( "Initial Population" EncounterIP
          where AgeInYearsAt(date from start of EncounterIP.period) >= 60
            and AgeInYearsAt(date from start of EncounterIP.period) <= 69
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Test Dose Output":
      First(["MedicationRequest"]).dosageInstruction[0].doseAndRate[0].children ( )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable Fractures":
      "Initial Population" EncounterIP
        let DiagnosisCode: EncounterIP.claimDiagnosisIn ( "Fractures" )
        return Tuple {
          code: DiagnosisCode,
          poa: EncounterIP.presentOnAdmissionIndicator ( "Fractures" ),
          encounterPeriod: EncounterIP.period
        }
Logic Definition | Library Name: PostopVTEFHIR
    define "High Risk Indicator For VTE":
      exists ( ["ObservationScreeningAssessment": "Risk for venous thromboembolism"] VTERiskAssessment
          with "Initial Population" EncounterIP
            such that VTERiskAssessment.value ~ "High"
              and ( VTERiskAssessment.effective.toInterval ( ).earliest ( ) before day of EncounterIP.period
                  or ( VTERiskAssessment.effective.toInterval ( ).earliest ( ) during day of EncounterIP.period )
              )
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "History of VTE":
      exists ( "Initial Population" EncounterIP
          where EncounterIP.encounterDiagnosis ( ).code contains "Personal history of other venous thrombosis and embolism"
      )
Logic Definition | Library Name: PostopVTEFHIR
    define "Risk Variable History of VTE":
      "High Risk Indicator For VTE"
        or "History of VTE"
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function claimDiagnosisIn(encounter Encounter, diagnosisValueSet ValueSet):
        // This function returns the claim diagnosis for a given encounter that is in the specified value set
        // It is used to find diagnoses that are associated with a claim for the given encounter

      encounter E
        let CD: singleton from E.claimDiagnosis ( )
        where ( CD.diagnosis in diagnosisValueSet
            or CD.diagnosis.getCondition ( ).code in diagnosisValueSet
        )
        return CD.diagnosis.getCondition ( ).code
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function presentOnAdmissionIndicator(encounter Encounter, diagnosisValueSet ValueSet):
      encounter E
        let CD: singleton from E.claimDiagnosis ( )
        where ( CD.diagnosis in diagnosisValueSet
            or CD.diagnosis.getCondition ( ).code in diagnosisValueSet
        )
        return CD.onAdmission
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function dosage(theRequest MedicationRequest):
      theRequest R
        let dosageInstruction: singleton from R.dosageInstruction,
        dosageRate: singleton from dosageInstruction.doseAndRate
        return dosageRate.dose as Quantity
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function firstProcedure(theEncounter Encounter):
      First([Procedure: "General and Neuraxial Anesthesia"] FirstProc
          where FirstProc.performed.toInterval().toInterval() starts during theEncounter.hospitalizationWithObservationAndOutpatientSurgeryService()
          sort by start of performed.toInterval()
      )
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function hospitalizationWithObservationAndOutpatientSurgeryServiceLengthOfStay(theEncounter Encounter):
      CQMCommon."LengthInDays" ( theEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( ) )
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function frequency(theRequest "MedicationRequest"):
      theRequest R
        let dosageInstruction: singleton from R.dosageInstruction,
        doseAndRate: singleton from dosageInstruction.doseAndRate,
        timing: dosageInstruction.timing,
        medicationFrequency: Coalesce(timing.repeat.frequencyMax, timing.repeat.frequency),
        medicationUnit: timing.repeat.periodUnit
        return case
          when medicationUnit ~ 'd'
            and medicationFrequency = 1 then "Once daily (qualifier value)"
          when medicationUnit ~ 'd'
            and medicationFrequency = 2 then "Twice a day (qualifier value)"
          else "Not applicable (qualifier value)" end
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function antiFactorXaAssayHeparinMonitoringTests(QualifyingEncounter Encounter):
      from
        ["MedicationAdministration": "Heparin"] HeparinMedication,
        ["LaboratoryResultObservation": "Anti Factor Xa Assay"] AntiFXaHepMonitoringTest
        where AntiFXaHepMonitoringTest.effective.toInterval ( ) 35 hours or less after start of HeparinMedication.effective.toInterval ( )
          and AntiFXaHepMonitoringTest.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and HeparinMedication.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
        return AntiFXaHepMonitoringTest
Logic Definition | Library Name: PostopVTEFHIR
    define fluent function aPTTHeparinMonitoringTests(QualifyingEncounter Encounter):
      from
        ["MedicationAdministration": "Heparin"] HeparinMedication,
        ["LaboratoryResultObservation": "aPTT Tests"] aPTTHepMonitoringTest
        where aPTTHepMonitoringTest.effective.toInterval ( ) 35 hours or less after start of HeparinMedication.effective.toInterval ( )
          and aPTTHepMonitoringTest.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
          and HeparinMedication.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservationAndOutpatientSurgeryService ( )
        return aPTTHepMonitoringTest
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 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: Returns true if any of the given references are to the given resource
    @comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
    NOTE: This function assumes resources from the same source server.
    */
    define fluent function references(references List<Reference>, resource Resource):
      exists (references R where R.references(resource))
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.
    @deprecated: This function is deprecated. Use the `prevalenceInterval()` fluent function instead
    */
    define function ToPrevalenceInterval(condition Choice<"ConditionEncounterDiagnosis", "ConditionProblemsHealthConcerns">):
    if condition.clinicalStatus ~ "active"
      or condition.clinicalStatus ~ "recurrence"
      or condition.clinicalStatus ~ "relapse" then
      Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]
    else
       (end of ToAbatementInterval(condition)) abatementDate
        return if abatementDate is null then
          Interval[start of ToInterval(condition.onset), abatementDate)
        else
          Interval[start of ToInterval(condition.onset), 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.
    @deprecated: This function is deprecated. Use the fluent function `abatementInterval()` instead.
    */
    define function ToAbatementInterval(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>
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Given an interval, return the starting point if the interval has a starting boundary specified,
    otherwise, return the ending point
    */
    define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
      (choice.toInterval()) period
        return
          if (period."hasStart"()) then start of period
          else end of period
Logic Definition | Library Name: QICoreCommon
    /*
    @description: Given an interval, return true if the interval has a starting boundary specified
    (i.e. the start of the interval is not null and not the minimum DateTime value)
    */
    define fluent function hasStart(period Interval<DateTime> ):
      not ( start of period is null
          or start of period = minimum DateTime
      )
Terminology
Code System | Description: Code system HSLOC Resource: https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html Canonical URL: `https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html`
Code System | Description: Code system SNOMEDCT Resource: http://snomed.info/sct Canonical URL: `http://snomed.info/sct`
Code System | Description: Code system ConditionClinicalStatusCodes Resource: http://terminology.hl7.org/CodeSystem/condition-clinical Canonical URL: `http://terminology.hl7.org/CodeSystem/condition-clinical`
Code System | Description: Code system LOINC Resource: http://loinc.org Canonical URL: `http://loinc.org`
Code System | Description: Code system ICD10CM Resource: http://hl7.org/fhir/sid/icd-10-cm Canonical URL: `http://hl7.org/fhir/sid/icd-10-cm`
Value Set | Description: Value set Encounter Inpatient Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307`
Value Set | Description: Value set General and Neuraxial Anesthesia Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.208`
Value Set | Description: Value set Observation Services Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143`
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 Outpatient Surgery Service Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38`
Value Set | Description: Value set Stroke Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.176 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.176`
Value Set | Description: Value set Vascular Surgeries ICD10PCS Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.1833 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.1833`
Value Set | Description: Value set Diabetes Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.3 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.3`
Value Set | Description: Value set Functional and Mobility Impairment Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.6 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.6`
Value Set | Description: Value set Obstetrics and VTE Obstetrics Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.33 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.33`
Value Set | Description: Value set Venous Thromboembolism Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.279 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.279`
Value Set | Description: Value set Present on Admission or Clinically Undetermined Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.197`
Value Set | Description: Value set Extracorporeal Membrane Oxygenation Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.81 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.81`
Value Set | Description: Value set Acute Brain or Spinal Injury or Hemorrhage Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.79 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.79`
Value Set | Description: Value set Pulmonary Arterial Thrombectomy Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.80 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.80`
Value Set | Description: Value set Intracranial Neurosurgery Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.260 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.260`
Value Set | Description: Value set Spinal Surgery Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.185 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.185`
Value Set | Description: Value set Cancer Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1010 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1010`
Value Set | Description: Value set CVC Insertion Procedure Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1195.43 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1195.43`
Value Set | Description: Value set Hormone Therapy Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.9 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.9`
Value Set | Description: Value set Respiratory Procedures Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.15 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.15`
Value Set | Description: Value set CT Angiography of Chest Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.155 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.155`
Value Set | Description: Value set Pulmonary Ventilation/Perfusion (VQ) Scan Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.170 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.170`
Value Set | Description: Value set Ultrasound of Lower Extremities Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.165 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.165`
Value Set | Description: Value set Abdominal or Pelvic CT Scan with Contrast Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.160 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.160`
Value Set | Description: Value set Apixaban Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.1240.15.2.4005 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.1240.15.2.4005`
Value Set | Description: Value set Dalteparin Anticoagulant Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.263 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.263`
Value Set | Description: Value set Enoxaparin Anticoagulant Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.268 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.268`
Value Set | Description: Value set Rivaroxaban Anticoagulant Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.260 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.260`
Value Set | Description: Value set Fondaparinux Anticoagulant Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.262 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.262`
Value Set | Description: Value set Heparin for VTE Treatment Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.179 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.179`
Value Set | Description: Value set Heparin Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.264 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.264`
Value Set | Description: Value set Anti Factor Xa Assay Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.183 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.183`
Value Set | Description: Value set aPTT Tests Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.109 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.109`
Value Set | Description: Value set Inferior Vena Cava (IVC) Filter Placement Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.151 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.151`
Value Set | Description: Value set Not Present On Admission or Documentation Insufficient to Determine Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.198 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.198`
Value Set | Description: Value set Intravenous Heparin Administration Route Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.267 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.267`
Value Set | Description: Value set Non Heparin Anticoagulants for VTE Treatment Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.172 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.172`
Value Set | Description: Value set Hip Replacement Surgery Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.259 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.259`
Value Set | Description: Value set Knee Replacement Surgery Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.261 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.261`
Value Set | Description: Value set Bleeding Disorder Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.286 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.286`
Value Set | Description: Value set Obesity Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.8 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.8`
Value Set | Description: Value set Smoking status Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.7 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.7`
Value Set | Description: Value set Fractures Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.10 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1272.10`
Direct Reference Code | Display: Operating Room/Suite Code: 1096-7 System: `https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html`
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: Once daily (qualifier value) Code: 229797004 System: `http://snomed.info/sct`
Direct Reference Code | Display: Twice a day (qualifier value) Code: 229799001 System: `http://snomed.info/sct`
Direct Reference Code | Display: Not applicable (qualifier value) Code: 473010000 System: `http://snomed.info/sct`
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: Risk for venous thromboembolism Code: 72136-5 System: `http://loinc.org`
Direct Reference Code | Display: High Code: LA9193-9 System: `http://loinc.org`
Direct Reference Code | Display: Personal history of other venous thrombosis and embolism Code: Z86.718 System: `http://hl7.org/fhir/sid/icd-10-cm`
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 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`
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 CMD Resource: https://madie.cms.gov/Library/CumulativeMedicationDuration|6.0.000 Canonical URL: `https://madie.cms.gov/Library/CumulativeMedicationDuration|6.0.000`
Data Requirements
Data Requirement | Type: MedicationRequest Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest Must Support Elements: dosageInstruction, dispenseRequest, dispenseRequest.expectedSupplyDuration, dispenseRequest.quantity, dispenseRequest.numberOfRepeatsAllowed, dispenseRequest.numberOfRepeatsAllowed.value, authoredOn, authoredOn.value, dispenseRequest.validityPeriod, medication, status, status.value
Data Requirement | Type: Patient Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Must Support Elements: birthDate, birthDate.value, extension
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, period, onAdmission, diagnosis, diagnosis.code Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.38
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, status, status.value, period, onAdmission, diagnosis, diagnosis.code 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: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, period, status, status.value, onAdmission, diagnosis, diagnosis.code, location Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
Data Requirement | Type: Encounter Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter Must Support Elements: type, status, status.value, period, onAdmission, diagnosis, diagnosis.code Code Filter(s): Path: type ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Data Requirement | Type: Resource Profile(s): http://hl7.org/fhir/StructureDefinition/Resource Must Support Elements: id, id.value
Data Requirement | Type: Location Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location
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.113883.3.666.5.1833
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.81
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.1248.208
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.80
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.260
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.185
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.1195.43
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.1272.15
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.151
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: performed, status, status.value, code
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.259
Data Requirement | Type: Procedure Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure Must Support Elements: code, status, status.value, performed Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.261
Data Requirement | Type: Claim Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim Must Support Elements: status, status.value, use, use.value, item
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-encounter-diagnosis Must Support Elements: code Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.279
Data Requirement | Type: Condition Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns
Data Requirement | Type: Medication Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication Must Support Elements: code, id.value
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.155
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.170
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.165
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.160
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.183
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-lab Must Support Elements: code, effective, status, status.value Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.109
Data Requirement | Type: MedicationAdministration Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration Must Support Elements: medication, status, status.value, effective, dosage, dosage.route Code Filter(s): Path: medication ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1147.179
Data Requirement | Type: MedicationAdministration Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration Must Support Elements: medication, status, status.value, effective, dosage, dosage.route Code Filter(s): Path: medication ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.264
Data Requirement | Type: MedicationAdministration Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration Must Support Elements: medication.reference.value, status, status.value, effective, dosage, dosage.route
Data Requirement | Type: Observation Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-screening-assessment Must Support Elements: code, value, effective Code Filter(s): Path: code Code(s): http://loinc.org#72136-5: 'Risk for venous thromboembolism'
Generated using version 0.4.8 of the sample-content-ig Liquid templates