Breast Cancer Screening and Management (BCSM) Clinical Decision Support (CDS) Implementation Guide
1.0.0 - ci-build

Breast Cancer Screening and Management (BCSM) Clinical Decision Support (CDS) Implementation Guide - Local Development build (v1.0.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Library: Genetic Risk Referral

Official URL: http://cancerscreeningcds.github.io/bcsm-cds/Library/GeneticRiskReferral Version: 1.0.0
Draft as of 2025-02-28 Computable Name: GeneticRiskReferral
Title: Genetic Risk Referral
Id: GeneticRiskReferral
Version: 1.0.0
Url: Genetic Risk Referral
Status: draft
Type:

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

code: logic-library

Date: 2025-02-28 23:16:14+0000
Publisher: MITRE
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
MostRecentAgeValuedecimal01Out
inc-AgeAtLeast18boolean01Out
inc-assignedfemaleatbirthortransfemaleboolean01Out
IsIncludedboolean01Out
Excludedboolean01Out
IsIncludedAndNotExcludedboolean01Out
CheckIsIncludedAndNotExcludedboolean01Out
GeneticReferralVariantResource01Out
GeneticReferralAncestryResource01Out
GeneticReferralRiskResource01Out
GeneticRiskReferralResource01Out
GeneticRiskAssessmentResource0*Out
flow-GeneticRiskReferralResource0*Out
ExistsGeneticReferralVariantboolean01Out
ExistsGeneticReferralAncestryboolean01Out
ExistsGeneticReferralRiskboolean01Out
GeneticRiskReferralCodeCoding01Out
GeneticRiskReferralReasonCoding01Out
ExistsGeneticRiskAssessmentboolean01Out
GeneticRiskAssessmentToolCodeCoding01Out
GeneticRiskAssessmentToolReasonCoding01Out
GeneticRiskAssessmentCodeCoding01Out
GeneticRiskAssessmentReasonCoding01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient ;;;
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;; code filter:
path: code

system: http://loinc.org

code: 30525-0

display: Age

code filter:
path: value.unit

code: years

Observation http://hl7.org/fhir/StructureDefinition/Observation ;; code filter:
path: code

system: http://loinc.org

code: 76691-5

display: Gender identity

Content: text/cql
/*  
  Author: CMS Alliance to Modernize Healthcare, operated by THE MITRE Corporation.

  (C) 2024 The MITRE Corporation. All Rights Reserved. 
  Approved for Public Release: 24-2711. 
  Distribution Unlimited.

  Unless otherwise noted, this work is available under an Apache 2.0 license. 
  It was produced by the MITRE Corporation for the Division of Cancer Prevention 
  and Control, Centers for Disease Control and Prevention in accordance with the 
  Statement of Work, contract number 75FCMC18D0047, task order number 75D30123F17931.
*/

library GeneticRiskReferral version '1.0.0'

using FHIR version '4.0.1'
include FHIRHelpers  version '4.0.1' called FHIRHelpers

include GeneticRiskReferralEvents version '1.0.0' called Events
include GeneticRiskReferralActions version '1.0.0' called Actions
include DataElements version '1.0.0' called DataElements

codesystem "LOINC": 'http://loinc.org'

// Standard codes
code "Age": '30525-0' from "LOINC" display 'Age'

context Patient

//------------------------------------------------------------------------------
// INCLUSIONS/EXCLUSIONS
//------------------------------------------------------------------------------

define CheckIsIncludedAndNotExcluded:
  Message(IsIncludedAndNotExcluded, IsIncludedAndNotExcluded is false,
    'http://example.org/CodeSystem/plan-definition-action-reason-code-system/excludedornotincluded',
    'Error', 
    'Excluded or not included')

define IsIncludedAndNotExcluded:
  IsIncluded and not Excluded

// INCLUSIONS
define IsIncluded:
  "inc-AgeAtLeast18" and "inc-assignedfemaleatbirthortransfemale"

// Age 18 years and older, only use MostRecentAgeValue if no birthdate  
define "inc-AgeAtLeast18":
  (AgeInYears() is not null and AgeInYears() >= 18) or (AgeInYears() is null and MostRecentAgeValue >= 18)

define MostRecentAgeValue:
  First(
    [Observation: "Age"] O
      where O.value.unit = 'years'
      sort by effective desc
  ).value.value.value

define "inc-assignedfemaleatbirthortransfemale":
  DataElements."de-female" or DataElements."TransgenderFemale"

// EXCLUSIONS
define Excluded:
  false

//------------------------------------------------------------------------------
// RECOMMENDATIONS
//------------------------------------------------------------------------------

define "flow-GeneticRiskReferral":
  {
    GeneticRiskReferral, 
    GeneticRiskAssessment
  }
  except { null, {} }

define GeneticRiskReferral:
  Coalesce(
    GeneticReferralVariant,
    GeneticReferralAncestry,
    GeneticReferralRisk
  )

define GeneticReferralVariant:
  if Events."eve-fhxgeneinherited" is true and Events."eve-knownvariantstatus" is false
  then Actions."act-geneticreferralvariant" else null  

define GeneticReferralAncestry:
  if Events."eve-brcageneancestry" is true
  then Actions."act-geneticreferralancestry" else null    

define GeneticRiskAssessment:
  if GeneticRiskReferral is null and Events."eve-fhxbrcaovcatubalperit" is true 
    and Events.ValidMostRecentFamilialRiskAssessment is false
  then {Actions."act-fhxrisktool", Actions."act-fhxriskassess"} else null   

define GeneticReferralRisk:
  if Events."eve-fhxriskresult" is true
    and Events.ValidMostRecentFamilialRiskAssessment
  then Actions."act-geneticreferralrisk" else null

//------------------------------------------------------------------------------
// DYNAMIC VALUES
//------------------------------------------------------------------------------    

define ExistsGeneticReferralVariant:
  GeneticReferralVariant is not null

define ExistsGeneticReferralAncestry:
  GeneticReferralAncestry is not null    

define ExistsGeneticReferralRisk:
  GeneticReferralRisk is not null  

define GeneticRiskReferralCode:
  GeneticRiskReferral.code

define GeneticRiskReferralReason:
  GeneticRiskReferral.reason    

define ExistsGeneticRiskAssessment:
  GeneticRiskAssessment is not null  

define GeneticRiskAssessmentToolCode:
  (Actions."act-fhxrisktool").code  

define GeneticRiskAssessmentToolReason:
  (Actions."act-fhxrisktool").reason     

define GeneticRiskAssessmentCode:
  (Actions."act-fhxriskassess").code  

define GeneticRiskAssessmentReason:
  (Actions."act-fhxriskassess").reason    
Content: application/elm+xml
Encoded data (68108 characters)
Content: application/elm+json
Encoded data (123320 characters)