# ELM JSON Library - Using CQL With FHIR v3.0.0-ballot

## Resource Profile: ELM JSON Library 

 
The ELM Library supports distributing a Clinical Quality Language (CQL) library compiled to Expression Logical Model (ELM) in JSON format 

**Usages:**

* Examples for this Profile: [ELMExample](Library-ELMExample.md)
* CapabilityStatements using this Profile: [CQL Evaluation Service](CapabilityStatement-cql-evaluation-service.md)

You can also check for [usages in the FHIR IG Statistics](https://packages2.fhir.org/xig/resource/hl7.fhir.uv.cql|current/StructureDefinition/StructureDefinition-elm-json-library.json)

### Formal Views of Profile Content

 [Description Differentials, Snapshots, and other representations](http://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#structure-definitions). 

 

Other representations of profile: [CSV](../StructureDefinition-elm-json-library.csv), [Excel](../StructureDefinition-elm-json-library.xlsx), [Schematron](../StructureDefinition-elm-json-library.sch) 



## Resource Content

```json
{
  "resourceType" : "StructureDefinition",
  "id" : "elm-json-library",
  "extension" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
    "valueInteger" : 3
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode" : "cds"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
    "valueCode" : "trial-use"
  }],
  "url" : "http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library",
  "identifier" : [{
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:oid:2.16.840.1.113883.4.642.40.37.42.15"
  }],
  "version" : "3.0.0-ballot",
  "name" : "ELMJSONLibrary",
  "title" : "ELM JSON Library",
  "status" : "active",
  "experimental" : false,
  "date" : "2026-08-14T03:31:27+10:00",
  "publisher" : "HL7 International / Clinical Decision Support",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/dss"
    }]
  }],
  "description" : "The ELM Library supports distributing a Clinical Quality Language (CQL) library compiled to Expression Logical Model (ELM) in JSON format",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
      "code" : "001",
      "display" : "World"
    }]
  }],
  "fhirVersion" : "4.0.1",
  "mapping" : [{
    "identity" : "rim",
    "uri" : "http://hl7.org/v3",
    "name" : "RIM Mapping"
  },
  {
    "identity" : "workflow",
    "uri" : "http://hl7.org/fhir/workflow",
    "name" : "Workflow Pattern"
  },
  {
    "identity" : "w5",
    "uri" : "http://hl7.org/fhir/fivews",
    "name" : "FiveWs Pattern Mapping"
  },
  {
    "identity" : "objimpl",
    "uri" : "http://hl7.org/fhir/object-implementation",
    "name" : "Object Implementation Information"
  }],
  "kind" : "resource",
  "abstract" : false,
  "type" : "Library",
  "baseDefinition" : "http://hl7.org/fhir/StructureDefinition/Library",
  "derivation" : "constraint",
  "differential" : {
    "element" : [{
      "id" : "Library",
      "path" : "Library",
      "constraint" : [{
        "key" : "ejl-1",
        "severity" : "error",
        "human" : "ELM JSON libraries must one (and only one) content element that starts with 'application/elm+json'",
        "expression" : "content.where(contentType.startsWith('application/elm+json')).count() = 1",
        "xpath" : "exists(f:value)"
      }],
      "mustSupport" : false
    },
    {
      "id" : "Library.extension:cqlOptions",
      "path" : "Library.extension",
      "sliceName" : "cqlOptions",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Extension",
        "profile" : ["http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions"]
      }],
      "mustSupport" : true
    },
    {
      "id" : "Library.extension:cqlOptions.value[x]",
      "path" : "Library.extension.value[x]",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/uv/cql/StructureDefinition/cql-options"]
      }]
    },
    {
      "id" : "Library.content",
      "path" : "Library.content",
      "min" : 1,
      "max" : "*",
      "constraint" : [{
        "key" : "ejl-2",
        "severity" : "error",
        "human" : "ELM libraries must have a content element with data or a url (or both)",
        "expression" : "data.exists() or url.exists()",
        "xpath" : "exists(f:value)"
      }],
      "mustSupport" : true
    },
    {
      "id" : "Library.content.contentType",
      "path" : "Library.content.contentType",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "condition" : ["ejl-1"],
      "mustSupport" : true
    },
    {
      "id" : "Library.content.data",
      "path" : "Library.content.data",
      "min" : 0,
      "max" : "1",
      "condition" : ["ejl-2"],
      "mustSupport" : true
    },
    {
      "id" : "Library.content.url",
      "path" : "Library.content.url",
      "min" : 0,
      "max" : "1",
      "condition" : ["ejl-2"],
      "mustSupport" : true
    }]
  }
}

```
