use of com.b2international.snowowl.core.rest.SnowOwlOpenApiWebMvcResource in project snow-owl by b2ihealthcare.
the class FhirMetadataController method initCache.
private Holder initCache() {
final Holder holder = new Holder();
// XXX: we know that the subclass is instantiated (in SnowOwlApiConfig)
final OpenAPI openAPI = ((SnowOwlOpenApiWebMvcResource) openApiWebMvcResource).getOpenApi();
final Collection<Resource> resources = collectResources(openAPI);
final Collection<OperationDefinition> operationDefinitions = collectOperationDefinitions(openAPI);
final Rest.Builder restBuilder = Rest.builder().mode(RestfulCapabilityMode.SERVER).resources(resources);
holder.operationMap = newHashMap();
for (final OperationDefinition operationDefinition : operationDefinitions) {
for (final Code code : operationDefinition.getResources()) {
final String key = code.getCodeValue() + operationDefinition.getName();
holder.operationMap.put(key, operationDefinition);
restBuilder.addOperation(com.b2international.snowowl.fhir.core.model.capabilitystatement.Operation.builder().name(operationDefinition.getName()).definition(buildOperationUrl(code, operationDefinition)).build());
}
}
final String serverVersion = Platform.getBundle(CoreActivator.PLUGIN_ID).getVersion().toString();
String description = ApplicationContext.getServiceForClass(SnowOwlConfiguration.class).getDescription();
holder.capabilityStatement = CapabilityStatement.builder().name("FHIR Capability statement for Snow Owl© Terminology Server").status(PublicationStatus.ACTIVE).experimental(false).kind(CapabilityStatementKind.INSTANCE.getCode()).fhirVersion("4.0.1").addInstantiate(new Uri("http://hl7.org/fhir/CapabilityStatement/terminology-server")).software(Software.builder().name("Snow Owl©").version(serverVersion).build()).implementation(Implementation.builder().url("https://b2i.sg").description(description).build()).addFormat(new Code(AbstractFhirController.APPLICATION_FHIR_JSON)).addRest(restBuilder.build()).build();
return holder;
}
Aggregations