use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class ValueSetImporterTest method testImportAllExistingResources.
@Test
public void testImportAllExistingResources() throws IOException {
FhirServerConfig fhirConfig = getFhirServerConfig();
fhirConfig.setLogInfo(Collections.singletonList(FhirServerConfig.LogInfo.REQUEST_SUMMARY));
mockFhirResourceRetrieval("/metadata?_format=json", getCapabilityStatement());
Bundle oneResult = new Bundle();
Bundle.BundleEntryComponent entryComponent = new Bundle.BundleEntryComponent();
ValueSet set = new ValueSet();
String url = "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1114.7";
set.setUrl(url);
entryComponent.setFullUrl(url);
entryComponent.setResource(set);
oneResult.addEntry(entryComponent);
mockFhirResourceRetrieval(resourcePath, oneResult);
runTest(fhirConfig, defaultInputFile);
verify(1, getRequestedFor(urlEqualTo(resourcePath)));
verify(exactly(0), postRequestedFor(urlEqualTo("/ValueSet?_format=json")));
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class ValueSetImporterTest method testImportAllNewResources.
@Test
public void testImportAllNewResources() throws IOException {
FhirServerConfig fhirConfig = getFhirServerConfig();
fhirConfig.setLogInfo(Collections.singletonList(FhirServerConfig.LogInfo.REQUEST_SUMMARY));
mockFhirResourceRetrieval("/metadata?_format=json", getCapabilityStatement());
String valueSetId = UUID.randomUUID().toString();
Bundle noResults = new Bundle();
mockFhirResourceRetrieval(resourcePath, noResults);
mockFhirResourcePost("/ValueSet?_format=json", valueSetId, "1");
runTest(fhirConfig, defaultInputFile);
verify(1, postRequestedFor(urlEqualTo("/ValueSet?_format=json")));
}
use of com.ibm.cohort.fhir.client.config.FhirServerConfig in project quality-measure-and-cohort-service by Alvearie.
the class ValueSetImporterTest method testImportAllNewResourcesWithComments.
@Test
public void testImportAllNewResourcesWithComments() throws IOException {
FhirServerConfig fhirConfig = getFhirServerConfig();
fhirConfig.setLogInfo(Collections.singletonList(FhirServerConfig.LogInfo.REQUEST_SUMMARY));
mockFhirResourceRetrieval("/metadata?_format=json", getCapabilityStatement());
String valueSetId = UUID.randomUUID().toString();
Bundle noResults = new Bundle();
mockFhirResourceRetrieval(resourcePath, noResults);
mockFhirResourcePost("/ValueSet?_format=json", valueSetId, "1");
String inputFile = "src/test/resources/2.16.840.1.113762.1.4.1114.7-Comments.xlsx";
runTest(fhirConfig, inputFile);
verify(1, postRequestedFor(urlEqualTo("/ValueSet?_format=json")));
}
Aggregations