Search in sources :

Example 6 with MeasureParameterInfo

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

the class FHIRRestUtilsTest method testGetParametersForMeasureId.

@PrepareForTest({ FHIRRestUtils.class })
@Test
public void testGetParametersForMeasureId() {
    String measureId = "measureId";
    FhirResourceResolver<Measure> measureResolver = Mockito.mock(FhirResourceResolver.class);
    Mockito.when(measureResolver.resolveById(measureId)).thenReturn(createMeasure(testMeasureDef));
    List<MeasureParameterInfo> parameterInfoList = FHIRRestUtils.getParametersForMeasureId(measureResolver, measureId);
    MeasureParameterInfo expectedParamInfo = new MeasureParameterInfo();
    expectedParamInfo.setname("aName");
    expectedParamInfo.setUse("In");
    expectedParamInfo.setMax("1");
    expectedParamInfo.setMin(0);
    expectedParamInfo.setType("String");
    expectedParamInfo.setDocumentation(null);
    expectedParamInfo.defaultValue("42");
    assertThat(parameterInfoList, containsInAnyOrder(expectedParamInfo));
}
Also used : MeasureParameterInfo(com.ibm.cohort.engine.api.service.model.MeasureParameterInfo) Measure(org.hl7.fhir.r4.model.Measure) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

MeasureParameterInfo (com.ibm.cohort.engine.api.service.model.MeasureParameterInfo)6 Measure (org.hl7.fhir.r4.model.Measure)6 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 Identifier (org.hl7.fhir.r4.model.Identifier)3 Test (org.junit.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 MeasureParameterInfoList (com.ibm.cohort.engine.api.service.model.MeasureParameterInfoList)2 FhirClientBuilder (com.ibm.cohort.fhir.client.config.FhirClientBuilder)2 FhirServerConfig (com.ibm.cohort.fhir.client.config.FhirServerConfig)2 IAttachment (com.ibm.websphere.jaxrs20.multipart.IAttachment)2 ApiImplicitParams (io.swagger.annotations.ApiImplicitParams)2 ApiOperation (io.swagger.annotations.ApiOperation)2 ApiResponse (io.swagger.annotations.ApiResponse)2 ApiResponses (io.swagger.annotations.ApiResponses)2 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 Response (javax.ws.rs.core.Response)2