Package org.linuxforhealth.fhir.config
Class FHIRConfigHelper
- java.lang.Object
-
- org.linuxforhealth.fhir.config.FHIRConfigHelper
-
public class FHIRConfigHelper extends java.lang.Object
This class contains a set of static helper methods related to configuration parameters. The functions in this class will try to first retrieve a config property from the current tenant's configuration, then (if not found) look in the "default" configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RESOURCE_RESOURCE
static java.lang.String
SEARCH_PROPERTY_TYPE_INCLUDE
static java.lang.String
SEARCH_PROPERTY_TYPE_REVINCLUDE
-
Constructor Summary
Constructors Constructor Description FHIRConfigHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Boolean
getBooleanProperty(java.lang.String propertyName, java.lang.Boolean defaultValue)
static java.lang.Double
getDoubleProperty(java.lang.String propertyName, java.lang.Double defaultValue)
static java.lang.Integer
getIntProperty(java.lang.String propertyName, java.lang.Integer defaultValue)
static PropertyGroup
getPropertyGroup(java.lang.String propertyName)
static java.util.List<java.lang.String>
getSearchPropertyRestrictions(java.lang.String resourceType, java.lang.String propertyType)
Retrieves the search property restrictions.static java.util.List<java.lang.String>
getStringListProperty(java.lang.String propertyName)
static java.lang.String
getStringProperty(java.lang.String propertyName, java.lang.String defaultValue)
static java.util.Set<java.lang.String>
getSupportedResourceTypes()
Get the set of supported resource types for the latest supported FHIRVersion and the tenantId in the FHIRRequestContextstatic java.util.Set<java.lang.String>
getSupportedResourceTypes(FHIRVersionParam fhirVersion)
Get the set of supported resource types for the passed fhirVersion and the tenantId in the FHIRRequestContext
-
-
-
Field Detail
-
SEARCH_PROPERTY_TYPE_INCLUDE
public static final java.lang.String SEARCH_PROPERTY_TYPE_INCLUDE
- See Also:
- Constant Field Values
-
SEARCH_PROPERTY_TYPE_REVINCLUDE
public static final java.lang.String SEARCH_PROPERTY_TYPE_REVINCLUDE
- See Also:
- Constant Field Values
-
RESOURCE_RESOURCE
public static final java.lang.String RESOURCE_RESOURCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStringProperty
public static java.lang.String getStringProperty(java.lang.String propertyName, java.lang.String defaultValue)
-
getBooleanProperty
public static java.lang.Boolean getBooleanProperty(java.lang.String propertyName, java.lang.Boolean defaultValue)
-
getIntProperty
public static java.lang.Integer getIntProperty(java.lang.String propertyName, java.lang.Integer defaultValue)
-
getDoubleProperty
public static java.lang.Double getDoubleProperty(java.lang.String propertyName, java.lang.Double defaultValue)
-
getStringListProperty
public static java.util.List<java.lang.String> getStringListProperty(java.lang.String propertyName)
-
getPropertyGroup
public static PropertyGroup getPropertyGroup(java.lang.String propertyName)
-
getSupportedResourceTypes
public static java.util.Set<java.lang.String> getSupportedResourceTypes()
Get the set of supported resource types for the latest supported FHIRVersion and the tenantId in the FHIRRequestContext- Returns:
- an immutable non-null set of resource type names that isn't null
- Throws:
java.lang.IllegalStateException
- if there is an unexpected issue while processing the config
-
getSupportedResourceTypes
public static java.util.Set<java.lang.String> getSupportedResourceTypes(FHIRVersionParam fhirVersion)
Get the set of supported resource types for the passed fhirVersion and the tenantId in the FHIRRequestContext- Parameters:
fhirVersion
-- Returns:
- an immutable non-null set of resource type names for the passed fhirVersion
- Throws:
java.lang.IllegalStateException
- if there is an unexpected issue while processing the config
-
getSearchPropertyRestrictions
public static java.util.List<java.lang.String> getSearchPropertyRestrictions(java.lang.String resourceType, java.lang.String propertyType) throws java.lang.Exception
Retrieves the search property restrictions.- Parameters:
resourceType
- the resource typepropertyType
- the property type, either _include or _revinclude- Returns:
- list of allowed values for the search property, or null if no restrictions
- Throws:
java.lang.Exception
- an exception
-
-