Class FHIROperationUtil
- java.lang.Object
-
- com.ibm.fhir.server.spi.operation.FHIROperationUtil
-
public final class FHIROperationUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENV_DISABLED_OPERATIONS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FHIROperationException
buildExceptionWithIssue(String msg, IssueType issueType)
Helper method to generate a FHIROperationException with a fixed IssueTypestatic FHIROperationException
buildExceptionWithIssue(String msg, IssueType issueType, Throwable cause)
Helper method to generate a FHIROperationException with a fixed IssueTypestatic void
checkAndVerifyOperationAllowed(String operationName)
check and verify operation allowedstatic FHIROperationException
generateForbiddenOperationException(String operationName)
static Parameters
getInputParameters(OperationDefinition definition, Resource resource)
static Parameters
getInputParameters(OperationDefinition definition, Map<String,List<String>> queryParameters)
static Parameters
getOutputParameters(Resource resource)
Generates an output Parameter resourcestatic Parameters
getOutputParameters(String name, Resource resource)
generates an output parameter with a specific name.static Parameters
getOutputParameters(String name, Element element)
Generates an output parameters, with a parameter for a specified element.static Resource
getSingleResourceOutputParameter(Parameters parameters)
static boolean
hasSingleResourceOutputParameter(Parameters parameters)
static void
init()
Initializes the FHIR Operation Utility so disallowedOperations are loaded one time.
-
-
-
Field Detail
-
ENV_DISABLED_OPERATIONS
public static final String ENV_DISABLED_OPERATIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static void init()
Initializes the FHIR Operation Utility so disallowedOperations are loaded one time. First, the code checks the environment operations. Second, the code checks the configuration. This is initialized one time for the system.
-
getInputParameters
public static Parameters getInputParameters(OperationDefinition definition, Map<String,List<String>> queryParameters) throws FHIROperationException
- Throws:
FHIROperationException
-
getInputParameters
public static Parameters getInputParameters(OperationDefinition definition, Resource resource) throws Exception
- Throws:
Exception
-
getOutputParameters
public static Parameters getOutputParameters(Resource resource)
Generates an output Parameter resource- Parameters:
resource
-- Returns:
-
getOutputParameters
public static Parameters getOutputParameters(String name, Resource resource)
generates an output parameter with a specific name.- Parameters:
name
-resource
-- Returns:
-
getOutputParameters
public static Parameters getOutputParameters(String name, Element element)
Generates an output parameters, with a parameter for a specified element.- Parameters:
name
- the parameter nameelement
- the element, or null- Returns:
- output parameters
-
hasSingleResourceOutputParameter
public static boolean hasSingleResourceOutputParameter(Parameters parameters)
-
getSingleResourceOutputParameter
public static Resource getSingleResourceOutputParameter(Parameters parameters) throws Exception
- Throws:
Exception
-
checkAndVerifyOperationAllowed
public static void checkAndVerifyOperationAllowed(String operationName) throws FHIROperationException
check and verify operation allowed- Parameters:
operationName
-- Throws:
FHIROperationException
-
generateForbiddenOperationException
public static FHIROperationException generateForbiddenOperationException(String operationName)
-
buildExceptionWithIssue
public static FHIROperationException buildExceptionWithIssue(String msg, IssueType issueType)
Helper method to generate a FHIROperationException with a fixed IssueType- Parameters:
msg
- the message to be packed in the exceptionissueType
- the type of the issue- Returns:
-
buildExceptionWithIssue
public static FHIROperationException buildExceptionWithIssue(String msg, IssueType issueType, Throwable cause)
Helper method to generate a FHIROperationException with a fixed IssueType- Parameters:
msg
- the message to be packed in the exceptionissueType
- the type of the issuecause
- the throwable that causes this OperationOutcome/Exception- Returns:
-
-