Skip to content

Commit 8beaa73

Browse files
committed
issue #4061 - "IBM" to "LinuxForHealth" in the CapabilityStatement
Also removed the "publisher" field which is optional. Also updated copyright from IBM to "Merative and others". Also fixed a minor compiler warning. Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
1 parent a3e45fc commit 8beaa73

1 file changed

Lines changed: 22 additions & 24 deletions

File tree

fhir-server/src/main/java/org/linuxforhealth/fhir/server/resources/Capabilities.java

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ public class Capabilities extends FHIRResource {
113113
private static final Logger log = java.util.logging.Logger.getLogger(Capabilities.class.getName());
114114

115115
// Constants
116-
private static final String FHIR_SERVER_NAME = "IBM FHIR Server";
117-
private static final String FHIR_COPYRIGHT = "(C) Copyright IBM Corporation 2016, 2022";
118-
private static final String FHIR_PUBLISHER = "IBM Corporation";
116+
private static final String FHIR_SERVER_NAME = "LinuxForHealth FHIR Server";
117+
private static final String FHIR_COPYRIGHT = "© Merative US L.P. and others 2016, 2022";
119118
private static final String BASE_CAPABILITY_URL = "http://hl7.org/fhir/CapabilityStatement/base";
120119
private static final String BASE_2_CAPABILITY_URL = "http://hl7.org/fhir/CapabilityStatement/base2";
121120
private static final List<String> ALL_INTERACTIONS = Arrays.asList("create", "read", "vread", "update", "patch", "delete", "history", "search");
@@ -249,7 +248,6 @@ private TerminologyCapabilities buildTerminologyCapabilities() {
249248
.name(string(FHIR_SERVER_NAME))
250249
.description(Markdown.of(buildDescription))
251250
.copyright(Markdown.of(FHIR_COPYRIGHT))
252-
.publisher(string(FHIR_PUBLISHER))
253251
.software(TerminologyCapabilities.Software.builder()
254252
.name(string(FHIR_SERVER_NAME))
255253
.version(string(buildInfo.getBuildVersion()))
@@ -487,29 +485,30 @@ private CapabilityStatement buildCapabilityStatement(FHIRVersionParam fhirVersio
487485
if (FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_SECURITY_OAUTH_ENABLED, false)) {
488486
String actualHost = new URI(getRequestUri()).getHost();
489487

490-
String authURLTemplate = null;
491-
String tokenURLTemplate = null;
492-
String regURLTemplate = null;
493-
String manageURLTemplate = null;
494-
String introspectURLTemplate = null;
495-
String revokeURLTemplate = null;
488+
String authURL = null;
489+
String tokenURL = null;
490+
String regURL = null;
491+
String manageURL = null;
492+
String introspectURL = null;
493+
String revokeURL = null;
496494

497495
try {
498-
authURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_AUTH_URL, "");
499-
tokenURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_TOKEN_URL, "");
500-
regURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_REG_URL, "");
501-
manageURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_MANAGE_URL, "");
502-
introspectURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_INTROSPECT_URL, "");
503-
revokeURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_REVOKE_URL, "");
496+
String authURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_AUTH_URL, "");
497+
String tokenURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_TOKEN_URL, "");
498+
String regURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_REG_URL, "");
499+
String manageURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_MANAGE_URL, "");
500+
String introspectURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_INTROSPECT_URL, "");
501+
String revokeURLTemplate = FHIRConfigHelper.getStringProperty(PROPERTY_SECURITY_OAUTH_REVOKE_URL, "");
502+
503+
tokenURL = tokenURLTemplate.replaceAll("<host>", actualHost);
504+
authURL = authURLTemplate.replaceAll("<host>", actualHost);
505+
regURL = regURLTemplate.replaceAll("<host>", actualHost);
506+
manageURL = manageURLTemplate.replaceAll("<host>", actualHost);
507+
introspectURL = introspectURLTemplate.replaceAll("<host>", actualHost);
508+
revokeURL = revokeURLTemplate.replaceAll("<host>", actualHost);
504509
} catch (Exception e) {
505510
log.log(Level.SEVERE, "An error occurred while adding OAuth URLs to the conformance statement", e);
506511
}
507-
String tokenURL = tokenURLTemplate.replaceAll("<host>", actualHost);
508-
String authURL = authURLTemplate.replaceAll("<host>", actualHost);
509-
String regURL = regURLTemplate.replaceAll("<host>", actualHost);
510-
String manageURL = manageURLTemplate.replaceAll("<host>", actualHost);
511-
String introspectURL = introspectURLTemplate.replaceAll("<host>", actualHost);
512-
String revokeURL = revokeURLTemplate.replaceAll("<host>", actualHost);
513512

514513
Boolean smartEnabled = FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_SECURITY_OAUTH_ENABLED, false);
515514
securityBuilder.service(CodeableConcept.builder()
@@ -543,7 +542,7 @@ private CapabilityStatement buildCapabilityStatement(FHIRVersionParam fhirVersio
543542
format.add(Code.of(FHIRMediaType.APPLICATION_FHIR_XML));
544543

545544
/*
546-
* The following checks to see if there is a IBM FHIR Server Service URL that we want to inline into the Capabilities Statement
545+
* The following checks to see if there is a Service URL that we want to inline into the Capabilities Statement
547546
* else the minimal implementation.description.
548547
*/
549548
String customImpl = FHIRConfigHelper.getStringProperty(FHIRConfiguration.PROPERTY_CAPABILITIES_URL, null);
@@ -573,7 +572,6 @@ private CapabilityStatement buildCapabilityStatement(FHIRVersionParam fhirVersio
573572
.name(string(FHIR_SERVER_NAME))
574573
.description(Markdown.of(buildDescription))
575574
.copyright(Markdown.of(FHIR_COPYRIGHT))
576-
.publisher(string(FHIR_PUBLISHER))
577575
.software(CapabilityStatement.Software.builder()
578576
.name(string(FHIR_SERVER_NAME))
579577
.version(string(buildInfo.getBuildVersion()))

0 commit comments

Comments
 (0)