ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

Library — detail: CQL & FHIRPath container

Carrier of executable logic (CQL, FHIRPath, ELM) referenced by Measure, PlanDefinition, ActivityDefinition. Foundation brick of HEDIS / QPP quality measures and evidence-based clinical decisions.

Role in clinical reasoning

Library is the core asset of the Clinical Quality Language (CQL) pattern. A Library carries the executable CQL code that other resources reference:

  • Measure -> library -> Library (population, numerator, denominator).
  • PlanDefinition -> library -> Library (CDS rules).
  • ActivityDefinition -> library -> Library (attribute computation).

Key fields

FieldCardinalityRole
url0..1Canonical URL referenced by Measure / PlanDefinition.
version0..1Semantic version.
status1..1draft | active | retired | unknown.
type1..1logic-library | model-definition | asset-collection | module-definition.
content0..*Attachments. Text CQL, ELM XML/JSON.
dataRequirement0..*FHIR data consumed (useful for pre-fetch).
parameter0..*Execution parameters.

Embedded CQL

The content block embeds CQL as base64 (contentType: text/cql) or points to an external attachment (url). The server compiles to ELM (Expression Logical Model) before execution.

Example: HbA1c measure Library

json library-hba1c-measure.json
{
  "resourceType": "Library",
  "id": "lib-hba1c-measure",
  "url": "http://example.org/fhir/Library/HbA1cMeasure",
  "version": "1.0.0",
  "name": "HbA1cMeasure",
  "title": "HbA1c Quality Measure CQL Library",
  "status": "active",
  "experimental": false,
  "type": {
    "coding": [{
      "system": "http://terminology.hl7.org/CodeSystem/library-type",
      "code": "logic-library"
    }]
  },
  "subjectCodeableConcept": {
    "coding": [{
      "system": "http://hl7.org/fhir/resource-types",
      "code": "Patient"
    }]
  },
  "content": [{
    "contentType": "text/cql",
    "data": "bGlicmFyeSBIYkExY01lYXN1cmUgdmVyc2lvbiAnMS4wLjAnCnVzaW5nIEZISVIgdmVyc2lvbiAnNS4wLjAnCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNS4wLjAnCgpwYXJhbWV0ZXIgIk1lYXN1cmVtZW50IFBlcmlvZCIgSW50ZXJ2YWw8RGF0ZVRpbWU+Cgpjb250ZXh0IFBhdGllbnQK"
  }]
}

Common pitfalls

  • No version — without version, audit traceability breaks.
  • Uncompilable CQL — a broken CQL attachment fails consuming Measures. Unit test in pre-publication.
  • Missing dataRequirement — without, the server cannot pre-fetch data.