STU 3 Candidate

This page is part of the FHIR Specification (v1.4.0: STU 3 Ballot 3). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

4.18 Resource Library - Content

Clinical Decision Support Work GroupMaturity Level: 0Compartments: Not linked to any defined compartments

The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library.

4.18.1 Scope and Usage

This resource is a draft proposal for use as part of an approach to Clinical Quality within FHIR, and is documented as part of the Clinical Quality Improvement Framework Implementation Guide.

The Library resource represents a shareable library of clinical logic, written in Clinical Quality Language (CQL). In addition to representing the metadata of the library, the resource has elements that expose the components defined within the library such as code system and value set references, named expressions and parameters.

The actual content of the library is represented using the Attachment data type, and may either be referenced with a url to some CQL repository, or the content may be embedded as a base-64 encoded string. Either way, the content may be shared as a CQL text document, or, for a more computable representation, as an (Expression Logical Model) ELM XML or JSON document.

Note that because the library content may be embedded as well as retrievable from a CQL repository via the attachment URL, the possibility exists for the embedded content to be different from the content on the repository. With proper versioning and governance, this should never occur, but to minimize the potential impact of this possibility, implementers SHALL give precedence to the embedded content of a library when it is present.

This resource is referenced by DecisionSupportRule, Measure and OrderSet

4.18.2 Resource Content

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Library ΣDomainResourceRepresents a library of quality improvement components
... moduleMetadata Σ0..1ModuleMetadataThe metadata information for the library
... model Σ0..*BackboneElementA model used by the library
.... name Σ0..1stringName of the model
.... identifier Σ1..1stringThe identifier of the model
.... version Σ0..1stringThe version of the model, if any
... library Σ0..*BackboneElementA library referenced by this library
.... name Σ0..1stringName of the library
.... identifier Σ1..1stringThe identifier of the library
.... version Σ0..1stringThe version of the library, if any
.... document[x] Σ0..1The content of the library
..... documentAttachmentAttachment
..... documentReferenceReference(ModuleDefinition)
... codeSystem Σ0..*BackboneElementA code system used by the library
.... name Σ0..1stringName of the code system
.... identifier Σ1..1stringThe identifier of the code system
.... version Σ0..1stringThe version of the code system, if any
... valueSet Σ0..*BackboneElementA value set used by the library
.... name Σ0..1stringName of the value set
.... identifier Σ1..1stringThe identifier of the value set
.... version Σ0..1stringThe version of the value set
.... codeSystem Σ0..*stringThe code system binding for this value set definition
... parameter Σ0..*ParameterDefinitionParameters defined by the library
... dataRequirement Σ0..*DataRequirementData requirements of the library
... document Σ1..1AttachmentThe content of the library

doco Documentation for this format

UML Diagram

Library (DomainResource)The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidencemoduleMetadata : ModuleMetadata [0..1]The parameter element defines parameters used by the libraryparameter : ParameterDefinition [0..*]The dataRequirement element specifies a data requirement used by some expression within the librarydataRequirement : DataRequirement [0..*]The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM documentdocument : Attachment [1..1]ModelThe name element defines the local name of the model as used within the libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the modelidentifier : string [1..1]The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is impliedversion : string [0..1]LibraryThe name element defines the local name of the referenced libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the libraryidentifier : string [1..1]The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is impliedversion : string [0..1]The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM documentdocument[x] : Type [0..1] « Attachment|Reference(ModuleDefinition) »CodeSystemThe name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definitionname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the code systemidentifier : string [1..1]The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is impliedversion : string [0..1]ValueSetThe name element specifies the local name of the value set used within the libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the value setidentifier : string [1..1]The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is impliedversion : string [0..1]The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system versioncodeSystem : string [0..*]A model element describes the model and version used by the librarymodel[0..*]A library element describes a library referenced by this librarylibrary[0..*]A code system definition used within the librarycodeSystem[0..*]A value set definition referenced by the libraryvalueSet[0..*]

XML Template

<Library xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <moduleMetadata><!-- 0..1 ModuleMetadata The metadata information for the library --></moduleMetadata>
 <model>  <!-- 0..* A model used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the model -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the model -->
  <version value="[string]"/><!-- 0..1 The version of the model, if any -->
 </model>
 <library>  <!-- 0..* A library referenced by this library -->
  <name value="[string]"/><!-- 0..1 Name of the library -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the library -->
  <version value="[string]"/><!-- 0..1 The version of the library, if any -->
  <document[x]><!-- 0..1 Attachment|Reference(ModuleDefinition) The content of the library --></document[x]>
 </library>
 <codeSystem>  <!-- 0..* A code system used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the code system -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the code system -->
  <version value="[string]"/><!-- 0..1 The version of the code system, if any -->
 </codeSystem>
 <valueSet>  <!-- 0..* A value set used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the value set -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the value set -->
  <version value="[string]"/><!-- 0..1 The version of the value set -->
  <codeSystem value="[string]"/><!-- 0..* The code system binding for this value set definition -->
 </valueSet>
 <parameter><!-- 0..* ParameterDefinition Parameters defined by the library --></parameter>
 <dataRequirement><!-- 0..* DataRequirement Data requirements of the library --></dataRequirement>
 <document><!-- 1..1 Attachment The content of the library --></document>
</Library>

JSON Template

{doco
  "resourceType" : "Library",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "moduleMetadata" : { ModuleMetadata }, // The metadata information for the library
  "model" : [{ // A model used by the library
    "name" : "<string>", // Name of the model
    "identifier" : "<string>", // R!  The identifier of the model
    "version" : "<string>" // The version of the model, if any
  }],
  "library" : [{ // A library referenced by this library
    "name" : "<string>", // Name of the library
    "identifier" : "<string>", // R!  The identifier of the library
    "version" : "<string>", // The version of the library, if any
    // document[x]: The content of the library. One of these 2:
    "documentAttachment" : { Attachment }
    "documentReference" : { Reference(ModuleDefinition) }
  }],
  "codeSystem" : [{ // A code system used by the library
    "name" : "<string>", // Name of the code system
    "identifier" : "<string>", // R!  The identifier of the code system
    "version" : "<string>" // The version of the code system, if any
  }],
  "valueSet" : [{ // A value set used by the library
    "name" : "<string>", // Name of the value set
    "identifier" : "<string>", // R!  The identifier of the value set
    "version" : "<string>", // The version of the value set
    "codeSystem" : ["<string>"] // The code system binding for this value set definition
  }],
  "parameter" : [{ ParameterDefinition }], // Parameters defined by the library
  "dataRequirement" : [{ DataRequirement }], // Data requirements of the library
  "document" : { Attachment } // R!  The content of the library
}

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Library ΣDomainResourceRepresents a library of quality improvement components
... moduleMetadata Σ0..1ModuleMetadataThe metadata information for the library
... model Σ0..*BackboneElementA model used by the library
.... name Σ0..1stringName of the model
.... identifier Σ1..1stringThe identifier of the model
.... version Σ0..1stringThe version of the model, if any
... library Σ0..*BackboneElementA library referenced by this library
.... name Σ0..1stringName of the library
.... identifier Σ1..1stringThe identifier of the library
.... version Σ0..1stringThe version of the library, if any
.... document[x] Σ0..1The content of the library
..... documentAttachmentAttachment
..... documentReferenceReference(ModuleDefinition)
... codeSystem Σ0..*BackboneElementA code system used by the library
.... name Σ0..1stringName of the code system
.... identifier Σ1..1stringThe identifier of the code system
.... version Σ0..1stringThe version of the code system, if any
... valueSet Σ0..*BackboneElementA value set used by the library
.... name Σ0..1stringName of the value set
.... identifier Σ1..1stringThe identifier of the value set
.... version Σ0..1stringThe version of the value set
.... codeSystem Σ0..*stringThe code system binding for this value set definition
... parameter Σ0..*ParameterDefinitionParameters defined by the library
... dataRequirement Σ0..*DataRequirementData requirements of the library
... document Σ1..1AttachmentThe content of the library

doco Documentation for this format

UML Diagram

Library (DomainResource)The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidencemoduleMetadata : ModuleMetadata [0..1]The parameter element defines parameters used by the libraryparameter : ParameterDefinition [0..*]The dataRequirement element specifies a data requirement used by some expression within the librarydataRequirement : DataRequirement [0..*]The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM documentdocument : Attachment [1..1]ModelThe name element defines the local name of the model as used within the libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the modelidentifier : string [1..1]The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is impliedversion : string [0..1]LibraryThe name element defines the local name of the referenced libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the libraryidentifier : string [1..1]The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is impliedversion : string [0..1]The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM documentdocument[x] : Type [0..1] « Attachment|Reference(ModuleDefinition) »CodeSystemThe name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definitionname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the code systemidentifier : string [1..1]The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is impliedversion : string [0..1]ValueSetThe name element specifies the local name of the value set used within the libraryname : string [0..1]The identifier element specifies the global, non-version-specific identifier for the value setidentifier : string [1..1]The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is impliedversion : string [0..1]The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system versioncodeSystem : string [0..*]A model element describes the model and version used by the librarymodel[0..*]A library element describes a library referenced by this librarylibrary[0..*]A code system definition used within the librarycodeSystem[0..*]A value set definition referenced by the libraryvalueSet[0..*]

XML Template

<Library xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <moduleMetadata><!-- 0..1 ModuleMetadata The metadata information for the library --></moduleMetadata>
 <model>  <!-- 0..* A model used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the model -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the model -->
  <version value="[string]"/><!-- 0..1 The version of the model, if any -->
 </model>
 <library>  <!-- 0..* A library referenced by this library -->
  <name value="[string]"/><!-- 0..1 Name of the library -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the library -->
  <version value="[string]"/><!-- 0..1 The version of the library, if any -->
  <document[x]><!-- 0..1 Attachment|Reference(ModuleDefinition) The content of the library --></document[x]>
 </library>
 <codeSystem>  <!-- 0..* A code system used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the code system -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the code system -->
  <version value="[string]"/><!-- 0..1 The version of the code system, if any -->
 </codeSystem>
 <valueSet>  <!-- 0..* A value set used by the library -->
  <name value="[string]"/><!-- 0..1 Name of the value set -->
  <identifier value="[string]"/><!-- 1..1 The identifier of the value set -->
  <version value="[string]"/><!-- 0..1 The version of the value set -->
  <codeSystem value="[string]"/><!-- 0..* The code system binding for this value set definition -->
 </valueSet>
 <parameter><!-- 0..* ParameterDefinition Parameters defined by the library --></parameter>
 <dataRequirement><!-- 0..* DataRequirement Data requirements of the library --></dataRequirement>
 <document><!-- 1..1 Attachment The content of the library --></document>
</Library>

JSON Template

{doco
  "resourceType" : "Library",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "moduleMetadata" : { ModuleMetadata }, // The metadata information for the library
  "model" : [{ // A model used by the library
    "name" : "<string>", // Name of the model
    "identifier" : "<string>", // R!  The identifier of the model
    "version" : "<string>" // The version of the model, if any
  }],
  "library" : [{ // A library referenced by this library
    "name" : "<string>", // Name of the library
    "identifier" : "<string>", // R!  The identifier of the library
    "version" : "<string>", // The version of the library, if any
    // document[x]: The content of the library. One of these 2:
    "documentAttachment" : { Attachment }
    "documentReference" : { Reference(ModuleDefinition) }
  }],
  "codeSystem" : [{ // A code system used by the library
    "name" : "<string>", // Name of the code system
    "identifier" : "<string>", // R!  The identifier of the code system
    "version" : "<string>" // The version of the code system, if any
  }],
  "valueSet" : [{ // A value set used by the library
    "name" : "<string>", // Name of the value set
    "identifier" : "<string>", // R!  The identifier of the value set
    "version" : "<string>", // The version of the value set
    "codeSystem" : ["<string>"] // The code system binding for this value set definition
  }],
  "parameter" : [{ ParameterDefinition }], // Parameters defined by the library
  "dataRequirement" : [{ DataRequirement }], // Data requirements of the library
  "document" : { Attachment } // R!  The content of the library
}

 

Alternate definitions: Schema/Schematron, Resource Profile (XML, JSON), Questionnaire

4.18.3 Search Parameters

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

NameTypeDescriptionPaths
descriptionstringText search against the descriptionLibrary.moduleMetadata.description
identifiertokenLogical identifier for the module (e.g. CMS-143)Library.moduleMetadata.identifier
statustokenStatus of the moduleLibrary.moduleMetadata.status
titlestringText search against the titleLibrary.moduleMetadata.title
topictokenTopics associated with the moduleLibrary.moduleMetadata.topic
versionstringVersion of the module (e.g. 1.0.0)Library.moduleMetadata.version