Search in sources :

Example 1 with ServerCapabilityStatementProvider

use of org.hl7.fhir.r4.hapi.rest.server.ServerCapabilityStatementProvider in project beneficiary-fhir-data by CMSgov.

the class V2Server method configureServerInfoMetadata.

/**
 * Configures various metadata fields that will be included in this server's {@link
 * CapabilityStatement}.
 */
private void configureServerInfoMetadata() {
    setServerName(CAPABILITIES_SERVER_NAME);
    /*
     * Read in some of the project metadata from a Maven-filtered properties
     * file, which ensures that it's always up to date.
     */
    Properties projectProps = new Properties();
    try (InputStream projectPropsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("project.properties")) {
        projectProps.load(projectPropsStream);
        setImplementationDescription(projectProps.getProperty("project.id"));
        setServerVersion(projectProps.getProperty("project.version"));
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    // Lightly customize the capability provider to set publisher name.
    ServerCapabilityStatementProvider capabilityStatementProvider = new ServerCapabilityStatementProvider();
    capabilityStatementProvider.setPublisher(CAPABILITIES_PUBLISHER);
    setServerConformanceProvider(capabilityStatementProvider);
}
Also used : InputStream(java.io.InputStream) ServerCapabilityStatementProvider(org.hl7.fhir.r4.hapi.rest.server.ServerCapabilityStatementProvider) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) Properties(java.util.Properties)

Example 2 with ServerCapabilityStatementProvider

use of org.hl7.fhir.r4.hapi.rest.server.ServerCapabilityStatementProvider in project beneficiary-fhir-data by CMSgov.

the class V1Server method configureServerInfoMetadata.

/**
 * Configures various metadata fields that will be included in this server's {@link
 * CapabilityStatement}.
 */
private void configureServerInfoMetadata() {
    setServerName(CAPABILITIES_SERVER_NAME);
    /*
     * Read in some of the project metadata from a Maven-filtered properties
     * file, which ensures that it's always up to date.
     */
    Properties projectProps = new Properties();
    try (InputStream projectPropsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("project.properties")) {
        projectProps.load(projectPropsStream);
        setImplementationDescription(projectProps.getProperty("project.id"));
        setServerVersion(projectProps.getProperty("project.version"));
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    // Lightly customize the capability provider to set publisher name.
    ServerCapabilityStatementProvider capabilityStatementProvider = new ServerCapabilityStatementProvider();
    capabilityStatementProvider.setPublisher(CAPABILITIES_PUBLISHER);
    setServerConformanceProvider(capabilityStatementProvider);
}
Also used : InputStream(java.io.InputStream) ServerCapabilityStatementProvider(org.hl7.fhir.dstu3.hapi.rest.server.ServerCapabilityStatementProvider) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) Properties(java.util.Properties)

Aggregations

IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 UncheckedIOException (java.io.UncheckedIOException)2 Properties (java.util.Properties)2 ServerCapabilityStatementProvider (org.hl7.fhir.dstu3.hapi.rest.server.ServerCapabilityStatementProvider)1 ServerCapabilityStatementProvider (org.hl7.fhir.r4.hapi.rest.server.ServerCapabilityStatementProvider)1