Potential Drug-Drug Interaction (PDDI) Clinical Decision Support, published by HL7 International / Clinical Decision Support. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/PDDI-CDS/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
<PlanDefinition xmlns="http://hl7.org/fhir">
<id value="warfarin-nsaids-cds-select"/>
<language value="en"/>
<text>
<status value="extensions"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<table class="narrative-table">
<tbody>
<tr>
<th colspan="2" scope="row" class="row-header">Metadata</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Warfarin NSAIDs Order Select Recommendation</td>
</tr>
<tr>
<th scope="row" class="row-header">Version</th>
<td class="content-container">1.0.0</td>
</tr>
<tr>
<th scope="row" class="row-header">Experimental</th>
<td class="content-container">true</td>
</tr>
<tr>
<th scope="row" class="row-header">Jurisdiction</th>
<td class="content-container">
001 from <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">http://unstats.un.org/unsd/methods/m49/m49.htm</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Topic</th>
<td class="content-container">Warfarin NSAIDs Prescribing
</td>
</tr>
<tr>
<th scope="row" class="row-header">Steward (Publisher)</th>
<td class="content-container">HL7 International / Clinical Decision Support</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container"><div><p>Drug-drug interaction recommendation for use on order select of a warfarin or NSAID</p>
</div></td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
ECA Rule
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Trigger Type</th>
<td class="content-container">Named Event</td>
</tr>
<tr>
<th scope="row" class="row-header">Trigger Name</th>
<td class="content-container">order-select</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-inclusion-criteria">Inclusion Criteria</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Potential Drug-Drug Interaction between warfarin (product) and NSAID (product)</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Topical diclofenac has relatively low systemic absorption; in one study a topical gel (16 g/day) produced about 6% of the absorption seen with systemic administration of 150 mg/day. A higher than recommended dose of topical gel (48 g/day) produced 20% of a systemic dose of diclofenac.</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-is-context-medication-topical-diclofenac">Is context medication topical diclofenac</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-summary">Get Base Summary</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: activity.extension
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-indicator">Get Base Indicator</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between warfarin (product) and NSAID (product))</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">No special precautions</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Potential Drug-Drug Interaction between warfarin (product) and NSAID (product)</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Increased risk of bleeding.
Bleeding is a serious potential clinical consequence because it can result in death, life-threatening hospitalization, and disability.
Non-steroidal anti-inflammatory drugs (NSAIDs) have antiplatelet effects which increase the bleeding risk when combined with oral anticoagulants such as warfarin. The antiplatelet effect of NSAIDs lasts only as long as the NSAID is present in the circulation, unlike aspirin’s antiplatelet effect, which lasts for up to 2 weeks after aspirin is discontinued. NSAIDs also can cause peptic ulcers and most of the evidence for increased bleeding risk with NSAIDs plus warfarin is due to upper gastrointestinal bleeding (UGIB).
unknown.
unknown.</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-is-not-context-medication-topical-diclofenac">Is not context medication topical diclofenac</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-summary">Get Base Summary</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: activity.extension
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-indicator">Get Base Indicator</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between warfarin (product) and NSAID (product))</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Assess risk and take action if necessary.</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">If the NSAID is being used as an analgesic or antipyretic, it would be prudent to use an alternative such as acetaminophen. In some people, acetaminophen can increase the anticoagulant effect of warfarin, so monitor the INR if acetaminophen is used in doses over 2 g/day for a few days. For more severe pain consider short-term opioids in place of the NSAID.</td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
remove from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-action-type.html">http://terminology.hl7.org/CodeSystem/action-type</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between warfarin (product) and NSAID (product))</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Substitute NSAID (product) with APAP (product).</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Order for APAP <2g per day (APAP 500 mg every 4-6 hours prn).</td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
create from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-action-type.html">http://terminology.hl7.org/CodeSystem/action-type</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Definition</th>
<td class="content-container"><a href="ActivityDefinition-ad101.html">ActivityDefinition AD101</a></td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-label-1">Get Base Label 1</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Potential Drug-Drug Interaction between warfarin (product) and NSAID (product))</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Substitute NSAID (product) with APAP (product).</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Order for APAP <2g per day (APAP 500 mg every 4-6 hours prn).</td>
</tr>
<tr>
<th scope="row" class="row-header">Type</th>
<td class="content-container">
create from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-action-type.html">http://terminology.hl7.org/CodeSystem/action-type</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Definition</th>
<td class="content-container"><a href="ActivityDefinition-ad102.html">ActivityDefinition AD102</a></td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-base-label-2">Get Base Label 2</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Patient is (not) taking a proton pump inhibitor (product) or misoprostol (product).</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Proton pump inhibitors and misoprostol may reduce the risk of UGIB in patients receiving NSAIDs and warfarin.</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-is-not-context-medication-topical-diclofenac">Is not context medication topical diclofenac</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-2-summary">Get Card 2 Summary</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.description
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-2-detail">Get Card 2 Detail</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: activity.extension
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-2-indicator">Get Card 2 Indicator</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Patient is (not) taking a proton pump inhibitor (product) or misoprostol (product).)</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Assess risk and take action if necessary.</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-2-label">Get Card 2 Label</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Patient is (not) 65 y/o and/or does (not) have a history of upper gastrointestinal bleed</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Patients with a history of UGIB or peptic ulcer may have an increased risk of UGIB from this interaction. The extent to which older age is an independent risk factor for UGIB due to these interactions is not firmly established, but UGIB in general is known to increase with age</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-is-not-context-medication-topical-diclofenac">Is not context medication topical diclofenac</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-3-summary">Get Card 3 Summary</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.description
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-3-detail">Get Card 3 Detail</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: activity.extension
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-3-indicator">Get Card 3 Indicator</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Patient is (not) 65 y/o and/or does (not) have a history of upper gastrointestinal bleed)</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Assess risk and take action if necessary.</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-3-label">Get Card 3 Label</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Patient is (not) concomitantly taking systemic corticosteroids, aldosterone antagonist, or high dose or multiple NSAIDs</td>
</tr>
<tr>
<th scope="row" class="row-header">Description</th>
<td class="content-container">Both corticosteroids and aldosterone antagonists have been shown to subsetantially increase the risk of UGIB in patients on NSAIDs, with relative risks of 12.8 and 11 respectively compared to a risk of 4.3 with NSAIDs alone (Masclee et al. Gastroenterology 2014; 147:784-92.)</td>
</tr>
<tr>
<th scope="row" class="row-header">Condition</th>
<td class="content-container">
<em>Kind</em>: Applicability
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-is-not-context-medication-topical-diclofenac">Is not context medication topical diclofenac</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-4-summary">Get Card 4 Summary</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.description
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-4-detail">Get Card 4 Detail</a>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: activity.extension
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-4-indicator">Get Card 4 Indicator</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Sub-Action (Parent Action Title: Patient is (not) concomitantly taking systemic corticosteroids, aldosterone antagonist, or high dose or multiple NSAIDs)</th>
</tr>
<tr>
<th scope="row" class="row-header">Title</th>
<td class="content-container">Assess risk and take action if necessary.</td>
</tr>
<tr>
<th scope="row" class="row-header">Dynamic Value</th>
<td class="content-container">
<em>Path</em>: action.title
<br/>
<em>Logic Definition</em>: <a href="#warfarinnsaidscdslogic-get-card-4-label">Get Card 4 Label</a>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">PlanDefinition Logic</th>
</tr>
<tr>
<th scope="row" class="row-header">Primary Library</th>
<td class="content-container"><a href="Library-WarfarinNSAIDsCDSLogic.html">Warfarin-NSAIDs CDS Logic</a></td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: FHIR model information
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html">http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library FHIRHelpers
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html">http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library FHIRCommon
<br/>
<em>Resource</em>: <a href="http://hl7.org/fhir/uv/cql/STU2/Library-FHIRCommon.html">http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Library Common
<br/>
<em>Resource</em>: <a href="Library-PDDICDSCommon.html">Potential Drug-Durg Interaction (PDDI) Clinical Decision Support (CDS) Common Logic</a> version: 1.0.0
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/Library/PDDICDSCommon|1.0.0</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Code system RXNORM
<br/>
<em>Resource</em>: <a href="http://terminology.hl7.org/6.5.0/CodeSystem-v3-rxNorm.html">RxNorm</a>
<br/>
<em>Canonical URL</em>: <tt>http://www.nlm.nih.gov/research/umls/rxnorm</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set Topical Diclofenac
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-topicaldiclofenac.html">Topical Diclofenac Medications Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-topicaldiclofenac</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set PPIs and Misoprostols
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-PPIS.html">Proton Pump Inhibitor Drug Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set Warfarins
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-warfarin.html">Warfarin Medications Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set NSAIDs
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-NSAIDS.html">Nonsteroidal Anti-inflammatory Drugs Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set History of GI Bleeds
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-Hx-UGIB-snomed.html">Upper gastrointestinal bleed Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-Hx-UGIB-snomed</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set Systemic Corticosteroids
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-SCS.html">Systemic Corticosteroid Drug Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Dependency</th>
<td class="content-container">
<em>Description</em>: Value set Aldosterone Antagonists
<br/>
<em>Resource</em>: <a href="ValueSet-valueset-AAS.html">Aldosterone Antagonists Drug Value Set</a>
<br/>
<em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS</tt>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Parameter</th>
<td class="content-container">
<table>
<thead>
<tr>
<td><em>Name</em></td>
<td><em>Use</em></td>
<td><em>Card.</em></td>
<td><em>Type</em></td>
<td><em>Documentation</em></td>
</tr>
</thead>
<tbody>
<tr>
<td>ContextPrescriptions</td>
<td>In</td>
<td>0..*</td>
<td>MedicationRequest</td>
<td/>
</tr>
<tr>
<td>Get Base Indicator</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 2 Summary</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Inclusion Criteria</td>
<td>Out</td>
<td>0..1</td>
<td>boolean</td>
<td/>
</tr>
<tr>
<td>Get Card 3 Summary</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 4 Summary</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 2 Detail</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Is context medication topical diclofenac</td>
<td>Out</td>
<td>0..1</td>
<td>boolean</td>
<td/>
</tr>
<tr>
<td>Get Base Label 2</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 2 Label</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Base Label 1</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 4 Detail</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 4 Indicator</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 3 Detail</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 3 Indicator</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Is not context medication topical diclofenac</td>
<td>Out</td>
<td>0..1</td>
<td>boolean</td>
<td/>
</tr>
<tr>
<td>Get Card 3 Label</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 2 Indicator</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Base Summary</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
<tr>
<td>Get Card 4 Label</td>
<td>Out</td>
<td>0..1</td>
<td>string</td>
<td/>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="section-header"><a name="effective-data-requirements"> </a>PlanDefinition Logic Data Requirements</th>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Patient
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication, authoredOn
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-PPIS.html">Proton Pump Inhibitor Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication, authoredOn
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-warfarin.html">Warfarin Medications Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication, authoredOn
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-SCS.html">Systemic Corticosteroid Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication, authoredOn
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-AAS.html">Aldosterone Antagonists Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication, authoredOn
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-NSAIDS.html">Nonsteroidal Anti-inflammatory Drugs Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationRequest
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
<br/>
<em>Must Support Elements</em>: medication.reference, medication, authoredOn
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Medication
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medication.html">Medication</a>
<br/>
<em>Must Support Elements</em>: id, code
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-PPIS.html">Proton Pump Inhibitor Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-warfarin.html">Warfarin Medications Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-SCS.html">Systemic Corticosteroid Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-AAS.html">Aldosterone Antagonists Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-NSAIDS.html">Nonsteroidal Anti-inflammatory Drugs Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationAdministration
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
<br/>
<em>Must Support Elements</em>: medication.reference, effective, medication
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication, whenHandedOver
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-PPIS.html">Proton Pump Inhibitor Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication, whenHandedOver
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-warfarin.html">Warfarin Medications Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication, whenHandedOver
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-SCS.html">Systemic Corticosteroid Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication, whenHandedOver
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-AAS.html">Aldosterone Antagonists Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication, whenHandedOver
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-NSAIDS.html">Nonsteroidal Anti-inflammatory Drugs Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationDispense
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationdispense.html">MedicationDispense</a>
<br/>
<em>Must Support Elements</em>: medication.reference, whenHandedOver, medication
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-PPIS.html">Proton Pump Inhibitor Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-warfarin.html">Warfarin Medications Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-SCS.html">Systemic Corticosteroid Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-AAS.html">Aldosterone Antagonists Drug Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication, effective
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: medication</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-NSAIDS.html">Nonsteroidal Anti-inflammatory Drugs Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: MedicationStatement
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/medicationstatement.html">MedicationStatement</a>
<br/>
<em>Must Support Elements</em>: medication.reference, effective, medication
<br/>
</td>
</tr>
<tr>
<th scope="row" class="row-header">Data Requirement</th>
<td class="content-container">
<em>Type</em>: Condition
<br/>
<em>Profile(s)</em>:
<a href="http://hl7.org/fhir/R4/condition.html">Condition</a>
<br/>
<em>Must Support Elements</em>: code
<br/>
<em>Code Filter(s)</em>:
<br/>
<span class="tab-one"><em>Path</em>: code</span>
<br/>
<span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-valueset-Hx-UGIB-snomed.html">Upper gastrointestinal bleed Value Set</a>
<br/>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-topical-diclofenac-prescription"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Topical Diclofenac Prescription":
ContextPrescriptions P
where P.medication in "Topical Diclofenac"
return P.medication as CodeableConcept</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-is-context-medication-topical-diclofenac"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Is context medication topical diclofenac":
exists ("Topical Diclofenac Prescription")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-base-indicator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Base Indicator":
if "Is context medication topical diclofenac"
then 'info'
else 'warning'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-ppis-and-misoprostols-rx"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "PPIs and Misoprostols Rx":
(
[MedicationRequest: "PPIs and Misoprostols"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "PPIs and Misoprostols"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "PPIs and Misoprostols"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "PPIs and Misoprostols"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-taking-ppi-or-misoprostol"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Taking PPI or misoprostol":
exists ("PPIs and Misoprostols Rx")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-2-summary"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 2 Summary":
if "Taking PPI or misoprostol"
then 'Patient is taking a proton pump inhibitor ('
+ Common.GetDrugNames("PPIs and Misoprostols Rx")
+ ').'
else 'Patient is not taking a proton pump inhibitor or misoprostol.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-warfarin-rx"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Warfarin Rx":
(
[MedicationRequest: "Warfarins"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Warfarins"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Warfarins"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Warfarins"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-is-warfarin-in-prefetch"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Is warfarin in prefetch":
exists ("Warfarin Rx")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-nsaid-prescription"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "NSAID Prescription":
ContextPrescriptions P
where P.medication in "NSAIDs"
return P.medication as CodeableConcept</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-is-context-medication-systemic-nsaid"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Is context medication systemic NSAID":
exists ("NSAID Prescription")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-inclusion-criteria"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
**
** Warfarin NSAID CDS Recommendation
**
*/
define "Inclusion Criteria":
if "Is context medication topical diclofenac"
then "Is warfarin in prefetch"
else (
"Is context medication systemic NSAID"
and "Is warfarin in prefetch"
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-gi-bleeds-condition"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "GI Bleeds Condition":
Last(
[Condition: "History of GI Bleeds"] C
sort by assertedDate().value
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-age->-65-years-or-hx-ugib"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Age > 65 years or Hx UGIB":
"GI Bleeds Condition" is not null
or AgeInYears() > 65</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-3-summary"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 3 Summary":
if "Age > 65 years or Hx UGIB"
then 'Patient is 65 y/o or does have a history of upper gastrointestinal bleed ("'
+ Common.GetConditionName("GI Bleeds Condition")
+ '" and '
+ Common.GetAssertedDate("GI Bleeds Condition")
+ ').'
else 'Patient is not 65 y/o and does not have a history of upper gastrointestinal bleed.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-systemic-corticosteroids-rx"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Systemic Corticosteroids Rx":
(
[MedicationRequest: "Systemic Corticosteroids"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Systemic Corticosteroids"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Systemic Corticosteroids"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Systemic Corticosteroids"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-has-systemic-corticosteroids"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Has Systemic Corticosteroids":
exists ("Systemic Corticosteroids Rx")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-aldosterone-antagonists-rx"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Aldosterone Antagonists Rx":
(
[MedicationRequest: "Aldosterone Antagonists"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Aldosterone Antagonists"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Aldosterone Antagonists"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Aldosterone Antagonists"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-has-aldosterone-antagonists"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Has Aldosterone Antagonists":
exists ("Aldosterone Antagonists Rx")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-nsaid-rx"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "NSAID Rx":
(
[MedicationRequest: "NSAIDs"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "NSAIDs"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "NSAIDs"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "NSAIDs"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-has-nsaid"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Has NSAID":
exists ("NSAID Rx")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-taking-cs,-mcra,-or-nsaid"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Taking CS, MCRA, or NSAID":
"Has Systemic Corticosteroids"
or "Has Aldosterone Antagonists"
or "Has NSAID"</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-4-summary"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 4 Summary":
if "Taking CS, MCRA, or NSAID"
then 'Patient is concomitantly taking systemic corticosteroids ('
+ Common.GetDrugNames("Systemic Corticosteroids Rx")
+ '), aldosterone antagonist ('
+ Common.GetDrugNames("Aldosterone Antagonists Rx")
+ '), or high dose or multiple NSAIDs ('
+ Common.GetDrugNames("NSAID Rx")
+ ').'
else 'Patient is not concomitantly taking systemic corticosteroids, aldosterone antagonist, or high dose or multiple NSAIDs.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-2-detail"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 2 Detail":
'Proton pump inhibitors and misoprostol may reduce the risk of UGIB in patients receiving NSAIDs and warfarin.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-acetaminophen-500-mg"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Acetaminophen 500 MG": Code '198440' from "RXNORM" display 'Acetaminophen 500 MG Oral Tablet'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-base-label-2"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Base Label 2":
'Substitute NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ') with APAP ('
+ Common.ToString("Acetaminophen 500 MG")
+ ').'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-2-label"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 2 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else 'Use only if benefit outweighs risk.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-acetaminophen-325-mg"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Acetaminophen 325 MG": Code '313782' from "RXNORM" display 'Acetaminophen 325 MG Oral Tablet'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-base-label-1"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Base Label 1":
'Substitute NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ') with APAP ('
+ Common.ToString("Acetaminophen 325 MG")
+ ').'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-4-detail"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 4 Detail":
'Both corticosteroids and aldosterone antagonists have been shown to subsetantially increase the risk of UGIB in patients on NSAIDs, with relative risks of 12.8 and 11 respectively compared to a risk of 4.3 with NSAIDs alone (Masclee et al. Gastroenterology 2014; 147:784-92.)'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-4-indicator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Card 4: Systemic Corticosteroids or Aldosterone Antagonist
define "Get Card 4 Indicator":
if "Taking CS, MCRA, or NSAID"
then 'warning'
else 'info'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-3-detail"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 3 Detail":
'Patients with a history of UGIB or peptic ulcer may have an increased risk of UGIB from this interaction. The extent to which older age is an independent risk factor for UGIB due to these interactions is not firmly established, but UGIB in general is known to increase with age.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-3-indicator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Card 3: History of UGIB/peptic ulcer or > 65 years old
define "Get Card 3 Indicator":
if "Age > 65 years or Hx UGIB"
then 'warning'
else 'info'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-is-not-context-medication-topical-diclofenac"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Is not context medication topical diclofenac":
not exists ("Topical Diclofenac Prescription")</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-3-label"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 3 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else if "Age > 65 years or Hx UGIB"
then 'Use only if benefit outweighs risk.'
else 'Assess risk and take action if necessary.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-2-indicator"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Card 2: PPI or misoprostol
define "Get Card 2 Indicator":
if "Taking PPI or misoprostol"
then 'info'
else 'critical'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-base-summary"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// Card 1: Base
define "Get Base Summary":
'Potential Drug-Drug Interaction between warfarin ('
+ Common.GetDrugNames("Warfarin Rx")
+ ') and NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ').'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> WarfarinNSAIDsCDSLogic</td>
</tr>
<tr>
<td>
<a name="warfarinnsaidscdslogic-get-card-4-label"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define "Get Card 4 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else if "Taking CS, MCRA, or NSAID"
then 'Use only if benefit outweighs risk.'
else 'Assess risk and take action if necessary.'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-tointerval"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range 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 FHIR, allowing this function to be used across any resource.
The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
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 Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.
NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
case
when choice is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
when choice is FHIR.Period then
FHIRHelpers.ToInterval(choice as FHIR.Period)
when choice is FHIR.instant then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
when choice is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
when choice is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
when choice is FHIR.Timing then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
when choice is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else
null as Interval<DateTime>
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-ext"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
singleton from domainResource.exts(url)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRCommon</td>
</tr>
<tr>
<td>
<a name="fhircommon-exts"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
domainResource.extension E
where E.url = url
return E</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-toconcept"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@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
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tocode"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@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
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todatetime"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tointerval"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@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]</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todatetime"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value instant): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-todate"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDate(value date): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-toquantity"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity)
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tocalendarunit"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities)
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> FHIRHelpers</td>
</tr>
<tr>
<td>
<a name="fhirhelpers-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value uri): value.value</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-getdrugnames"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function GetDrugNames(codes List<FHIR.CodeableConcept>):
Combine(
flatten(
codes C
return C.coding coding
return ToCode(coding).display
)
,', '
)</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-tocode"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToCode(coding FHIR.Coding):
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-asserteddate"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function assertedDate(condition Condition):
condition.ext('http://hl7.org/fhir/StructureDefinition/condition-assertedDate').value as dateTime</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-getconditionname"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function GetConditionName(condition Condition):
if condition is not null
then condition.code.coding[0].display.value
else 'NA'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-getasserteddate"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function GetAssertedDate(condition Condition):
if condition is not null
then ToString(condition.assertedDate().value)
else 'NA'</code></pre>
</td>
</tr>
<tr>
<th scope="row" rowspan="2" class="row-header">
Logic Definition
</th>
<td class="content-container"><em>Library Name:</em> PDDICDSCommon</td>
</tr>
<tr>
<td>
<a name="pddicdscommon-tostring"> </a>
<pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value Code): value.display</code></pre>
</td>
</tr>
<tr>
<th colspan="2" scope="row" class="row-header">Generated using version 0.5.6-cibuild of the sample-content-ig Liquid templates</th>
</tr>
</tbody>
</table>
</div>
</text>
<contained>
<Library>
<id value="effective-data-requirements"/>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Topical Diclofenac Prescription"/>
</extension>
<extension url="statement">
<valueString
value="define "Topical Diclofenac Prescription":
ContextPrescriptions P
where P.medication in "Topical Diclofenac"
return P.medication as CodeableConcept"/>
</extension>
<extension url="displaySequence">
<valueInteger value="0"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Is context medication topical diclofenac"/>
</extension>
<extension url="statement">
<valueString
value="define "Is context medication topical diclofenac":
exists ("Topical Diclofenac Prescription")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="1"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Base Indicator"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Base Indicator":
if "Is context medication topical diclofenac"
then 'info'
else 'warning'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="2"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="PPIs and Misoprostols Rx"/>
</extension>
<extension url="statement">
<valueString
value="define "PPIs and Misoprostols Rx":
(
[MedicationRequest: "PPIs and Misoprostols"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "PPIs and Misoprostols"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "PPIs and Misoprostols"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "PPIs and Misoprostols"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="3"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Taking PPI or misoprostol"/>
</extension>
<extension url="statement">
<valueString
value="define "Taking PPI or misoprostol":
exists ("PPIs and Misoprostols Rx")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="4"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 2 Summary"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 2 Summary":
if "Taking PPI or misoprostol"
then 'Patient is taking a proton pump inhibitor ('
+ Common.GetDrugNames("PPIs and Misoprostols Rx")
+ ').'
else 'Patient is not taking a proton pump inhibitor or misoprostol.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="5"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Warfarin Rx"/>
</extension>
<extension url="statement">
<valueString
value="define "Warfarin Rx":
(
[MedicationRequest: "Warfarins"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Warfarins"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Warfarins"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Warfarins"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="6"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Is warfarin in prefetch"/>
</extension>
<extension url="statement">
<valueString
value="define "Is warfarin in prefetch":
exists ("Warfarin Rx")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="7"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="NSAID Prescription"/>
</extension>
<extension url="statement">
<valueString
value="define "NSAID Prescription":
ContextPrescriptions P
where P.medication in "NSAIDs"
return P.medication as CodeableConcept"/>
</extension>
<extension url="displaySequence">
<valueInteger value="8"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Is context medication systemic NSAID"/>
</extension>
<extension url="statement">
<valueString
value="define "Is context medication systemic NSAID":
exists ("NSAID Prescription")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="9"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Inclusion Criteria"/>
</extension>
<extension url="statement">
<valueString
value="/*
**
** Warfarin NSAID CDS Recommendation
**
*/
define "Inclusion Criteria":
if "Is context medication topical diclofenac"
then "Is warfarin in prefetch"
else (
"Is context medication systemic NSAID"
and "Is warfarin in prefetch"
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="10"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="GI Bleeds Condition"/>
</extension>
<extension url="statement">
<valueString
value="define "GI Bleeds Condition":
Last(
[Condition: "History of GI Bleeds"] C
sort by assertedDate().value
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="11"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Age > 65 years or Hx UGIB"/>
</extension>
<extension url="statement">
<valueString
value="define "Age > 65 years or Hx UGIB":
"GI Bleeds Condition" is not null
or AgeInYears() > 65"/>
</extension>
<extension url="displaySequence">
<valueInteger value="12"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 3 Summary"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 3 Summary":
if "Age > 65 years or Hx UGIB"
then 'Patient is 65 y/o or does have a history of upper gastrointestinal bleed ("'
+ Common.GetConditionName("GI Bleeds Condition")
+ '" and '
+ Common.GetAssertedDate("GI Bleeds Condition")
+ ').'
else 'Patient is not 65 y/o and does not have a history of upper gastrointestinal bleed.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="13"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Systemic Corticosteroids Rx"/>
</extension>
<extension url="statement">
<valueString
value="define "Systemic Corticosteroids Rx":
(
[MedicationRequest: "Systemic Corticosteroids"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Systemic Corticosteroids"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Systemic Corticosteroids"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Systemic Corticosteroids"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="14"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Has Systemic Corticosteroids"/>
</extension>
<extension url="statement">
<valueString
value="define "Has Systemic Corticosteroids":
exists ("Systemic Corticosteroids Rx")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="15"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Aldosterone Antagonists Rx"/>
</extension>
<extension url="statement">
<valueString
value="define "Aldosterone Antagonists Rx":
(
[MedicationRequest: "Aldosterone Antagonists"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "Aldosterone Antagonists"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "Aldosterone Antagonists"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "Aldosterone Antagonists"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="16"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Has Aldosterone Antagonists"/>
</extension>
<extension url="statement">
<valueString
value="define "Has Aldosterone Antagonists":
exists ("Aldosterone Antagonists Rx")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="17"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="NSAID Rx"/>
</extension>
<extension url="statement">
<valueString
value="define "NSAID Rx":
(
[MedicationRequest: "NSAIDs"] MR
where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
return MR.medication as CodeableConcept
)
union (
[MedicationAdministration: "NSAIDs"] MA
where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MA.medication as CodeableConcept
)
union (
[MedicationDispense: "NSAIDs"] MD
where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
return MD.medication as CodeableConcept
)
union (
[MedicationStatement: "NSAIDs"] MS
where MS.effective.toInterval() overlaps Interval[Today() - 100 days, null]
return MS.medication as CodeableConcept
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="18"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Has NSAID"/>
</extension>
<extension url="statement">
<valueString
value="define "Has NSAID":
exists ("NSAID Rx")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="19"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Taking CS, MCRA, or NSAID"/>
</extension>
<extension url="statement">
<valueString
value="define "Taking CS, MCRA, or NSAID":
"Has Systemic Corticosteroids"
or "Has Aldosterone Antagonists"
or "Has NSAID""/>
</extension>
<extension url="displaySequence">
<valueInteger value="20"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 4 Summary"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 4 Summary":
if "Taking CS, MCRA, or NSAID"
then 'Patient is concomitantly taking systemic corticosteroids ('
+ Common.GetDrugNames("Systemic Corticosteroids Rx")
+ '), aldosterone antagonist ('
+ Common.GetDrugNames("Aldosterone Antagonists Rx")
+ '), or high dose or multiple NSAIDs ('
+ Common.GetDrugNames("NSAID Rx")
+ ').'
else 'Patient is not concomitantly taking systemic corticosteroids, aldosterone antagonist, or high dose or multiple NSAIDs.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="21"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 2 Detail"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 2 Detail":
'Proton pump inhibitors and misoprostol may reduce the risk of UGIB in patients receiving NSAIDs and warfarin.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="22"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Acetaminophen 500 MG"/>
</extension>
<extension url="statement">
<valueString
value="define "Acetaminophen 500 MG": Code '198440' from "RXNORM" display 'Acetaminophen 500 MG Oral Tablet'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="23"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Base Label 2"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Base Label 2":
'Substitute NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ') with APAP ('
+ Common.ToString("Acetaminophen 500 MG")
+ ').'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="24"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 2 Label"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 2 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else 'Use only if benefit outweighs risk.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="25"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Acetaminophen 325 MG"/>
</extension>
<extension url="statement">
<valueString
value="define "Acetaminophen 325 MG": Code '313782' from "RXNORM" display 'Acetaminophen 325 MG Oral Tablet'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="26"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Base Label 1"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Base Label 1":
'Substitute NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ') with APAP ('
+ Common.ToString("Acetaminophen 325 MG")
+ ').'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="27"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 4 Detail"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 4 Detail":
'Both corticosteroids and aldosterone antagonists have been shown to subsetantially increase the risk of UGIB in patients on NSAIDs, with relative risks of 12.8 and 11 respectively compared to a risk of 4.3 with NSAIDs alone (Masclee et al. Gastroenterology 2014; 147:784-92.)'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="28"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 4 Indicator"/>
</extension>
<extension url="statement">
<valueString
value="// Card 4: Systemic Corticosteroids or Aldosterone Antagonist
define "Get Card 4 Indicator":
if "Taking CS, MCRA, or NSAID"
then 'warning'
else 'info'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="29"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 3 Detail"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 3 Detail":
'Patients with a history of UGIB or peptic ulcer may have an increased risk of UGIB from this interaction. The extent to which older age is an independent risk factor for UGIB due to these interactions is not firmly established, but UGIB in general is known to increase with age.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="30"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 3 Indicator"/>
</extension>
<extension url="statement">
<valueString
value="// Card 3: History of UGIB/peptic ulcer or > 65 years old
define "Get Card 3 Indicator":
if "Age > 65 years or Hx UGIB"
then 'warning'
else 'info'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="31"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Is not context medication topical diclofenac"/>
</extension>
<extension url="statement">
<valueString
value="define "Is not context medication topical diclofenac":
not exists ("Topical Diclofenac Prescription")"/>
</extension>
<extension url="displaySequence">
<valueInteger value="32"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 3 Label"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 3 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else if "Age > 65 years or Hx UGIB"
then 'Use only if benefit outweighs risk.'
else 'Assess risk and take action if necessary.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="33"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 2 Indicator"/>
</extension>
<extension url="statement">
<valueString
value="// Card 2: PPI or misoprostol
define "Get Card 2 Indicator":
if "Taking PPI or misoprostol"
then 'info'
else 'critical'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="34"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Base Summary"/>
</extension>
<extension url="statement">
<valueString
value="// Card 1: Base
define "Get Base Summary":
'Potential Drug-Drug Interaction between warfarin ('
+ Common.GetDrugNames("Warfarin Rx")
+ ') and NSAID ('
+ Common.GetDrugNames("NSAID Prescription")
+ ').'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="35"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="WarfarinNSAIDsCDSLogic"/>
</extension>
<extension url="name">
<valueString value="Get Card 4 Label"/>
</extension>
<extension url="statement">
<valueString
value="define "Get Card 4 Label":
if "Taking PPI or misoprostol"
then 'Assess risk and take action if necessary.'
else if "Taking CS, MCRA, or NSAID"
then 'Use only if benefit outweighs risk.'
else 'Assess risk and take action if necessary.'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="36"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToConcept"/>
</extension>
<extension url="statement">
<valueString
value="/*
@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
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="37"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToCode"/>
</extension>
<extension url="statement">
<valueString
value="/*
@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
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="38"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value string): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="39"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="toInterval"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range 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 FHIR, allowing this function to be used across any resource.
The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
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 Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.
NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
case
when choice is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
when choice is FHIR.Period then
FHIRHelpers.ToInterval(choice as FHIR.Period)
when choice is FHIR.instant then
Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
when choice is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
when choice is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
when choice is FHIR.Timing then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
when choice is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else
null as Interval<DateTime>
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="40"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDateTime"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDateTime(value dateTime): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="41"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToInterval"/>
</extension>
<extension url="statement">
<valueString
value="/*
@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]"/>
</extension>
<extension url="displaySequence">
<valueInteger value="42"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDateTime"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDateTime(value instant): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="43"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToDate"/>
</extension>
<extension url="statement">
<valueString
value="define function ToDate(value date): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="44"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToQuantity"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity)
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="45"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToCalendarUnit"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities)
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end"/>
</extension>
<extension url="displaySequence">
<valueInteger value="46"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="GetDrugNames"/>
</extension>
<extension url="statement">
<valueString
value="define function GetDrugNames(codes List<FHIR.CodeableConcept>):
Combine(
flatten(
codes C
return C.coding coding
return ToCode(coding).display
)
,', '
)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="47"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="ToCode"/>
</extension>
<extension url="statement">
<valueString
value="define function ToCode(coding FHIR.Coding):
System.Code {
code: coding.code.value,
system: coding.system.value,
version: coding.version.value,
display: coding.display.value
}"/>
</extension>
<extension url="displaySequence">
<valueInteger value="48"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="assertedDate"/>
</extension>
<extension url="statement">
<valueString
value="define fluent function assertedDate(condition Condition):
condition.ext('http://hl7.org/fhir/StructureDefinition/condition-assertedDate').value as dateTime"/>
</extension>
<extension url="displaySequence">
<valueInteger value="49"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="ext"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns the single extension (if present) on the given resource with the specified url.
@comment: This function uses singleton from to ensure that a run-time exception is thrown if there
is more than one extension on the given resource with the specified url.
*/
define fluent function ext(domainResource DomainResource, url String):
singleton from domainResource.exts(url)"/>
</extension>
<extension url="displaySequence">
<valueInteger value="50"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRCommon"/>
</extension>
<extension url="name">
<valueString value="exts"/>
</extension>
<extension url="statement">
<valueString
value="/*
@description: Returns any extensions defined on the given resource with the specified url
*/
define fluent function exts(domainResource DomainResource, url String):
domainResource.extension E
where E.url = url
return E"/>
</extension>
<extension url="displaySequence">
<valueInteger value="51"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="FHIRHelpers"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value uri): value.value"/>
</extension>
<extension url="displaySequence">
<valueInteger value="52"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="GetConditionName"/>
</extension>
<extension url="statement">
<valueString
value="define function GetConditionName(condition Condition):
if condition is not null
then condition.code.coding[0].display.value
else 'NA'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="53"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="GetAssertedDate"/>
</extension>
<extension url="statement">
<valueString
value="define function GetAssertedDate(condition Condition):
if condition is not null
then ToString(condition.assertedDate().value)
else 'NA'"/>
</extension>
<extension url="displaySequence">
<valueInteger value="54"/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
<extension url="libraryName">
<valueString value="PDDICDSCommon"/>
</extension>
<extension url="name">
<valueString value="ToString"/>
</extension>
<extension url="statement">
<valueString
value="define function ToString(value Code): value.display"/>
</extension>
<extension url="displaySequence">
<valueInteger value="55"/>
</extension>
</extension>
<name value="EffectiveDataRequirements"/>
<status value="active"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/library-type"/>
<code value="module-definition"/>
</coding>
</type>
<relatedArtifact>
<type value="depends-on"/>
<display value="FHIR model information"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library FHIRHelpers"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library FHIRCommon"/>
<resource
value="http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library Common"/>
<resource
value="http://hl7.org/fhir/uv/pddi/Library/PDDICDSCommon|1.0.0"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system RXNORM"/>
<resource value="http://www.nlm.nih.gov/research/umls/rxnorm"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Topical Diclofenac"/>
<resource
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-topicaldiclofenac"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set PPIs and Misoprostols"/>
<resource value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Warfarins"/>
<resource
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set NSAIDs"/>
<resource
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set History of GI Bleeds"/>
<resource
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-Hx-UGIB-snomed"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Systemic Corticosteroids"/>
<resource value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Aldosterone Antagonists"/>
<resource value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"/>
</relatedArtifact>
<parameter>
<name value="ContextPrescriptions"/>
<use value="in"/>
<min value="0"/>
<max value="*"/>
<type value="MedicationRequest"/>
</parameter>
<parameter>
<name value="Get Base Indicator"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 2 Summary"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Inclusion Criteria"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="boolean"/>
</parameter>
<parameter>
<name value="Get Card 3 Summary"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 4 Summary"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 2 Detail"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Is context medication topical diclofenac"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="boolean"/>
</parameter>
<parameter>
<name value="Get Base Label 2"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 2 Label"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Base Label 1"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 4 Detail"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 4 Indicator"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 3 Detail"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 3 Indicator"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Is not context medication topical diclofenac"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="boolean"/>
</parameter>
<parameter>
<name value="Get Card 3 Label"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 2 Indicator"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Base Summary"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<parameter>
<name value="Get Card 4 Label"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="string"/>
</parameter>
<dataRequirement>
<type value="Patient"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationRequest"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
<mustSupport value="medication.reference"/>
<mustSupport value="medication"/>
<mustSupport value="authoredOn"/>
</dataRequirement>
<dataRequirement>
<type value="Medication"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
<mustSupport value="id"/>
<mustSupport value="code"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="medication.reference"/>
<mustSupport value="effective"/>
<mustSupport value="medication"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication"/>
<mustSupport value="whenHandedOver"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication"/>
<mustSupport value="whenHandedOver"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication"/>
<mustSupport value="whenHandedOver"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication"/>
<mustSupport value="whenHandedOver"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication"/>
<mustSupport value="whenHandedOver"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationDispense"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationDispense"/>
<mustSupport value="medication.reference"/>
<mustSupport value="whenHandedOver"/>
<mustSupport value="medication"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-PPIS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-warfarin"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-SCS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-AAS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication"/>
<mustSupport value="effective"/>
<codeFilter>
<path value="medication"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-NSAIDS"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="MedicationStatement"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationStatement"/>
<mustSupport value="medication.reference"/>
<mustSupport value="effective"/>
<mustSupport value="medication"/>
</dataRequirement>
<dataRequirement>
<type value="Condition"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
<mustSupport value="code"/>
<codeFilter>
<path value="code"/>
<valueSet
value="http://hl7.org/fhir/uv/pddi/ValueSet/valueset-Hx-UGIB-snomed"/>
</codeFilter>
</dataRequirement>
</Library>
</contained>
<extension
url="http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options">
<extension url="code">
<valueString value="cache-for-order-sign-filtering"/>
</extension>
<extension url="type">
<valueString value="boolean"/>
</extension>
<extension url="name">
<valueString value="Cache Info for Order Sign Filtering"/>
</extension>
<extension url="description">
<valueString
value="Cache information about this CDS call so that additional filtering of card responses can be done when the service is called using an order-sign CDS Hook request. Currently, this only supports filtering out cards that were triggered by the same knowledge artifact when the physician reference display, encounter id, and patient id match between the order-select and order-sign requests. Filtering will happen if both this configuration option is set to 'true' and order-sign requests set filter-out-repeated-alerts to 'true'."/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options">
<extension url="code">
<valueString value="alert-non-serious"/>
</extension>
<extension url="type">
<valueString value="boolean"/>
</extension>
<extension url="name">
<valueString
value="Alert for non-serious potential drug-drug interactions"/>
</extension>
<extension url="description">
<valueString
value="Serious potential drug-drug interactions could result in death; requires hospitalization or extension of hospital stay; results in persistent or significant disability or incapacity; is life-threatening (see https://www.w3.org/2019/05/pddi/index.html). If set to True, this configuration option tells the CDS service to alerts for potential drug-drug interactions that do not meet this criterion."/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/uv/pddi/StructureDefinition/pddi-cds-configuration-options">
<extension url="code">
<valueString value="show-evidence-support"/>
</extension>
<extension url="type">
<valueString value="boolean"/>
</extension>
<extension url="name">
<valueString value="Show evidence support"/>
</extension>
<extension url="description">
<valueString
value="If this options is set to True, CDS response cards will provide more complete information about the evidence that supports the potential drug-drug interaction alert."/>
</extension>
</extension>
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
<valueCode value="cds"/>
</extension>
<extension
url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
<valueCanonical value="#effective-data-requirements"/>
</extension>
<url
value="http://hl7.org/fhir/uv/pddi/PlanDefinition/warfarin-nsaids-cds-select"/>
<version value="1.0.0"/>
<name value="WarfarinNSAIDsOrderSelectRecommendation"/>
<title value="Warfarin NSAIDs Order Select Recommendation"/>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/plan-definition-type"/>
<code value="eca-rule"/>
<display value="ECA Rule"/>
</coding>
</type>
<status value="active"/>
<experimental value="true"/>
<date value="2026-06-17T14:03:14+00:00"/>
<publisher value="HL7 International / Clinical Decision Support"/>
<contact>
<telecom>
<system value="url"/>
<value value="http://www.hl7.org/Special/committees/dss"/>
</telecom>
</contact>
<description
value="Drug-drug interaction recommendation for use on order select of a warfarin or NSAID"/>
<jurisdiction>
<coding>
<system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
<code value="001"/>
</coding>
</jurisdiction>
<topic>
<text value="Warfarin NSAIDs Prescribing"/>
</topic>
<relatedArtifact>
<type value="documentation"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</relatedArtifact>
<library
value="http://hl7.org/fhir/uv/pddi/Library/WarfarinNSAIDsCDSLogic"/>
<action>
<trigger>
<type value="named-event"/>
<name value="order-select"/>
</trigger>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Inclusion Criteria"/>
</expression>
</condition>
<action>
<title
value="Potential Drug-Drug Interaction between warfarin (product) and NSAID (product)"/>
<description
value="Topical diclofenac has relatively low systemic absorption; in one study a topical gel (16 g/day) produced about 6% of the absorption seen with systemic administration of 150 mg/day. A higher than recommended dose of topical gel (48 g/day) produced 20% of a systemic dose of diclofenac."/>
<documentation>
<type value="derived-from"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Is context medication topical diclofenac"/>
</expression>
</condition>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Summary"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="activity.extension"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Indicator"/>
</expression>
</dynamicValue>
<action>
<title value="No special precautions"/>
</action>
</action>
<action>
<title
value="Potential Drug-Drug Interaction between warfarin (product) and NSAID (product)"/>
<description
value="Increased risk of bleeding.
Bleeding is a serious potential clinical consequence because it can result in death, life-threatening hospitalization, and disability.
Non-steroidal anti-inflammatory drugs (NSAIDs) have antiplatelet effects which increase the bleeding risk when combined with oral anticoagulants such as warfarin. The antiplatelet effect of NSAIDs lasts only as long as the NSAID is present in the circulation, unlike aspirin’s antiplatelet effect, which lasts for up to 2 weeks after aspirin is discontinued. NSAIDs also can cause peptic ulcers and most of the evidence for increased bleeding risk with NSAIDs plus warfarin is due to upper gastrointestinal bleeding (UGIB).
unknown.
unknown."/>
<documentation>
<type value="derived-from"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Is not context medication topical diclofenac"/>
</expression>
</condition>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Summary"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="activity.extension"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Indicator"/>
</expression>
</dynamicValue>
<action>
<title value="Assess risk and take action if necessary."/>
<description
value="If the NSAID is being used as an analgesic or antipyretic, it would be prudent to use an alternative such as acetaminophen. In some people, acetaminophen can increase the anticoagulant effect of warfarin, so monitor the INR if acetaminophen is used in doses over 2 g/day for a few days. For more severe pain consider short-term opioids in place of the NSAID."/>
<documentation>
<type value="derived-from"/>
<display
value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/action-type"/>
<code value="remove"/>
</coding>
</type>
</action>
<action>
<title value="Substitute NSAID (product) with APAP (product)."/>
<description
value="Order for APAP <2g per day (APAP 500 mg every 4-6 hours prn)."/>
<documentation>
<type value="derived-from"/>
<display
value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/action-type"/>
<code value="create"/>
</coding>
</type>
<definitionCanonical
value="http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad101"/>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Label 1"/>
</expression>
</dynamicValue>
</action>
<action>
<title value="Substitute NSAID (product) with APAP (product)."/>
<description
value="Order for APAP <2g per day (APAP 500 mg every 4-6 hours prn)."/>
<documentation>
<type value="derived-from"/>
<display
value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<type>
<coding>
<system
value="http://terminology.hl7.org/CodeSystem/action-type"/>
<code value="create"/>
</coding>
</type>
<definitionCanonical
value="http://hl7.org/fhir/uv/pddi/ActivityDefinition/ad102"/>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Base Label 2"/>
</expression>
</dynamicValue>
</action>
</action>
<action>
<title
value="Patient is (not) taking a proton pump inhibitor (product) or misoprostol (product)."/>
<description
value="Proton pump inhibitors and misoprostol may reduce the risk of UGIB in patients receiving NSAIDs and warfarin."/>
<documentation>
<type value="derived-from"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Is not context medication topical diclofenac"/>
</expression>
</condition>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 2 Summary"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="action.description"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 2 Detail"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="activity.extension"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 2 Indicator"/>
</expression>
</dynamicValue>
<action>
<title value="Assess risk and take action if necessary."/>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 2 Label"/>
</expression>
</dynamicValue>
</action>
</action>
<action>
<title
value="Patient is (not) 65 y/o and/or does (not) have a history of upper gastrointestinal bleed"/>
<description
value="Patients with a history of UGIB or peptic ulcer may have an increased risk of UGIB from this interaction. The extent to which older age is an independent risk factor for UGIB due to these interactions is not firmly established, but UGIB in general is known to increase with age"/>
<documentation>
<type value="derived-from"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Is not context medication topical diclofenac"/>
</expression>
</condition>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 3 Summary"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="action.description"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 3 Detail"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="activity.extension"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 3 Indicator"/>
</expression>
</dynamicValue>
<action>
<title value="Assess risk and take action if necessary."/>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 3 Label"/>
</expression>
</dynamicValue>
</action>
</action>
<action>
<title
value="Patient is (not) concomitantly taking systemic corticosteroids, aldosterone antagonist, or high dose or multiple NSAIDs"/>
<description
value="Both corticosteroids and aldosterone antagonists have been shown to subsetantially increase the risk of UGIB in patients on NSAIDs, with relative risks of 12.8 and 11 respectively compared to a risk of 4.3 with NSAIDs alone (Masclee et al. Gastroenterology 2014; 147:784-92.)"/>
<documentation>
<type value="derived-from"/>
<display value="Warfarin-NSAIDs clinical decision support algorithm"/>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
<document>
<url value="https://ddi-cds.org/warfarin-nsaids/"/>
</document>
</documentation>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Is not context medication topical diclofenac"/>
</expression>
</condition>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 4 Summary"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="action.description"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 4 Detail"/>
</expression>
</dynamicValue>
<dynamicValue>
<path value="activity.extension"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 4 Indicator"/>
</expression>
</dynamicValue>
<action>
<title value="Assess risk and take action if necessary."/>
<dynamicValue>
<path value="action.title"/>
<expression>
<language value="text/cql-identifier"/>
<expression value="Get Card 4 Label"/>
</expression>
</dynamicValue>
</action>
</action>
</action>
</PlanDefinition>