Class InMemoryLibraryContentProvider

  • All Implemented Interfaces:
    org.cqframework.cql.cql2elm.LibrarySourceProvider, LibraryContentProvider

    public class InMemoryLibraryContentProvider
    extends Object
    implements LibraryContentProvider
    This class implements the LibraryContentProvider API, using a set of strings representing CQL library content as a source.
    • Constructor Detail

      • InMemoryLibraryContentProvider

        public InMemoryLibraryContentProvider​(List<String> libraries)
    • Method Detail

      • getLibrarySource

        public InputStream getLibrarySource​(org.hl7.elm.r1.VersionedIdentifier libraryIdentifier)
        Description copied from interface: LibraryContentProvider
        Gets the content of a library as CQL text. If the versionedIdentifier has a version specified it returns the nearest compatible version. If a version is not specified it returns the highest version. If no compatible version is found, it returns null.
        Specified by:
        getLibrarySource in interface LibraryContentProvider
        Specified by:
        getLibrarySource in interface org.cqframework.cql.cql2elm.LibrarySourceProvider
        Parameters:
        libraryIdentifier - The identifier of the library to provide content for.
        Returns:
        InputStream the CQL text.
      • getLibraryContent

        public InputStream getLibraryContent​(org.hl7.elm.r1.VersionedIdentifier libraryIdentifier,
                                             LibraryContentType libraryContentType)
        Description copied from interface: LibraryContentProvider
        Get content of a library in the format specified. If the versionedIdentifier has a version specified it returns the nearest compatible version. If a version is not specified it returns the highest version. If no compatible version is found, it returns null. Returns null if unable to provide the type of content specified.
        Specified by:
        getLibraryContent in interface LibraryContentProvider
        Parameters:
        libraryIdentifier - The identifier of the library to provide content for.
        libraryContentType - The format of the content to return
        Returns:
        InputStream the library content