The Library resource is a general-purpose container for clinical knowledge assets. These assets may be defined using a non-FHIR representation, such as a shareable library of clinical logic, written in Clinical Quality Language (CQL), or the XML Schema for an information model, or they may be defined using Fast Healthcare Interoperability Resources (FHIR) resources such as the description of a protocol represented by a Plan Definition resource. In addition to representing the metadata of the library, the resource has elements for tracking dependencies, as well as for representing the parameters and data requirements for any expression functionality provided by the library.
For non-FHIR assets, the actual content of the library is represented using the Attachment data type, and may either be referenced with a URL, or the content may be embedded as a base-64 encoded string. Either way, the content Type element of the attachment is used to indicate the representation of the library content.
Note that because the library content may be embedded as well as be retrievable from an external 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.
The Library resource is definitional in nature, meaning it is intended to represent shareable knowledge independent of any particular patient. This is in contrast to the Document Reference resource, which captures non-FHIR content related to a specific patient, and the Media and Binary resources which capture multimedia content and raw binary content, respectively.