use of org.hl7.fhir.r5.model.CapabilityStatement in project dpc-app by CMSgov.
the class CapabilitiesTest method capabilitiesIsValid.
@Test
void capabilitiesIsValid() {
final CapabilityStatement capabilities = Capabilities.getCapabilities("https://sandbox.dpc.cms.gov/api/v1");
final ValidationResult validationResult = validator.validateWithResult(capabilities);
assertTrue(validationResult.isSuccessful(), validationResultsToString(validationResult));
}
use of org.hl7.fhir.r5.model.CapabilityStatement in project dpc-app by CMSgov.
the class BlueButtonClientV2Test method shouldReturnCapabilitiesStatement.
@Test
void shouldReturnCapabilitiesStatement() {
final CapabilityStatement statement = bbc.requestCapabilityStatement();
assertNotNull(statement, "Should be able to request capabilities statement.");
// We just need a simple test to verify that the statement is returned correctly.
assertEquals(Enumerations.PublicationStatus.ACTIVE, statement.getStatus(), "Should have ACTIVE status from test metadata");
}
use of org.hl7.fhir.r5.model.CapabilityStatement in project dpc-app by CMSgov.
the class TestBlueButtonHealth method testInvalidResponse.
@Test
void testInvalidResponse() {
final BlueButtonClient bbc = Mockito.mock(BlueButtonClient.class);
when(bbc.requestCapabilityStatement()).thenReturn(new CapabilityStatement().setStatus(Enumerations.PublicationStatus.DRAFT));
final BlueButtonHealthCheck blueButtonHealthCheck = new BlueButtonHealthCheck(bbc);
final HealthCheck.Result check = blueButtonHealthCheck.check();
assertAll(() -> assertFalse(check.isHealthy(), "Mock BlueButton should not healthy"), () -> assertEquals(BlueButtonHealthCheck.INVALID_MESSAGE, check.getMessage(), "Should throw exact message"));
}
use of org.hl7.fhir.r5.model.CapabilityStatement in project camel-quarkus by apache.
the class FhirDstu3Resource method capabilities.
// ///////////////////
// Capabilities
// ///////////////////
@Path("/capabilities")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String capabilities(@QueryParam("encodeAs") String encodeAs) {
Map<String, Object> headers = new HashMap<>();
if (encodeAs.equals("encodeJson") || encodeAs.equals("encodeXml")) {
headers.put(encodeAs, Boolean.TRUE);
}
CapabilityStatement result = producerTemplate.requestBodyAndHeaders("direct:capabilities-dstu3", CapabilityStatement.class, headers, CapabilityStatement.class);
return result.getStatus().name();
}
use of org.hl7.fhir.r5.model.CapabilityStatement in project cqf-ruler by DBCG.
the class Server method initialize.
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void initialize() throws ServletException {
super.initialize();
log.info("Loading metadata extenders from plugins");
Map<String, MetadataExtender> extenders = myApplicationContext.getBeansOfType(MetadataExtender.class);
for (MetadataExtender o : extenders.values()) {
log.info("Found {} extender", o.getClass().getName());
}
FhirVersionEnum fhirVersion = fhirSystemDao.getContext().getVersion().getVersion();
String implementationDescription = myServerProperties.getImplementation_description();
if (fhirVersion == FhirVersionEnum.DSTU2) {
List<MetadataExtender<Conformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<Conformance>) x).collect(Collectors.toList());
ExtensibleJpaConformanceProviderDstu2 confProvider = new ExtensibleJpaConformanceProviderDstu2(this, fhirSystemDao, daoConfig, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER DSTU2 Server"));
setServerConformanceProvider(confProvider);
} else {
if (fhirVersion == FhirVersionEnum.DSTU3) {
List<MetadataExtender<CapabilityStatement>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<CapabilityStatement>) x).collect(Collectors.toList());
ExtensibleJpaConformanceProviderDstu3 confProvider = new ExtensibleJpaConformanceProviderDstu3(this, fhirSystemDao, daoConfig, searchParamRegistry, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER DSTU3 Server"));
setServerConformanceProvider(confProvider);
} else if (fhirVersion == FhirVersionEnum.R4) {
List<MetadataExtender<IBaseConformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<IBaseConformance>) x).collect(Collectors.toList());
ExtensibleJpaCapabilityStatementProvider confProvider = new ExtensibleJpaCapabilityStatementProvider(this, fhirSystemDao, daoConfig, searchParamRegistry, myValidationSupport, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER R4 Server"));
setServerConformanceProvider(confProvider);
} else if (fhirVersion == FhirVersionEnum.R5) {
List<MetadataExtender<IBaseConformance>> extenderList = extenders.values().stream().map(x -> (MetadataExtender<IBaseConformance>) x).collect(Collectors.toList());
ExtensibleJpaCapabilityStatementProvider confProvider = new ExtensibleJpaCapabilityStatementProvider(this, fhirSystemDao, daoConfig, searchParamRegistry, myValidationSupport, extenderList);
confProvider.setImplementationDescription(firstNonNull(implementationDescription, "CQF RULER R5 Server"));
setServerConformanceProvider(confProvider);
} else {
throw new IllegalStateException();
}
}
log.info("Loading operation providers from plugins");
Map<String, OperationProvider> providers = myApplicationContext.getBeansOfType(OperationProvider.class);
for (OperationProvider o : providers.values()) {
log.info("Registering {}", o.getClass().getName());
this.registerProvider(o);
}
log.info("Loading interceptors from plugins");
Map<String, Interceptor> interceptors = myApplicationContext.getBeansOfType(Interceptor.class);
for (Interceptor o : interceptors.values()) {
log.info("Registering {} interceptor", o.getClass().getName());
this.registerInterceptor(o);
}
}
Aggregations