Search in sources :

Example 81 with Library

use of org.hl7.fhir.dstu3.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));
}
Also used : Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 82 with Library

use of org.hl7.fhir.dstu3.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)));
}
Also used : Identifier(org.hl7.fhir.r4.model.Identifier) Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 83 with Library

use of org.hl7.fhir.dstu3.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));
}
Also used : Library(org.hl7.fhir.r4.model.Library) Test(org.junit.Test)

Example 84 with Library

use of org.hl7.fhir.dstu3.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());
}
Also used : Library(org.hl7.fhir.r4.model.Library) WireMock(com.github.tomakehurst.wiremock.client.WireMock) Test(org.junit.Test)

Example 85 with Library

use of org.hl7.fhir.dstu3.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());
}
Also used : Library(org.hl7.fhir.r4.model.Library) WireMock(com.github.tomakehurst.wiremock.client.WireMock) Test(org.junit.Test)

Aggregations

Library (org.hl7.fhir.r4.model.Library)130 Test (org.junit.Test)85 Measure (org.hl7.fhir.r4.model.Measure)60 Patient (org.hl7.fhir.r4.model.Patient)41 HashMap (java.util.HashMap)36 Test (org.junit.jupiter.api.Test)34 ArrayList (java.util.ArrayList)32 Library (org.hl7.fhir.dstu3.model.Library)23 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)21 ByteArrayOutputStream (java.io.ByteArrayOutputStream)21 CapabilityStatement (org.hl7.fhir.r4.model.CapabilityStatement)21 MeasureReport (org.hl7.fhir.r4.model.MeasureReport)21 StringType (org.hl7.fhir.r4.model.StringType)21 IOException (java.io.IOException)20 VersionedIdentifier (org.cqframework.cql.elm.execution.VersionedIdentifier)20 FhirContext (ca.uhn.fhir.context.FhirContext)19 IParser (ca.uhn.fhir.parser.IParser)19 MeasureEvidenceOptions (com.ibm.cohort.engine.measure.evidence.MeasureEvidenceOptions)19 Bundle (org.hl7.fhir.r4.model.Bundle)19 Parameter (com.ibm.cohort.cql.evaluation.parameters.Parameter)18