use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class ConformanceProvider method buildSecurity.
@Nonnull
private CapabilityStatementRestSecurityComponent buildSecurity() {
final CapabilityStatementRestSecurityComponent security = new CapabilityStatementRestSecurityComponent();
security.setCors(true);
if (configuration.getAuth().isEnabled()) {
final OidcConfiguration checkedConfig = checkPresent(oidcConfiguration);
final CodeableConcept smart = new CodeableConcept(new Coding(RESTFUL_SECURITY_URI, RESTFUL_SECURITY_CODE, RESTFUL_SECURITY_CODE));
smart.setText("OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)");
security.getService().add(smart);
final Optional<String> authUrl = checkedConfig.get(AUTH_URL);
final Optional<String> tokenUrl = checkedConfig.get(TOKEN_URL);
final Optional<String> revokeUrl = checkedConfig.get(REVOKE_URL);
if (authUrl.isPresent() || tokenUrl.isPresent() || revokeUrl.isPresent()) {
final Extension oauthUris = new Extension(SMART_OAUTH_URI);
authUrl.ifPresent(url -> oauthUris.addExtension("authorize", new UriType(url)));
tokenUrl.ifPresent(url -> oauthUris.addExtension("token", new UriType(url)));
revokeUrl.ifPresent(url -> oauthUris.addExtension("revoke", new UriType(url)));
security.addExtension(oauthUris);
}
}
return security;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class ConformanceProvider method getServerConformance.
@Override
@Metadata(cacheMillis = 0)
public CapabilityStatement getServerConformance(@Nullable final HttpServletRequest httpServletRequest, @Nullable final RequestDetails requestDetails) {
log.debug("Received request for server capabilities");
final CapabilityStatement capabilityStatement = new CapabilityStatement();
capabilityStatement.setUrl(getCapabilityUri());
capabilityStatement.setVersion(version.getBuildVersion().orElse(UNKNOWN_VERSION));
capabilityStatement.setTitle("Pathling FHIR API");
capabilityStatement.setName("pathling-fhir-api");
capabilityStatement.setStatus(PublicationStatus.ACTIVE);
capabilityStatement.setExperimental(true);
capabilityStatement.setPublisher("Australian e-Health Research Centre, CSIRO");
capabilityStatement.setCopyright("Dedicated to the public domain via CC0: https://creativecommons.org/publicdomain/zero/1.0/");
capabilityStatement.setKind(CapabilityStatementKind.INSTANCE);
final CapabilityStatementSoftwareComponent software = new CapabilityStatementSoftwareComponent(new StringType("Pathling"));
software.setVersion(version.getDescriptiveVersion().orElse(UNKNOWN_VERSION));
capabilityStatement.setSoftware(software);
final CapabilityStatementImplementationComponent implementation = new CapabilityStatementImplementationComponent(new StringType(configuration.getImplementationDescription()));
final Optional<String> serverBase = getServerBase(Optional.ofNullable(httpServletRequest));
serverBase.ifPresent(implementation::setUrl);
capabilityStatement.setImplementation(implementation);
capabilityStatement.setFhirVersion(FHIRVersion._4_0_1);
capabilityStatement.setFormat(Arrays.asList(new CodeType("json"), new CodeType("xml")));
capabilityStatement.setRest(buildRestComponent());
return capabilityStatement;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class FhirServer method buildUpdateProviders.
@Nonnull
private List<IResourceProvider> buildUpdateProviders() {
final List<IResourceProvider> providers = new ArrayList<>();
for (final ResourceType resourceType : ResourceType.values()) {
final IResourceProvider updateProvider = resourceProviderFactory.createUpdateResourceProvider(resourceType);
providers.add(updateProvider);
}
return providers;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class FhirServer method resourceTypeFromClass.
/**
* @param resourceClass a class that extends {@link IBaseResource}
* @return a {@link Enumerations.ResourceType} enum
*/
@Nonnull
public static Enumerations.ResourceType resourceTypeFromClass(@Nonnull final Class<? extends IBaseResource> resourceClass) {
try {
final Constructor<? extends IBaseResource> constructor = resourceClass.getConstructor();
final IBaseResource instance = constructor.newInstance();
return Enumerations.ResourceType.fromCode(instance.fhirType());
} catch (final NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
throw new RuntimeException("Problem determining FHIR type from resource class", e);
}
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class OperationDefinitionProvider method getOperationDefinitionById.
/**
* Handles all read requests to the OperationDefinition resource.
*
* @param id the ID of the desired OperationDefinition
* @return an {@link OperationDefinition} resource
*/
@Read
@SuppressWarnings("unused")
public OperationDefinition getOperationDefinitionById(@Nullable @IdParam final IIdType id) {
checkUserInput(id != null, "Missing ID parameter");
final String idString = id.getValue();
final OperationDefinition resource = resources.get(idString);
if (resource == null) {
throw new ResourceNotFoundError("OperationDefinition not found: " + idString);
}
return resource;
}
Aggregations