Potential Drug-Drug Interaction (PDDI) Clinical Decision Support
1.0.0 - STU 1 International flag

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

: Warfarin NSAIDs Order Sign Recommendation

Page standards status: Informative

Raw xml | Download


<PlanDefinition xmlns="http://hl7.org/fhir">
  <id value="warfarin-nsaids-cds-sign"/>
  <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 Sign 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-sign</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 &lt;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 &lt;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 &quot;Topical Diclofenac Prescription&quot;:
  ContextPrescriptions P
    where P.medication in &quot;Topical Diclofenac&quot;
    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 &quot;Is context medication topical diclofenac&quot;:
  exists (&quot;Topical Diclofenac Prescription&quot;)</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 &quot;Get Base Indicator&quot;:
  if &quot;Is context medication topical diclofenac&quot;
    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 &quot;PPIs and Misoprostols Rx&quot;:
    (
      [MedicationRequest: &quot;PPIs and Misoprostols&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;PPIs and Misoprostols&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;PPIs and Misoprostols&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;PPIs and Misoprostols&quot;] 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 &quot;Taking PPI or misoprostol&quot;:
  exists (&quot;PPIs and Misoprostols Rx&quot;)</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 &quot;Get Card 2 Summary&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Patient is taking a proton pump inhibitor ('
      + Common.GetDrugNames(&quot;PPIs and Misoprostols Rx&quot;)
      + ').'
  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 &quot;Warfarin Rx&quot;:
    (
      [MedicationRequest: &quot;Warfarins&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Warfarins&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Warfarins&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Warfarins&quot;] 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 &quot;Is warfarin in prefetch&quot;:
  exists (&quot;Warfarin Rx&quot;)</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 &quot;NSAID Prescription&quot;:
  ContextPrescriptions P
    where P.medication in &quot;NSAIDs&quot;
    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 &quot;Is context medication systemic NSAID&quot;:
  exists (&quot;NSAID Prescription&quot;)</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 &quot;Inclusion Criteria&quot;:
  if &quot;Is context medication topical diclofenac&quot;
    then &quot;Is warfarin in prefetch&quot;
  else (
    &quot;Is context medication systemic NSAID&quot;
      and &quot;Is warfarin in prefetch&quot;
  )</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 &quot;GI Bleeds Condition&quot;:
  Last(
    [Condition: &quot;History of GI Bleeds&quot;] 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-&gt;-65-years-or-hx-ugib"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Age &gt; 65 years or Hx UGIB&quot;:
  &quot;GI Bleeds Condition&quot; is not null
    or AgeInYears() &gt; 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 &quot;Get Card 3 Summary&quot;:
  if &quot;Age &gt; 65 years or Hx UGIB&quot;
    then 'Patient is 65 y/o or does have a history of upper gastrointestinal bleed (&quot;'
      + Common.GetConditionName(&quot;GI Bleeds Condition&quot;)
      + '&quot; and '
      + Common.GetAssertedDate(&quot;GI Bleeds Condition&quot;)
      + ').'
  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 &quot;Systemic Corticosteroids Rx&quot;:
    (
      [MedicationRequest: &quot;Systemic Corticosteroids&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Systemic Corticosteroids&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Systemic Corticosteroids&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Systemic Corticosteroids&quot;] 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 &quot;Has Systemic Corticosteroids&quot;:
  exists (&quot;Systemic Corticosteroids Rx&quot;)</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 &quot;Aldosterone Antagonists Rx&quot;:
    (
      [MedicationRequest: &quot;Aldosterone Antagonists&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Aldosterone Antagonists&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Aldosterone Antagonists&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Aldosterone Antagonists&quot;] 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 &quot;Has Aldosterone Antagonists&quot;:
  exists (&quot;Aldosterone Antagonists Rx&quot;)</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 &quot;NSAID Rx&quot;:
    (
      [MedicationRequest: &quot;NSAIDs&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;NSAIDs&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;NSAIDs&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;NSAIDs&quot;] 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 &quot;Has NSAID&quot;:
  exists (&quot;NSAID Rx&quot;)</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 &quot;Taking CS, MCRA, or NSAID&quot;:
  &quot;Has Systemic Corticosteroids&quot;
    or &quot;Has Aldosterone Antagonists&quot;
    or &quot;Has NSAID&quot;</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 &quot;Get Card 4 Summary&quot;:
  if &quot;Taking CS, MCRA, or NSAID&quot;
    then 'Patient is concomitantly taking systemic corticosteroids ('
      + Common.GetDrugNames(&quot;Systemic Corticosteroids Rx&quot;)
      + '), aldosterone antagonist ('
      + Common.GetDrugNames(&quot;Aldosterone Antagonists Rx&quot;)
      + '), or high dose or multiple NSAIDs ('
      + Common.GetDrugNames(&quot;NSAID Rx&quot;)
      + ').'
  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 &quot;Get Card 2 Detail&quot;:
  '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 &quot;Acetaminophen 500 MG&quot;: Code '198440' from &quot;RXNORM&quot; 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 &quot;Get Base Label 2&quot;:
  'Substitute NSAID ('
  + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
  + ') with APAP ('
  + Common.ToString(&quot;Acetaminophen 500 MG&quot;)
  + ').'</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 &quot;Get Card 2 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    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 &quot;Acetaminophen 325 MG&quot;: Code '313782' from &quot;RXNORM&quot; 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 &quot;Get Base Label 1&quot;:
  'Substitute NSAID ('
  + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
  + ') with APAP ('
  + Common.ToString(&quot;Acetaminophen 325 MG&quot;)
  + ').'</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 &quot;Get Card 4 Detail&quot;:
  '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 &quot;Get Card 4 Indicator&quot;:
  if &quot;Taking CS, MCRA, or NSAID&quot;
    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 &quot;Get Card 3 Detail&quot;:
  '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 &gt; 65 years old
define &quot;Get Card 3 Indicator&quot;:
  if &quot;Age &gt; 65 years or Hx UGIB&quot;
    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 &quot;Is not context medication topical diclofenac&quot;:
  not exists (&quot;Topical Diclofenac Prescription&quot;)</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 &quot;Get Card 3 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Assess risk and take action if necessary.'
  else if &quot;Age &gt; 65 years or Hx UGIB&quot;
    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 &quot;Get Card 2 Indicator&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    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 &quot;Get Base Summary&quot;:
  'Potential Drug-Drug Interaction between warfarin ('
    + Common.GetDrugNames(&quot;Warfarin Rx&quot;)
    + ') and NSAID ('
    + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
    + ').'</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 &quot;Get Card 4 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Assess risk and take action if necessary.'
  else if &quot;Taking CS, MCRA, or NSAID&quot;
    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&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  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&lt;DateTime&gt;, 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&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval&lt;DateTime&gt;
  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.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.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: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    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&lt;FHIR.CodeableConcept&gt;):
  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 &quot;Topical Diclofenac Prescription&quot;:
  ContextPrescriptions P
    where P.medication in &quot;Topical Diclofenac&quot;
    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 &quot;Is context medication topical diclofenac&quot;:
  exists (&quot;Topical Diclofenac Prescription&quot;)"/>
        </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 &quot;Get Base Indicator&quot;:
  if &quot;Is context medication topical diclofenac&quot;
    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 &quot;PPIs and Misoprostols Rx&quot;:
    (
      [MedicationRequest: &quot;PPIs and Misoprostols&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;PPIs and Misoprostols&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;PPIs and Misoprostols&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;PPIs and Misoprostols&quot;] 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 &quot;Taking PPI or misoprostol&quot;:
  exists (&quot;PPIs and Misoprostols Rx&quot;)"/>
        </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 &quot;Get Card 2 Summary&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Patient is taking a proton pump inhibitor ('
      + Common.GetDrugNames(&quot;PPIs and Misoprostols Rx&quot;)
      + ').'
  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 &quot;Warfarin Rx&quot;:
    (
      [MedicationRequest: &quot;Warfarins&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Warfarins&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Warfarins&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Warfarins&quot;] 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 &quot;Is warfarin in prefetch&quot;:
  exists (&quot;Warfarin Rx&quot;)"/>
        </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 &quot;NSAID Prescription&quot;:
  ContextPrescriptions P
    where P.medication in &quot;NSAIDs&quot;
    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 &quot;Is context medication systemic NSAID&quot;:
  exists (&quot;NSAID Prescription&quot;)"/>
        </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 &quot;Inclusion Criteria&quot;:
  if &quot;Is context medication topical diclofenac&quot;
    then &quot;Is warfarin in prefetch&quot;
  else (
    &quot;Is context medication systemic NSAID&quot;
      and &quot;Is warfarin in prefetch&quot;
  )"/>
        </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 &quot;GI Bleeds Condition&quot;:
  Last(
    [Condition: &quot;History of GI Bleeds&quot;] 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 &gt; 65 years or Hx UGIB"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Age &gt; 65 years or Hx UGIB&quot;:
  &quot;GI Bleeds Condition&quot; is not null
    or AgeInYears() &gt; 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 &quot;Get Card 3 Summary&quot;:
  if &quot;Age &gt; 65 years or Hx UGIB&quot;
    then 'Patient is 65 y/o or does have a history of upper gastrointestinal bleed (&quot;'
      + Common.GetConditionName(&quot;GI Bleeds Condition&quot;)
      + '&quot; and '
      + Common.GetAssertedDate(&quot;GI Bleeds Condition&quot;)
      + ').'
  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 &quot;Systemic Corticosteroids Rx&quot;:
    (
      [MedicationRequest: &quot;Systemic Corticosteroids&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Systemic Corticosteroids&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Systemic Corticosteroids&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Systemic Corticosteroids&quot;] 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 &quot;Has Systemic Corticosteroids&quot;:
  exists (&quot;Systemic Corticosteroids Rx&quot;)"/>
        </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 &quot;Aldosterone Antagonists Rx&quot;:
    (
      [MedicationRequest: &quot;Aldosterone Antagonists&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;Aldosterone Antagonists&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;Aldosterone Antagonists&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;Aldosterone Antagonists&quot;] 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 &quot;Has Aldosterone Antagonists&quot;:
  exists (&quot;Aldosterone Antagonists Rx&quot;)"/>
        </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 &quot;NSAID Rx&quot;:
    (
      [MedicationRequest: &quot;NSAIDs&quot;] MR
        where MR.authoredOn.toInterval() during Interval[Today() - 100 days, null]
        return MR.medication as CodeableConcept
    )
    union (
      [MedicationAdministration: &quot;NSAIDs&quot;] MA
        where MA.effective.toInterval() overlaps Interval[Today() - 100 days, null]
        return MA.medication as CodeableConcept
    )
    union (
      [MedicationDispense: &quot;NSAIDs&quot;] MD
        where MD.whenHandedOver.toInterval() during Interval[Today() - 100 days, null]
        return MD.medication as CodeableConcept
    )
    union (
      [MedicationStatement: &quot;NSAIDs&quot;] 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 &quot;Has NSAID&quot;:
  exists (&quot;NSAID Rx&quot;)"/>
        </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 &quot;Taking CS, MCRA, or NSAID&quot;:
  &quot;Has Systemic Corticosteroids&quot;
    or &quot;Has Aldosterone Antagonists&quot;
    or &quot;Has NSAID&quot;"/>
        </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 &quot;Get Card 4 Summary&quot;:
  if &quot;Taking CS, MCRA, or NSAID&quot;
    then 'Patient is concomitantly taking systemic corticosteroids ('
      + Common.GetDrugNames(&quot;Systemic Corticosteroids Rx&quot;)
      + '), aldosterone antagonist ('
      + Common.GetDrugNames(&quot;Aldosterone Antagonists Rx&quot;)
      + '), or high dose or multiple NSAIDs ('
      + Common.GetDrugNames(&quot;NSAID Rx&quot;)
      + ').'
  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 &quot;Get Card 2 Detail&quot;:
  '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 &quot;Acetaminophen 500 MG&quot;: Code '198440' from &quot;RXNORM&quot; 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 &quot;Get Base Label 2&quot;:
  'Substitute NSAID ('
  + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
  + ') with APAP ('
  + Common.ToString(&quot;Acetaminophen 500 MG&quot;)
  + ').'"/>
        </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 &quot;Get Card 2 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    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 &quot;Acetaminophen 325 MG&quot;: Code '313782' from &quot;RXNORM&quot; 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 &quot;Get Base Label 1&quot;:
  'Substitute NSAID ('
  + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
  + ') with APAP ('
  + Common.ToString(&quot;Acetaminophen 325 MG&quot;)
  + ').'"/>
        </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 &quot;Get Card 4 Detail&quot;:
  '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 &quot;Get Card 4 Indicator&quot;:
  if &quot;Taking CS, MCRA, or NSAID&quot;
    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 &quot;Get Card 3 Detail&quot;:
  '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 &gt; 65 years old
define &quot;Get Card 3 Indicator&quot;:
  if &quot;Age &gt; 65 years or Hx UGIB&quot;
    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 &quot;Is not context medication topical diclofenac&quot;:
  not exists (&quot;Topical Diclofenac Prescription&quot;)"/>
        </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 &quot;Get Card 3 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Assess risk and take action if necessary.'
  else if &quot;Age &gt; 65 years or Hx UGIB&quot;
    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 &quot;Get Card 2 Indicator&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    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 &quot;Get Base Summary&quot;:
  'Potential Drug-Drug Interaction between warfarin ('
    + Common.GetDrugNames(&quot;Warfarin Rx&quot;)
    + ') and NSAID ('
    + Common.GetDrugNames(&quot;NSAID Prescription&quot;)
    + ').'"/>
        </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 &quot;Get Card 4 Label&quot;:
  if &quot;Taking PPI or misoprostol&quot;
    then 'Assess risk and take action if necessary.'
  else if &quot;Taking CS, MCRA, or NSAID&quot;
    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&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  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&lt;DateTime&gt;, 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&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval&lt;DateTime&gt;
  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.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.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: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    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&lt;FHIR.CodeableConcept&gt;):
  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="filter-out-repeated-alerts"/>
    </extension>
    <extension url="type">
      <valueString value="boolean"/>
    </extension>
    <extension url="name">
      <valueString value="Filter out repeated alerts"/>
    </extension>
    <extension url="description">
      <valueString
                   value="Only works if both this configuration option is set to 'true' and  cache-for-order-sign-filtering was set to 'true' in an order-select request. Uses information about this CDS call to filter aparently repititious card. 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."/>
    </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-sign"/>
  <version value="1.0.0"/>
  <name value="WarfarinNSAIDsOrderSignRecommendation"/>
  <title value="Warfarin NSAIDs Order Sign 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-sign"/>
    </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."/>
      <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."/>
      <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."/>
        <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 &lt;2g per day (APAP 500 mg every 4-6 hours prn)."/>
        <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 &lt;2g per day (APAP 500 mg every 4-6 hours prn)."/>
        <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."/>
      <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"/>
      <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.)"/>
      <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>