Person-Centered Outcomes
0.2.0 - ci-build United States of America flag

Person-Centered Outcomes - Local Development build (v0.2.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Library: WhatMattersLogic

Official URL: http://hl7.org/fhir/us/pco/Library/WhatMattersLogic Version: 0.2.0
Draft as of 2025-02-10 Computable Name: WhatMattersLogic
Id: WhatMattersLogic
Version: 0.2.0
Url: WhatMattersLogic
Status: draft
Type:

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

code: logic-library

Date: 2025-02-10 21:11:28+0000
Publisher: HL7 International / Patient Care
Jurisdiction: US
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
Follow-Up IntervalRange01In
PatientPatient01Out
What Matters ObservationsObservation0*Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;
Content: text/cql
library WhatMattersLogic version '0.1.0'

using FHIR version '4.0.1'

include FHIRHelpers version '4.4.000' called FHIRHelpers
include PCOCommon version '0.1.0' called PC

valueset "What Matters Categories": 'http://hl7.org/fhir/us/pco/ValueSet/what-matters-vs'
valueset "Well-Being Domains": 'http://hl7.org/fhir/us/pco/ValueSet/wellbeing-domains-example-vs'

parameter "Measurement Period" Interval<DateTime>
    default Interval[@2024-01-01T00:00:00.000Z, @2024-12-31T23:59:59.999Z]

parameter "Follow-Up Interval" Interval<System.Quantity>
  default Interval[2 weeks, 26 weeks]

context Patient

define "What Matters Observations":
  [Observation] obs
    where obs.category in "What Matters Categories"
      or obs.code in "Well-Being Domains"

// Returns a list of what matters Observations this Goal addresses.
define fluent function whatMattersObservations(goal Goal):
  flatten( goal.addresses GA
      return [Observation] obs
        where obs.id = GA.reference.getId()
          and obs.isWhatMatters()
  )

define fluent function isWhatMatters(obs Observation):
  "What Matters Observations" contains obs
Content: application/elm+xml
Encoded data (27664 characters)
Content: application/elm+json
Encoded data (52184 characters)