use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class MeasureEvaluationTest method when_serialize_deserialize___properties_are_unchanged.
@Test
public void when_serialize_deserialize___properties_are_unchanged() throws Exception {
FhirServerConfig dataServerConfig = new FhirServerConfig();
dataServerConfig.setEndpoint("dataserver");
FhirServerConfig termServerConfig = new FhirServerConfig();
termServerConfig.setEndpoint("termserver");
Map<String, Parameter> parameterOverrides = new HashMap<>();
parameterOverrides.put("Measurement Period", new IntervalParameter(new DateParameter("2019-07-04"), true, new DateParameter("2020-07-04"), true));
MeasureContext ctx = new MeasureContext("measureId", parameterOverrides);
MeasureEvaluation evaluation = new MeasureEvaluation();
evaluation.setDataServerConfig(dataServerConfig);
evaluation.setTerminologyServerConfig(termServerConfig);
evaluation.setPatientId("patientId");
evaluation.setMeasureContext(ctx);
evaluation.setEvidenceOptions(new MeasureEvidenceOptions(false, MeasureEvidenceOptions.DefineReturnOptions.ALL));
ObjectMapper om = new ObjectMapper();
String serialized = om.writeValueAsString(evaluation);
MeasureEvaluation deserialized = om.readValue(serialized, MeasureEvaluation.class);
assertEquals(evaluation, deserialized);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class CohortEvaluationTest method when_serialize_deserialize___properties_are_unchanged.
@Test
public void when_serialize_deserialize___properties_are_unchanged() throws Exception {
FhirServerConfig dataServerConfig = new FhirServerConfig();
dataServerConfig.setEndpoint("dataserver");
FhirServerConfig termServerConfig = new FhirServerConfig();
termServerConfig.setEndpoint("termserver");
Map<String, Parameter> parameterOverrides = new HashMap<>();
parameterOverrides.put("Measurement Period", new IntervalParameter(new DateParameter("2019-07-04"), true, new DateParameter("2020-07-04"), true));
CohortEvaluation evaluation = new CohortEvaluation();
evaluation.setDataServerConfig(dataServerConfig);
evaluation.setTerminologyServerConfig(termServerConfig);
evaluation.setPatientIds("patientId");
evaluation.setParameters(parameterOverrides);
evaluation.setLoggingLevel(CqlDebug.TRACE);
evaluation.setEntrypoint("test-1.0.0.cql");
evaluation.setDefineToRun("fakeDefine");
ObjectMapper om = new ObjectMapper();
String serialized = om.writeValueAsString(evaluation);
CohortEvaluation deserialized = om.readValue(serialized, CohortEvaluation.class);
assertEquals(evaluation, deserialized);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class EnhancedHealthCheckInputTest method when_serialize_deserialize___properties_are_unchanged.
@Test
public void when_serialize_deserialize___properties_are_unchanged() throws Exception {
FhirServerConfig dataServerConfig = new FhirServerConfig();
dataServerConfig.setEndpoint("dataserver");
FhirServerConfig termServerConfig = new FhirServerConfig();
termServerConfig.setEndpoint("termserver");
EnhancedHealthCheckInput input = new EnhancedHealthCheckInput();
input.setDataServerConfig(dataServerConfig);
input.setTerminologyServerConfig(termServerConfig);
ObjectMapper om = new ObjectMapper();
String serialized = om.writeValueAsString(input);
EnhancedHealthCheckInput deserialized = om.readValue(serialized, EnhancedHealthCheckInput.class);
assertEquals(input, deserialized);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class EnhancedHealthCheckResultsTest method when_serialize_deserialize___properties_are_unchanged.
@Test
public void when_serialize_deserialize___properties_are_unchanged() throws Exception {
FhirServerConfig dataServerConfig = new FhirServerConfig();
dataServerConfig.setEndpoint("dataserver");
FhirServerConfig termServerConfig = new FhirServerConfig();
termServerConfig.setEndpoint("termserver");
EnhancedHealthCheckResults results = new EnhancedHealthCheckResults();
FhirServerConnectionStatusInfo dataServerConnectionResults = new FhirServerConnectionStatusInfo();
dataServerConnectionResults.setServerConfigType(FhirServerConfigType.dataServerConfig);
dataServerConnectionResults.setConnectionResults(FhirConnectionStatus.notAttempted);
FhirServerConnectionStatusInfo terminologyServerConnectionResults = new FhirServerConnectionStatusInfo();
terminologyServerConnectionResults.setServerConfigType(FhirServerConfigType.terminologyServerConfig);
terminologyServerConnectionResults.setConnectionResults(FhirConnectionStatus.notAttempted);
results.setDataServerConnectionResults(dataServerConnectionResults);
results.setTerminologyServerConnectionResults(terminologyServerConnectionResults);
ObjectMapper om = new ObjectMapper();
String serialized = om.writeValueAsString(results);
EnhancedHealthCheckResults deserialized = om.readValue(serialized, EnhancedHealthCheckResults.class);
assertEquals(results, deserialized);
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class FhirClientTimeoutTest method testFhirClientContext_requestTimesOut.
@Test(expected = FhirClientConnectionException.class)
public void testFhirClientContext_requestTimesOut() {
FhirServerConfig fhirServerConfig = getFhirServerConfig();
fhirServerConfig.setSocketTimeout(CONFIG_TIMEOUT_MILLIS);
FHIRClientContext fhirClientContext = new FHIRClientContext.Builder().withDefaultClient(fhirServerConfig).build();
fhirClientContext.getDataClient().read().resource(Patient.class).withId(PATIENT_ID).execute();
}
Aggregations