CPG Example
0.1.0 - CI Build International flag

CPG Example, published by Clinical Quality Framework. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/cpg-example/ and changes regularly. See the Directory of published versions

Library: Spoonful Of Sugar Logic

Official URL: http://fhir.org/guides/cqf/cpg/example/Library/SpoonfulOfSugarLogic Version: 0.1.0
Active as of 2020-11-29 Computable Name: SpoonfulOfSugarLogic

This library defines logic for representing the Spoonful Of Sugar Recommendation.

Title: Spoonful Of Sugar Logic
Id: SpoonfulOfSugarLogic
Version: 0.1.0
Url: Spoonful Of Sugar Logic
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2020-11-29 15:54:22-0700
Publisher: Clinical Quality Framework
Description:

This library defines logic for representing the Spoonful Of Sugar Recommendation.

Jurisdiction: 001
Topic:
Related Artifacts:

Dependencies

  • http://fhir.org/guides/cqf/cpg/example/ValueSet/Sugar
Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
Active MedicationsMedicationRequest0*Out
Inclusion Criteriaboolean01Out
Active Spoonful Of SugarServiceRequest0*Out
Prohibitions For Spoonful Of SugarServiceRequest0*Out
Should Recommend Spoonful Of Sugarboolean01Out
Data Requirements:
TypeProfileMSCode Filter
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest
ServiceRequest http://hl7.org/fhir/StructureDefinition/ServiceRequest code filter:
path: code
value set: http://fhir.org/guides/cqf/cpg/example/ValueSet/Sugar
ServiceRequest http://hl7.org/fhir/StructureDefinition/ServiceRequest code filter:
path: code
value set: http://fhir.org/guides/cqf/cpg/example/ValueSet/Sugar
Content: text/cql
library SpoonfulOfSugarLogic

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

valueset "Sugar": 'http://fhir.org/guides/cqf/cpg/example/ValueSet/Sugar'

context Patient

define "Inclusion Criteria":
  Patient.active
    and exists "Active Medications"

define "Active Medications":
  [MedicationRequest] MR
    where MR.intent = 'order'
      and MR.status = 'active'
      and MR.doNotPerform is not true

define "Active Spoonful Of Sugar":
  [ServiceRequest: "Sugar"] SR
    where SR.intent = 'order'
      and SR.status = 'active'
      and SR.doNotPerform is not true

define "Prohibitions For Spoonful Of Sugar":
  [ServiceRequest: "Sugar"] SR
    where SR.intent = 'order'
      and SR.status = 'active'
      and SR.doNotPerform is true

define "Should Recommend Spoonful Of Sugar":
  "Inclusion Criteria"
    and not exists "Active Spoonful Of Sugar"
    and not exists "Prohibitions For Spoonful Of Sugar"
Content: application/elm+xml
Encoded data (31296 characters)
Content: application/elm+json
Encoded data (56680 characters)