Search in sources :

Example 1 with CohortEvaluation

use of com.ibm.cohort.engine.api.service.model.CohortEvaluation in project quality-measure-and-cohort-service by Alvearie.

the class CohortEngineRestHandler method evaluateCohort.

@POST
@Path("/cohort-evaluation")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({ MediaType.APPLICATION_JSON })
@ApiOperation(value = "Evaluates a specific define within a CQL for a set of patients", notes = COHORT_EVALUATION_API_NOTES, response = String.class, tags = { "Cohort Evaluation" }, nickname = "evaluate_cohort", extensions = { @Extension(properties = { @ExtensionProperty(name = DarkFeatureSwaggerFilter.DARK_FEATURE_NAME, value = CohortEngineRestConstants.DARK_LAUNCHED_COHORT_EVALUATION) }) })
@ApiImplicitParams({ // This is necessary for the dark launch feature
@ApiImplicitParam(access = DarkFeatureSwaggerFilter.DARK_FEATURE_CONTROLLED, paramType = "header", dataType = "string"), @ApiImplicitParam(name = REQUEST_DATA_PART, value = EXAMPLE_COHORT_REQUEST_DATA_JSON, dataTypeClass = CohortEvaluation.class, required = true, paramType = "form", type = "file"), @ApiImplicitParam(name = CQL_DEFINITION, value = CQL_REQUIREMENTS, dataTypeClass = File.class, required = true, paramType = "form", type = "file") })
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful Operation", response = CohortResult.class), @ApiResponse(code = 400, message = "Bad Request", response = ServiceErrorList.class), @ApiResponse(code = 500, message = "Server Error", response = ServiceErrorList.class) })
public Response evaluateCohort(@Context HttpServletRequest request, @ApiParam(value = ServiceBaseConstants.MINOR_VERSION_DESCRIPTION, required = true, defaultValue = ServiceBuildConstants.DATE) @QueryParam(CohortEngineRestHandler.VERSION) String version, @ApiParam(hidden = true, type = "file", required = true) IMultipartBody multipartBody) {
    final String methodName = MethodNames.EVALUATE_COHORT.getName();
    Response response = null;
    // Error out if feature is not enabled
    ServiceBaseUtility.isDarkFeatureEnabled(CohortEngineRestConstants.DARK_LAUNCHED_MEASURE_EVALUATION);
    try {
        // Perform api setup
        Response errorResponse = ServiceBaseUtility.apiSetup(version, logger, methodName);
        if (errorResponse != null) {
            return errorResponse;
        }
        if (multipartBody == null) {
            throw new IllegalArgumentException("A multipart/form-data body is required");
        }
        IAttachment metadataAttachment = multipartBody.getAttachment(REQUEST_DATA_PART);
        if (metadataAttachment == null) {
            throw new IllegalArgumentException(String.format("Missing '%s' MIME attachment", REQUEST_DATA_PART));
        }
        // deserialize the MeasuresEvaluation request
        ObjectMapper om = new ObjectMapper();
        CohortEvaluation evaluationRequest = om.readValue(metadataAttachment.getDataHandler().getInputStream(), CohortEvaluation.class);
        FhirServerConfig dataServerConfig = evaluationRequest.getDataServerConfig();
        FhirServerConfig terminologyServerConfig = evaluationRequest.getTerminologyServerConfig() == null ? evaluationRequest.getDataServerConfig() : evaluationRequest.getTerminologyServerConfig();
        IAttachment cqlAttachment = multipartBody.getAttachment(CQL_DEFINITION);
        if (cqlAttachment == null) {
            throw new IllegalArgumentException(String.format("Missing '%s' MIME attachment", CQL_DEFINITION));
        }
        // validate the contents of the fhirServerConfig
        validateBean(dataServerConfig);
        validateBean(terminologyServerConfig);
        FhirClientBuilderFactory clientBuilderFactory = FhirClientBuilderFactory.newInstance();
        FhirClientBuilder clientBuilder = clientBuilderFactory.newFhirClientBuilder();
        CqlLibraryProvider libraryProvider;
        try (InputStream is = cqlAttachment.getDataHandler().getInputStream()) {
            ZipInputStream zis = new ZipInputStream(is);
            MapCqlLibraryProviderFactory libraryProviderFactory = new MapCqlLibraryProviderFactory();
            String[] attachmentHeaders = cqlAttachment.getHeader("Content-Disposition").split(";");
            String filename = null;
            for (String header : attachmentHeaders) {
                if (header.contains("filename")) {
                    filename = FilenameUtils.removeExtension(header.split("=")[1].replaceAll("\"", ""));
                }
            }
            String[] searchPaths = new String[] { "cql", filename + "/cql" };
            libraryProvider = libraryProviderFactory.fromZipStream(zis, searchPaths);
        }
        CqlLibraryProvider fhirClasspathProvider = new ClasspathCqlLibraryProvider();
        libraryProvider = new PriorityCqlLibraryProvider(libraryProvider, fhirClasspathProvider);
        CqlToElmTranslator translator = new CqlToElmTranslator();
        libraryProvider = new TranslatingCqlLibraryProvider(libraryProvider, translator);
        IGenericClient dataClient = clientBuilder.createFhirClient(dataServerConfig);
        IGenericClient termClient = clientBuilder.createFhirClient(terminologyServerConfig);
        CqlTerminologyProvider termProvider = new R4RestFhirTerminologyProvider(termClient);
        List<String> passingPatients;
        try (RetrieveCacheContext retrieveCacheContext = new DefaultRetrieveCacheContext()) {
            passingPatients = evaluateCohort(dataClient, termProvider, libraryProvider, retrieveCacheContext, evaluationRequest);
        }
        response = Response.status(Response.Status.OK).header("Content-Type", "application/json").entity(new CohortResult(passingPatients)).build();
    } catch (Throwable e) {
        // map any exceptions caught into the proper REST error response objects
        response = new CohortServiceExceptionMapper().toResponse(e);
    } finally {
        // Perform api cleanup
        Response errorResponse = ServiceBaseUtility.apiCleanup(logger, methodName);
        if (errorResponse != null) {
            response = errorResponse;
        }
    }
    return response;
}
Also used : TranslatingCqlLibraryProvider(com.ibm.cohort.cql.translation.TranslatingCqlLibraryProvider) CohortEvaluation(com.ibm.cohort.engine.api.service.model.CohortEvaluation) IGenericClient(ca.uhn.fhir.rest.client.api.IGenericClient) R4RestFhirTerminologyProvider(com.ibm.cohort.engine.terminology.R4RestFhirTerminologyProvider) DefaultRetrieveCacheContext(com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext) RetrieveCacheContext(com.ibm.cohort.engine.measure.cache.RetrieveCacheContext) CqlToElmTranslator(com.ibm.cohort.cql.translation.CqlToElmTranslator) CqlLibraryProvider(com.ibm.cohort.cql.library.CqlLibraryProvider) PriorityCqlLibraryProvider(com.ibm.cohort.cql.library.PriorityCqlLibraryProvider) TranslatingCqlLibraryProvider(com.ibm.cohort.cql.translation.TranslatingCqlLibraryProvider) ClasspathCqlLibraryProvider(com.ibm.cohort.cql.library.ClasspathCqlLibraryProvider) IAttachment(com.ibm.websphere.jaxrs20.multipart.IAttachment) MapCqlLibraryProviderFactory(com.ibm.cohort.cql.library.MapCqlLibraryProviderFactory) CqlTerminologyProvider(com.ibm.cohort.cql.terminology.CqlTerminologyProvider) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) FhirClientBuilder(com.ibm.cohort.fhir.client.config.FhirClientBuilder) ZipInputStream(java.util.zip.ZipInputStream) InputStream(java.io.InputStream) CohortResult(com.ibm.cohort.engine.api.service.model.CohortResult) DefaultRetrieveCacheContext(com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext) PriorityCqlLibraryProvider(com.ibm.cohort.cql.library.PriorityCqlLibraryProvider) Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.annotations.ApiResponse) ZipInputStream(java.util.zip.ZipInputStream) FhirClientBuilderFactory(com.ibm.cohort.fhir.client.config.FhirClientBuilderFactory) FhirServerConfig(com.ibm.cohort.fhir.client.config.FhirServerConfig) ClasspathCqlLibraryProvider(com.ibm.cohort.cql.library.ClasspathCqlLibraryProvider) Path(javax.ws.rs.Path) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 2 with CohortEvaluation

use of com.ibm.cohort.engine.api.service.model.CohortEvaluation in project quality-measure-and-cohort-service by Alvearie.

the class CohortEngineRestHandlerTest method testCohortMultipleDependencies.

@PrepareForTest({ Response.class, FHIRRestUtils.class })
@Test
public void testCohortMultipleDependencies() throws Exception {
    prepMocks();
    mockResponseClasses();
    mockFhirResourceRetrieval("/metadata?_format=json", getCapabilityStatement());
    Patient patient = getPatient("123", AdministrativeGender.FEMALE, 40);
    mockFhirResourceRetrieval(patient);
    PowerMockito.mockStatic(ServiceBaseUtility.class);
    PowerMockito.mockStatic(FHIRRestUtils.class);
    PowerMockito.mockStatic(DefaultFhirClientBuilder.class);
    PowerMockito.when(ServiceBaseUtility.apiSetup(VERSION, logger, MethodNames.EVALUATE_COHORT.getName())).thenReturn(null);
    PowerMockito.whenNew(DefaultFhirClientBuilder.class).withArguments(Mockito.any()).thenReturn(mockDefaultFhirClientBuilder);
    // Create the ZIP part of the request
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try (ZipOutputStream zos = new ZipOutputStream(baos)) {
        File baseFile = new File("src/test/resources/cql/dependency_test-1.0.0/DependencyTest-1.0.0.cql");
        ZipEntry firstEntry = new ZipEntry("cql/DependencyTest-1.0.0.cql");
        zos.putNextEntry(firstEntry);
        byte[] x = new byte[(int) baseFile.length()];
        new FileInputStream(baseFile).read(x);
        zos.write(x);
        File additionalFile = new File("src/test/resources/cql/dependency_test-1.0.0/ImportantDependency-1.1.1.cql");
        ZipEntry secondEntry = new ZipEntry("cql/ImportantDependency-1.1.1.cql");
        zos.putNextEntry(secondEntry);
        byte[] y = new byte[(int) additionalFile.length()];
        new FileInputStream(additionalFile).read(y);
        zos.write(y);
        zos.closeEntry();
    }
    CohortEvaluation requestData = new CohortEvaluation();
    FhirServerConfig serverConfig = getFhirServerConfig();
    requestData.setDataServerConfig(serverConfig);
    requestData.setTerminologyServerConfig(serverConfig);
    requestData.setDefineToRun("DependentFemale");
    requestData.setEntrypoint("DependencyTest-1.0.0.cql");
    requestData.setPatientIds("123");
    requestData.setLoggingLevel(CqlDebug.TRACE);
    ObjectMapper om = new ObjectMapper();
    String json = om.writeValueAsString(requestData);
    ByteArrayInputStream jsonIs = new ByteArrayInputStream(json.getBytes());
    IAttachment request = mockAttachment(jsonIs);
    ByteArrayInputStream zipIs = new ByteArrayInputStream(baos.toByteArray());
    IAttachment measurePart = mockAttachment(zipIs);
    // Assemble them together into a reasonable facsimile of the real request
    IMultipartBody body = getFhirConfigFileBody();
    when(body.getAttachment(CohortEngineRestHandler.CQL_DEFINITION)).thenReturn(measurePart);
    when(body.getAttachment(CohortEngineRestHandler.REQUEST_DATA_PART)).thenReturn(request);
    when(measurePart.getDataHandler().getName()).thenReturn("dependency_test-1.0.0.zip");
    when(measurePart.getHeader("Content-Disposition")).thenReturn("dependency_test-1.0.0.zip");
    Response loadResponse = restHandler.evaluateCohort(mockRequestContext, null, body);
    assertNotNull(loadResponse);
    PowerMockito.verifyStatic(Response.class);
    Response.status(Status.OK);
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiSetup(Mockito.isNull(), Mockito.any(), Mockito.anyString());
    // verifyStatic must be called before each verification
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiCleanup(Mockito.any(), Mockito.eq(MethodNames.EVALUATE_COHORT.getName()));
}
Also used : CohortEvaluation(com.ibm.cohort.engine.api.service.model.CohortEvaluation) ZipEntry(java.util.zip.ZipEntry) Patient(org.hl7.fhir.r4.model.Patient) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IAttachment(com.ibm.websphere.jaxrs20.multipart.IAttachment) FileInputStream(java.io.FileInputStream) Response(javax.ws.rs.core.Response) IMultipartBody(com.ibm.websphere.jaxrs20.multipart.IMultipartBody) ByteArrayInputStream(java.io.ByteArrayInputStream) ZipOutputStream(java.util.zip.ZipOutputStream) FhirServerConfig(com.ibm.cohort.fhir.client.config.FhirServerConfig) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 3 with CohortEvaluation

use of com.ibm.cohort.engine.api.service.model.CohortEvaluation in project quality-measure-and-cohort-service by Alvearie.

the class CohortEngineRestHandlerTest method testCohortBadDefine.

@PrepareForTest({ Response.class, FHIRRestUtils.class })
@Test
public void testCohortBadDefine() throws Exception {
    prepMocks();
    mockResponseClasses();
    // Create the ZIP part of the request
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try (ZipOutputStream zos = new ZipOutputStream(baos)) {
        File tempFile = new File("src/test/resources/cql/basic/Test-1.0.0.cql");
        ZipEntry entry = new ZipEntry("cql/Test-1.0.0.cql");
        zos.putNextEntry(entry);
        byte[] x = new byte[(int) tempFile.length()];
        new FileInputStream(tempFile).read(x);
        zos.write(x);
        zos.closeEntry();
    }
    ByteArrayInputStream zipIs = new ByteArrayInputStream(baos.toByteArray());
    IAttachment measurePart = mockAttachment(zipIs);
    CohortEvaluation requestData = new CohortEvaluation();
    FhirServerConfig serverConfig = getFhirServerConfig();
    requestData.setDataServerConfig(serverConfig);
    requestData.setTerminologyServerConfig(serverConfig);
    requestData.setDefineToRun(null);
    requestData.setLoggingLevel(CqlDebug.TRACE);
    requestData.setEntrypoint("Test-1.0.0.cql");
    requestData.setPatientIds("123");
    ObjectMapper om = new ObjectMapper();
    String json = om.writeValueAsString(requestData);
    ByteArrayInputStream jsonIs = new ByteArrayInputStream(json.getBytes());
    IAttachment request = mockAttachment(jsonIs);
    // Assemble them together into a reasonable facsimile of the real request
    IMultipartBody body = getFhirConfigFileBody();
    when(body.getAttachment(CohortEngineRestHandler.CQL_DEFINITION)).thenReturn(measurePart);
    when(body.getAttachment(CohortEngineRestHandler.REQUEST_DATA_PART)).thenReturn(request);
    when(measurePart.getDataHandler().getName()).thenReturn("cql/basic/Test-1.0.0.cql");
    when(measurePart.getHeader("Content-Disposition")).thenReturn("cql/basic/Test-1.0.0.cql");
    Response loadResponse = restHandler.evaluateCohort(mockRequestContext, null, body);
    assertNotNull(loadResponse);
    PowerMockito.verifyStatic(Response.class);
    Response.status(400);
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiSetup(Mockito.isNull(), Mockito.any(), Mockito.anyString());
    // verifyStatic must be called before each verification
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiCleanup(Mockito.any(), Mockito.eq(MethodNames.EVALUATE_COHORT.getName()));
}
Also used : CohortEvaluation(com.ibm.cohort.engine.api.service.model.CohortEvaluation) ZipEntry(java.util.zip.ZipEntry) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IAttachment(com.ibm.websphere.jaxrs20.multipart.IAttachment) FileInputStream(java.io.FileInputStream) Response(javax.ws.rs.core.Response) IMultipartBody(com.ibm.websphere.jaxrs20.multipart.IMultipartBody) ByteArrayInputStream(java.io.ByteArrayInputStream) ZipOutputStream(java.util.zip.ZipOutputStream) FhirServerConfig(com.ibm.cohort.fhir.client.config.FhirServerConfig) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 4 with CohortEvaluation

use of com.ibm.cohort.engine.api.service.model.CohortEvaluation in project quality-measure-and-cohort-service by Alvearie.

the class CohortEngineRestHandlerTest method testCohortEvaluation.

@PrepareForTest({ Response.class, FHIRRestUtils.class })
@Test
public void testCohortEvaluation() throws Exception {
    prepMocks();
    mockResponseClasses();
    mockFhirResourceRetrieval("/metadata?_format=json", getCapabilityStatement());
    Patient patient = getPatient("123", AdministrativeGender.FEMALE, 40);
    mockFhirResourceRetrieval(patient);
    PowerMockito.mockStatic(ServiceBaseUtility.class);
    PowerMockito.mockStatic(FHIRRestUtils.class);
    PowerMockito.mockStatic(DefaultFhirClientBuilder.class);
    PowerMockito.when(ServiceBaseUtility.apiSetup(VERSION, logger, MethodNames.EVALUATE_COHORT.getName())).thenReturn(null);
    PowerMockito.whenNew(DefaultFhirClientBuilder.class).withArguments(Mockito.any()).thenReturn(mockDefaultFhirClientBuilder);
    // Create the ZIP part of the request
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try (ZipOutputStream zos = new ZipOutputStream(baos)) {
        File tempFile = new File("src/test/resources/cql/basic/Test-1.0.0.cql");
        ZipEntry entry = new ZipEntry("cql/Test-1.0.0.cql");
        zos.putNextEntry(entry);
        byte[] x = new byte[(int) tempFile.length()];
        new FileInputStream(tempFile).read(x);
        zos.write(x);
        zos.closeEntry();
    }
    CohortEvaluation requestData = new CohortEvaluation();
    FhirServerConfig serverConfig = getFhirServerConfig();
    requestData.setDataServerConfig(serverConfig);
    requestData.setTerminologyServerConfig(serverConfig);
    requestData.setDefineToRun("Female");
    requestData.setEntrypoint("Test-1.0.0.cql");
    requestData.setPatientIds("123");
    requestData.setLoggingLevel(CqlDebug.TRACE);
    ObjectMapper om = new ObjectMapper();
    String json = om.writeValueAsString(requestData);
    ByteArrayInputStream jsonIs = new ByteArrayInputStream(json.getBytes());
    IAttachment request = mockAttachment(jsonIs);
    ByteArrayInputStream zipIs = new ByteArrayInputStream(baos.toByteArray());
    IAttachment measurePart = mockAttachment(zipIs);
    // Assemble them together into a reasonable facsimile of the real request
    IMultipartBody body = getFhirConfigFileBody();
    when(body.getAttachment(CohortEngineRestHandler.CQL_DEFINITION)).thenReturn(measurePart);
    when(body.getAttachment(CohortEngineRestHandler.REQUEST_DATA_PART)).thenReturn(request);
    when(measurePart.getDataHandler().getName()).thenReturn("Test_1.0.0.zip");
    when(measurePart.getHeader("Content-Disposition")).thenReturn("Test_1.0.0.zip");
    Response loadResponse = restHandler.evaluateCohort(mockRequestContext, null, body);
    assertNotNull(loadResponse);
    PowerMockito.verifyStatic(Response.class);
    Response.status(Status.OK);
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiSetup(Mockito.isNull(), Mockito.any(), Mockito.anyString());
    // verifyStatic must be called before each verification
    PowerMockito.verifyStatic(ServiceBaseUtility.class);
    ServiceBaseUtility.apiCleanup(Mockito.any(), Mockito.eq(MethodNames.EVALUATE_COHORT.getName()));
}
Also used : CohortEvaluation(com.ibm.cohort.engine.api.service.model.CohortEvaluation) ZipEntry(java.util.zip.ZipEntry) Patient(org.hl7.fhir.r4.model.Patient) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IAttachment(com.ibm.websphere.jaxrs20.multipart.IAttachment) FileInputStream(java.io.FileInputStream) Response(javax.ws.rs.core.Response) IMultipartBody(com.ibm.websphere.jaxrs20.multipart.IMultipartBody) ByteArrayInputStream(java.io.ByteArrayInputStream) ZipOutputStream(java.util.zip.ZipOutputStream) FhirServerConfig(com.ibm.cohort.fhir.client.config.FhirServerConfig) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 5 with CohortEvaluation

use of com.ibm.cohort.engine.api.service.model.CohortEvaluation in project quality-measure-and-cohort-service by Alvearie.

the class DefaultVT method testCohortEvaluationWithLogging.

@Test
public void testCohortEvaluationWithLogging() {
    final String RESOURCE = getUrlBase() + "/{version}/cohort-evaluation";
    Assume.assumeTrue(isServiceDarkFeatureEnabled(CohortEngineRestConstants.DARK_LAUNCHED_VALUE_SET_UPLOAD));
    // Create the metadata part of the request
    CohortEvaluation requestData = new CohortEvaluation();
    requestData.setDataServerConfig(dataServerConfig);
    requestData.setTerminologyServerConfig(dataServerConfig);
    requestData.setDefineToRun("Male");
    requestData.setEntrypoint("cql/basic/Test-1.0.0.cql");
    requestData.setPatientIds(VALID_PATIENT_ID);
    requestData.setLoggingLevel(CqlDebug.TRACE);
    RequestSpecification request = buildBaseRequest(new Headers()).queryParam(CohortEngineRestHandler.VERSION, ServiceBuildConstants.DATE).multiPart(CohortEngineRestHandler.REQUEST_DATA_PART, requestData, "application/json").multiPart(CohortEngineRestHandler.CQL_DEFINITION, new File("src/test/resources/cql/zip/Test-1.0.0.zip"));
    ValidatableResponse response = request.post(RESOURCE, getServiceVersion()).then();
    ValidatableResponse vr = runSuccessValidation(response, ContentType.JSON, HttpStatus.SC_OK);
    String actual = vr.extract().response().getBody().prettyPrint();
    String expected = "{\n    \"result\": [\n        \n    ]\n}";
    assertEquals(expected, actual);
}
Also used : ValidatableResponse(com.jayway.restassured.response.ValidatableResponse) CohortEvaluation(com.ibm.cohort.engine.api.service.model.CohortEvaluation) Headers(com.jayway.restassured.response.Headers) RequestSpecification(com.jayway.restassured.specification.RequestSpecification) File(java.io.File) Test(org.junit.Test)

Aggregations

CohortEvaluation (com.ibm.cohort.engine.api.service.model.CohortEvaluation)9 File (java.io.File)8 Test (org.junit.Test)8 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 FhirServerConfig (com.ibm.cohort.fhir.client.config.FhirServerConfig)5 IAttachment (com.ibm.websphere.jaxrs20.multipart.IAttachment)5 Response (javax.ws.rs.core.Response)5 IMultipartBody (com.ibm.websphere.jaxrs20.multipart.IMultipartBody)4 Headers (com.jayway.restassured.response.Headers)4 ValidatableResponse (com.jayway.restassured.response.ValidatableResponse)4 RequestSpecification (com.jayway.restassured.specification.RequestSpecification)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 FileInputStream (java.io.FileInputStream)4 ZipEntry (java.util.zip.ZipEntry)4 ZipOutputStream (java.util.zip.ZipOutputStream)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 CohortResult (com.ibm.cohort.engine.api.service.model.CohortResult)3 Patient (org.hl7.fhir.r4.model.Patient)3 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)1