use of org.hl7.fhir.r4.model.ValueSet in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsAuthenticationErrorUsername.
@Test
public void testCacheValueSetsAuthenticationErrorUsername() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = getStringAndListParamFromValueSet("valueset/AcuteInpatient.json");
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, "username", null);
String detailMessage = "User name was provided, but not a password.";
validateOutcome(outcomeResource, detailMessage);
}
use of org.hl7.fhir.r4.model.ValueSet in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsValueSetDNE.
@Test
public void testCacheValueSetsValueSetDNE() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = new StringAndListParam();
stringAndListParam.setValuesAsQueryTokens(getFhirContext(), "valueset", Arrays.asList(QualifiedParamList.singleton("dne")));
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, null);
validateOutcome(outcomeResource, "HTTP 404 : Resource ValueSet/" + "dne" + " is not known");
}
use of org.hl7.fhir.r4.model.ValueSet in project cqf-ruler by DBCG.
the class CodeSystemProviderIT method testDSTU3UpdateCodeSystems.
@Test
@Order(5)
public void testDSTU3UpdateCodeSystems() throws IOException {
log.info("Beginning Test DSTU3 Update Code Systems");
assertEquals(0, performCodeSystemSearchByUrl(cptUrl).size());
File[] valuesets = new File(CodeSystemProviderIT.class.getResource("valueset").getPath()).listFiles();
for (File file : valuesets) {
if (file.isFile() && FilenameUtils.getExtension(file.getPath()).equals("json")) {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String resourceString = reader.lines().collect(Collectors.joining(System.lineSeparator()));
reader.close();
loadResource("json", resourceString);
} else if (file.isFile() && FilenameUtils.getExtension(file.getPath()).equals("xml")) {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String resourceString = reader.lines().collect(Collectors.joining(System.lineSeparator()));
reader.close();
loadResource("xml", resourceString);
}
}
OperationOutcome outcome = codeSystemUpdateProvider.updateCodeSystems();
for (OperationOutcomeIssueComponent issue : outcome.getIssue()) {
assertEquals(OperationOutcome.IssueSeverity.INFORMATION, issue.getSeverity());
assertTrue(issue.getDetails().getText().startsWith("Successfully updated the following CodeSystems: "));
assertTrue(issue.getDetails().getText().contains("cpt"));
assertTrue(issue.getDetails().getText().contains("icd-10"));
assertTrue(issue.getDetails().getText().contains("sct"));
assertTrue(issue.getDetails().getText().contains("rxnorm"));
}
assertEquals(1, performCodeSystemSearchByUrl(icd10).size());
assertEquals(1, performCodeSystemSearchByUrl(rxNormUrl).size());
assertEquals(1, performCodeSystemSearchByUrl(snomedSctUrl).size());
assertEquals(1, performCodeSystemSearchByUrl(cptUrl).size());
log.info("Finished Test DSTU3 Update Code Systems");
}
use of org.hl7.fhir.r4.model.ValueSet in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsAuthenticationErrorUsername.
@Test
public void testCacheValueSetsAuthenticationErrorUsername() throws Exception {
Endpoint endpoint = uploadLocalServerEndpoint();
StringAndListParam stringAndListParam = getStringAndListParamFromValueSet("valueset/AcuteInpatient.json");
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, "username", null);
String detailMessage = "User name was provided, but not a password.";
validateOutcome(outcomeResource, detailMessage);
}
use of org.hl7.fhir.r4.model.ValueSet in project cqf-ruler by DBCG.
the class CacheValueSetsProviderIT method testCacheValueSetsEndpointDNE.
@Test
public void testCacheValueSetsEndpointDNE() throws Exception {
Endpoint endpoint = new Endpoint();
endpoint.setId(new IdType("localhost"));
StringAndListParam stringAndListParam = getStringAndListParamFromValueSet("valueset/AcuteInpatient.json");
RequestDetails details = Mockito.mock(RequestDetails.class);
Resource outcomeResource = cacheValueSetsProvider.cacheValuesets(details, endpoint.getIdElement(), stringAndListParam, null, null);
String detailMessage = "Could not find Endpoint/" + endpoint.getIdElement().getIdPart();
validateOutcome(outcomeResource, detailMessage);
}
Aggregations