use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryResourceFieldHandlerTest method getName.
@Test
public void getName() {
String name = "name";
Library library = new Library();
library.setName(name);
Assert.assertEquals(name, libraryFieldHandler.getName(library));
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryResourceFieldHandlerTest method getIdentifiers.
@Test
public void getIdentifiers() {
Identifier identifier = new Identifier().setSystem("system").setValue("value");
Library library = new Library();
library.addIdentifier(identifier);
List<Identifier> libraryIdentifiers = libraryFieldHandler.getIdentifiers(library);
Assert.assertEquals(1, libraryIdentifiers.size());
Assert.assertTrue(identifier.equalsDeep(libraryIdentifiers.get(0)));
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryResourceFieldHandlerTest method getId.
@Test
public void getId() {
String id = "id";
Library library = new Library();
library.setId(id);
Assert.assertEquals(id, libraryFieldHandler.getId(library));
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryFhirServerResourceResolverTest method resolveByName.
@Test
public void resolveByName() throws IOException {
String name = "Library1-name";
String version = "1.0.0";
mockRequest(WireMock::get, "/Library\\?name%3Aexact=" + name + "&version=" + version, 200, IOUtils.resourceToString("/fhir/rest-test/LibraryBundle.json", StandardCharsets.UTF_8));
FhirResourceResolver<Library> resolver = R4FhirServerResourceResolverFactory.createLibraryResolver(client);
Library library = resolver.resolveByName(name, version);
String expected = "Library/Library1-id";
Assert.assertEquals(expected, library.getId());
}
use of org.hl7.fhir.r4b.model.Library in project quality-measure-and-cohort-service by Alvearie.
the class R4LibraryFhirServerResourceResolverTest method resolveByIdentifier_noVersion.
@Test
public void resolveByIdentifier_noVersion() throws IOException {
String idValue = "Library1-idValue";
String idSystem = "Library1-idSystem";
mockRequest(WireMock::get, "/Library\\?identifier=" + idSystem + "%7C" + idValue, 200, IOUtils.resourceToString("/fhir/rest-test/LibraryBundle.json", StandardCharsets.UTF_8));
FhirResourceResolver<Library> resolver = R4FhirServerResourceResolverFactory.createLibraryResolver(client);
Library library = resolver.resolveByIdentifier(idValue, idSystem, null);
String expected = "Library/Library1-id";
Assert.assertEquals(expected, library.getId());
}
Aggregations