PCOCommon
type: Library
node role: treeRoot
id:
  v: PCOCommon
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Id: PCOCommon Version: 1.0.0 Url: PCOCommon Status: draft Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2026-03-02 20:03:58+0000 Publisher: HL7 International / Patient Care Description: Shared CQL expressions for all Person-Centered Outcome libraries. Jurisdiction: US Related Artifacts: Dependencies http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1 http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0 http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1 Parameters: Name Type Min Max In/Out Measurement Period Period 0 1 In Patient Patient 0 1 Out Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/StructureDefinition/Patient ; Condition http://hl7.org/fhir/StructureDefinition/Condition ; Observation http://hl7.org/fhir/StructureDefinition/Observation ; Goal http://hl7.org/fhir/StructureDefinition/Goal ;;;; CarePlan http://hl7.org/fhir/StructureDefinition/CarePlan ; Practitioner http://hl7.org/fhir/StructureDefinition/Practitioner ; RelatedPerson http://hl7.org/fhir/StructureDefinition/RelatedPerson ; Content: text/cql library PCOCommon version '0.1.0' using FHIR version '4.0.1' include hl7.fhir.uv.cql.FHIRCommon version '2.0.0' include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' parameter "Measurement Period" Interval<DateTime> context Patient define function SortAscending(observations List<Observation>): observations O sort by Coalesce( (effective as FHIR.dateTime).value, (effective as FHIR.instant).value, (effective as FHIR.Period)."end".value, (effective as FHIR.Period)."start".value) ascending // Returns Date from the first Goal target that has a due date. define fluent function dueDate(goal Goal): First(goal.target target // TODO if due is Duration, add that quantity to startDate let due:(target.due as FHIR.date).value where due is not null return due ) // Returns a list of Conditions that this Goal addresses. define fluent function addressesConditions(goal Goal): flatten( goal.addres…
contained: Parameters
  id:
    v: options
  parameter:
    name:
      v: translatorVersion
    value: String
      v: 3.25.0
  parameter:
    name:
      v: option
    value: String
      v: EnableAnnotations
  parameter:
    name:
      v: option
    value: String
      v: EnableLocators
  parameter:
    name:
      v: option
    value: String
      v: DisableListDemotion
  parameter:
    name:
      v: option
    value: String
      v: DisableListPromotion
  parameter:
    name:
      v: format
    value: String
      v: JSON
  parameter:
    name:
      v: format
    value: String
      v: XML
  parameter:
    name:
      v: analyzeDataRequirements
    value: Boolean
      v: false
  parameter:
    name:
      v: collapseDataRequirements
    value: Boolean
      v: true
  parameter:
    name:
      v: compatibilityLevel
    value: String
      v: 1.5
  parameter:
    name:
      v: enableCqlOnly
    value: Boolean
      v: false
  parameter:
    name:
      v: errorLevel
    value: String
      v: Info
  parameter:
    name:
      v: signatureLevel
    value: String
      v: Overloads
  parameter:
    name:
      v: validateUnits
    value: Boolean
      v: true
  parameter:
    name:
      v: verifyOnly
    value: Boolean
      v: false
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions
    l: cqf-cqlOptions
  value: Reference
    l: options
    reference:
      v: #options
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: pc
url:
  v: http://hl7.org/fhir/us/pco/Library/PCOCommon
  l: PCOCommon
version:
  v: 1.0.0
name:
  v: PCOCommon
status:
  v: draft
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2026-03-02T20:03:58+00:00
publisher:
  v: HL7 International / Patient Care
contact:
  name:
    v: HL7 International / Patient Care
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/patientcare
  telecom:
    system:
      v: email
description:
  v: Shared CQL expressions for all Person-Centered Outcome libraries.
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
    display:
      v: United States of America
related artifact:
  type:
    v: depends-on
  display:
    v: FHIR model information
  resource:
    v: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
    l: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRCommon
  resource:
    v: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
    l: http://hl7.org/fhir/uv/cql/Library/FHIRCommon
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRHelpers
  resource:
    v: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
    l: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers
parameter:
  name:
    v: Measurement Period
  use:
    v: in
  min:
    v: 0
  max:
    v: 1
  type:
    v: Period
parameter:
  name:
    v: Patient
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Patient
data requirement:
  type:
    v: Patient
  profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  must support:
    v: id
data requirement:
  type:
    v: Condition

v: id

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: id

type:
  v: Goal
profile:
  v: http://hl7.org/fhir/StructureDefinition/Goal
  l: Goal
must support:
  v: addresses
must support:
  v: due
must support:
  v: due.value
must support:
  v: id

type:
  v: CarePlan
profile:
  v: http://hl7.org/fhir/StructureDefinition/CarePlan
  l: CarePlan
must support:
  v: goal

type:
  v: Practitioner
profile:
  v: http://hl7.org/fhir/StructureDefinition/Practitioner
  l: Practitioner
must support:
  v: id

type:
  v: RelatedPerson
profile:
  v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
  l: RelatedPerson
must support:
  v: id

content type:
  v: text/cql

content type:
  v: application/elm+xml

content type:
  v: application/elm+json