Class FHIROperationUtil


  • public final class FHIROperationUtil
    extends java.lang.Object
    • Field Detail

      • ENV_DISABLED_OPERATIONS

        public static final java.lang.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,
                                                    java.util.Map<java.lang.String,​java.util.List<java.lang.String>> queryParameters)
                                             throws FHIROperationException
        Construct a Parameters object from the input parameters passed via query parameters
        Parameters:
        definition - not null
        queryParameters - not null
        Returns:
        Throws:
        FHIROperationException
      • getInputParameters

        public static Parameters getInputParameters​(OperationDefinition definition,
                                                    Resource resource)
                                             throws java.lang.Exception
        Construct a Parameters object with a single parameter named resource
        Parameters:
        definition -
        resource -
        Returns:
        Throws:
        java.lang.Exception
      • getOutputParameters

        public static Parameters getOutputParameters​(Resource resource)
        Generates an output Parameter resource
        Parameters:
        resource -
        Returns:
      • getOutputParameters

        public static Parameters getOutputParameters​(java.lang.String name,
                                                     Resource resource)
        generates an output parameter with a specific name.
        Parameters:
        name -
        resource -
        Returns:
      • getOutputParameters

        public static Parameters getOutputParameters​(java.lang.String name,
                                                     Element element)
        Generates an output parameters, with a parameter for a specified element.
        Parameters:
        name - the parameter name
        element - the element, or null
        Returns:
        output parameters
      • hasSingleResourceOutputParameter

        public static boolean hasSingleResourceOutputParameter​(Parameters parameters)
      • getSingleResourceOutputParameter

        public static Resource getSingleResourceOutputParameter​(Parameters parameters)
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkAndVerifyOperationAllowed

        public static void checkAndVerifyOperationAllowed​(java.lang.String operationName)
                                                   throws FHIROperationException
        check and verify operation allowed
        Parameters:
        operationName -
        Throws:
        FHIROperationException
      • generateForbiddenOperationException

        public static FHIROperationException generateForbiddenOperationException​(java.lang.String operationName)
      • buildExceptionWithIssue

        public static FHIROperationException buildExceptionWithIssue​(java.lang.String msg,
                                                                     IssueType issueType)
        Helper method to generate a FHIROperationException with a fixed IssueType
        Parameters:
        msg - the message to be packed in the exception
        issueType - the type of the issue
        Returns:
      • buildExceptionWithIssue

        public static FHIROperationException buildExceptionWithIssue​(java.lang.String msg,
                                                                     IssueType issueType,
                                                                     java.lang.Throwable cause)
        Helper method to generate a FHIROperationException with a fixed IssueType
        Parameters:
        msg - the message to be packed in the exception
        issueType - the type of the issue
        cause - the throwable that causes this OperationOutcome/Exception
        Returns: