Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method isClientRegistryEventsEnabled() correctly checks if events are enabled, but should we also consider fetching this value from a global property instead of just relying on environment variables?"
🔹 "Instead of using Boolean.TRUE.equals(eventsEnabled), you could simply use Boolean.TRUE.equals(eventsEnabled) && StringUtils.isNotBlank(getClientRegistryServerUrl()) inline to improve readability."

Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,23 @@ public class ClientRegistryConfig {

@Value("${CLIENTREGISTRY_IDENTIFIERROOT:}")
private String identifierRoot;

@Value("${CLIENTREGISTRY_EVENTSENABLED:}")
private Boolean eventsEnabled;

public boolean clientRegistryConnectionEnabled() {
return StringUtils.isNotBlank(getClientRegistryServerUrl());
}

public Boolean isClientRegistryEventsEnabled() {
return Boolean.TRUE.equals(eventsEnabled) && clientRegistryConnectionEnabled();
}

public String getClientRegistryServerUrl() {
return serverUrl;
}


public String getClientRegistryGetPatientEndpoint() {
String globalPropPatientEndpoint = administrationService
.getGlobalProperty(ClientRegistryConstants.GP_FHIR_CLIENT_REGISTRY_GET_PATIENT_ENDPOINT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class ClientRegistryConstants {
public static final String GP_CLIENT_REGISTRY_PASSWORD = "CLIENTREGISTRY_PASSWORD";

public static final String GP_CLIENT_REGISTRY_IDENTIFIER_ROOT = "CLIENTREGISTRY_IDENTIFIERROOT";

public static final String GP_CLIENT_REGISTRY_EVENTS_ENABLE = "CLIENTREGISTRY_EVENTSENABLE";

public static final String GP_CLIENT_REGISTRY_TRANSACTION_METHOD = "clientregistry.transactionMethod";

Expand Down
Loading