use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryDependencyGathererTest method library_with_no_valid_data___returns_nothing.
@Test
public void library_with_no_valid_data___returns_nothing() {
String libraryId = "lib";
Library lib = new Library();
withIdentifiers(lib, libraryId, null, null);
MapFhirResourceResolver<Library, Identifier> resourceResolver = getMapFhirResourceResolver();
resourceResolver.addResource(lib);
R4LibraryDependencyGatherer dependencyGatherer = new R4LibraryDependencyGatherer(resourceResolver);
List<Library> libraries = dependencyGatherer.gatherForLibraryId(libraryId);
Assert.assertTrue(libraries.isEmpty());
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryDependencyGathererTest method withRelation.
private void withRelation(Library library, String relatedUrl) {
RelatedArtifact relation = new RelatedArtifact().setType(RelatedArtifact.RelatedArtifactType.DEPENDSON).setResource(relatedUrl);
library.addRelatedArtifact(relation);
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4TranslatingLibraryLoaderTest method withContent.
private void withContent(Library library, String resourcePath, String contentType) throws IOException {
Attachment attachment = new Attachment();
attachment.setContentType(contentType);
attachment.setData(IOUtils.resourceToByteArray(resourcePath));
library.addContent(attachment);
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4TranslatingLibraryLoaderTest method load_validCql.
@Test
public void load_validCql() throws IOException {
Library library = new Library();
withIdentifiers(library, NAME, VERSION);
withContent(library, "/cql/basic/Test-1.0.0.cql", "text/cql");
R4TranslatingLibraryLoader loader = getLoader(getLibraryResolver(NAME, VERSION, library));
VersionedIdentifier identifier = new VersionedIdentifier().withId(NAME).withVersion(VERSION);
org.cqframework.cql.elm.execution.Library actual = loader.load(identifier);
Assert.assertEquals(identifier, actual.getIdentifier());
Assert.assertEquals(4, actual.getStatements().getDef().size());
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryResourceFieldHandlerTest method getUrl.
@Test
public void getUrl() {
String url = "url";
Library library = new Library();
library.setUrl(url);
Assert.assertEquals(url, libraryFieldHandler.getUrl(library));
}
Aggregations