Person-Centered Outcomes
0.1.0 - ci-build International flag

Person-Centered Outcomes, published by Mountain Lotus WellBeing LLC. 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/mtnlotus/pco-ig/ and changes regularly. See the Directory of published versions

Library: WhatMattersLogic

Official URL: http://mtnlotus.com/uv/pco/Library/WhatMattersLogic Version: 0.1.0
Draft as of 2024-09-17 Computable Name: WhatMattersLogic
Id: WhatMattersLogic
Version: 0.1.0
Url: WhatMattersLogic
Status: draft
Type:

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

code: logic-library

Date: 2024-09-17 23:40:02+0000
Publisher: Mountain Lotus WellBeing LLC
Jurisdiction: 001
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 ; code filter:
path: code
value set: http://mtnlotus.com/uv/pco/ValueSet/what-matters-focus-areas
Observation http://hl7.org/fhir/StructureDefinition/Observation ;
Goal http://hl7.org/fhir/StructureDefinition/Goal ;;
Condition http://hl7.org/fhir/StructureDefinition/Condition ;
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 Focus Areas": 'http://mtnlotus.com/uv/pco/ValueSet/what-matters-focus-areas'

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: "What Matters Focus Areas"]

// 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

// Returns a list of Goals that address this Observation
define fluent function addressedByGoals(obs Observation):
  [Goal] goal
    where exists ( goal.addresses GA
        where obs.id = GA.reference.getId()
    )

// Returns a list of Conditions that this Goal addresses.
define fluent function addressesConditions(goal Goal):
  flatten( goal.addresses GA
      return [Condition] obs
        where obs.id = GA.reference.getId()
  )
Content: application/elm+xml
Encoded data (38816 characters)
Content: application/elm+json
Encoded data (73560 characters)