Search in sources :

Example 1 with JpaLibraryContentProvider

use of org.opencds.cqf.ruler.cql.JpaLibraryContentProvider in project cqf-ruler by DBCG.

the class DataOperationsProvider method createLibraryManager.

private LibraryManager createLibraryManager(Library library, RequestDetails theRequestDetails) {
    JpaLibraryContentProvider jpaLibraryContentProvider = jpaLibraryContentProviderFactory.create(theRequestDetails);
    Bundle libraryBundle = new Bundle();
    List<Library> listLib = fetchDependencyLibraries(library, theRequestDetails);
    listLib.add(library);
    listLib.forEach(lib -> {
        Bundle.BundleEntryComponent component = new Bundle.BundleEntryComponent();
        component.setResource(lib);
        libraryBundle.addEntry(component);
    });
    LibraryContentProvider bundleLibraryProvider = new BundleFhirLibraryContentProvider(this.getFhirContext(), libraryBundle, adapterFactory, libraryVersionSelector);
    List<LibraryContentProvider> sourceProviders = new ArrayList<>(Arrays.asList(bundleLibraryProvider, jpaLibraryContentProvider));
    return libraryManagerFactory.create(sourceProviders);
}
Also used : BundleFhirLibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.fhir.BundleFhirLibraryContentProvider) LibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.LibraryContentProvider) JpaLibraryContentProvider(org.opencds.cqf.ruler.cql.JpaLibraryContentProvider) BundleFhirLibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.fhir.BundleFhirLibraryContentProvider) Bundle(org.hl7.fhir.r4.model.Bundle) JpaLibraryContentProvider(org.opencds.cqf.ruler.cql.JpaLibraryContentProvider) ArrayList(java.util.ArrayList) Library(org.hl7.fhir.r4.model.Library)

Example 2 with JpaLibraryContentProvider

use of org.opencds.cqf.ruler.cql.JpaLibraryContentProvider in project cqf-ruler by DBCG.

the class DataOperationsProvider method createLibraryManager.

private LibraryManager createLibraryManager(Library library, RequestDetails theRequestDetails) {
    JpaLibraryContentProvider jpaLibraryContentProvider = jpaLibraryContentProviderFactory.create(theRequestDetails);
    Bundle libraryBundle = new Bundle();
    List<Library> listLib = fetchDependencyLibraries(library, theRequestDetails);
    listLib.add(library);
    listLib.forEach(lib -> {
        Bundle.BundleEntryComponent component = new Bundle.BundleEntryComponent();
        component.setResource(lib);
        libraryBundle.addEntry(component);
    });
    LibraryContentProvider bundleLibraryProvider = new BundleFhirLibraryContentProvider(this.getFhirContext(), libraryBundle, adapterFactory, libraryVersionSelector);
    List<LibraryContentProvider> sourceProviders = Lists.newArrayList(bundleLibraryProvider, jpaLibraryContentProvider);
    return libraryManagerFactory.create(sourceProviders);
}
Also used : BundleFhirLibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.fhir.BundleFhirLibraryContentProvider) LibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.LibraryContentProvider) JpaLibraryContentProvider(org.opencds.cqf.ruler.cql.JpaLibraryContentProvider) BundleFhirLibraryContentProvider(org.opencds.cqf.cql.evaluator.cql2elm.content.fhir.BundleFhirLibraryContentProvider) Bundle(org.hl7.fhir.dstu3.model.Bundle) JpaLibraryContentProvider(org.opencds.cqf.ruler.cql.JpaLibraryContentProvider) Library(org.hl7.fhir.dstu3.model.Library)

Aggregations

LibraryContentProvider (org.opencds.cqf.cql.evaluator.cql2elm.content.LibraryContentProvider)2 BundleFhirLibraryContentProvider (org.opencds.cqf.cql.evaluator.cql2elm.content.fhir.BundleFhirLibraryContentProvider)2 JpaLibraryContentProvider (org.opencds.cqf.ruler.cql.JpaLibraryContentProvider)2 ArrayList (java.util.ArrayList)1 Bundle (org.hl7.fhir.dstu3.model.Bundle)1 Library (org.hl7.fhir.dstu3.model.Library)1 Bundle (org.hl7.fhir.r4.model.Bundle)1 Library (org.hl7.fhir.r4.model.Library)1