Class AbstractCqlOperation

    • Field Detail

      • PARAM_IN_EXPRESSION

        public static final java.lang.String PARAM_IN_EXPRESSION
        See Also:
        Constant Field Values
      • PARAM_IN_PARAMETERS

        public static final java.lang.String PARAM_IN_PARAMETERS
        See Also:
        Constant Field Values
      • PARAM_IN_SUBJECT

        public static final java.lang.String PARAM_IN_SUBJECT
        See Also:
        Constant Field Values
      • PARAM_OUT_RETURN

        public static final java.lang.String PARAM_OUT_RETURN
        See Also:
        Constant Field Values
      • PARAM_OUT_DEBUG_RESULT

        public static final java.lang.String PARAM_OUT_DEBUG_RESULT
        See Also:
        Constant Field Values
      • PARAM_IN_USE_SERVER_DATA

        public static final java.lang.String PARAM_IN_USE_SERVER_DATA
        See Also:
        Constant Field Values
      • PARAM_IN_PREFETCH_DATA

        public static final java.lang.String PARAM_IN_PREFETCH_DATA
        See Also:
        Constant Field Values
      • PARAM_IN_DATA_ENDPOINT

        public static final java.lang.String PARAM_IN_DATA_ENDPOINT
        See Also:
        Constant Field Values
      • PARAM_IN_CONTENT_ENDPOINT

        public static final java.lang.String PARAM_IN_CONTENT_ENDPOINT
        See Also:
        Constant Field Values
      • PARAM_IN_TERMINOLOGY_ENDPOINT

        public static final java.lang.String PARAM_IN_TERMINOLOGY_ENDPOINT
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractCqlOperation

        public AbstractCqlOperation()
    • Method Detail

      • checkUnsupportedParameters

        protected void checkUnsupportedParameters​(ParameterMap paramMap)
                                           throws FHIROperationException
        Check if the user provided any currently unsupported operation parameters.
        Parameters:
        paramMap - Operation input parameters
        Throws:
        FHIROperationException - when one or more unsupported parameters are found
      • checkUnsupportedParameter

        protected OperationOutcome.Issue checkUnsupportedParameter​(ParameterMap paramMap,
                                                                   java.lang.String paramName)
        Check for a single unsupported parameter by name
        Parameters:
        paramMap - Operation input parameters
        paramName - Name of unsupported parameter
        Returns:
        FHIR Issue data describing the error or null if no such parameter is found.
      • doEvaluation

        protected Parameters doEvaluation​(FHIRResourceHelpers resourceHelper,
                                          ParameterMap paramMap,
                                          SearchHelper searchHelper,
                                          Library primaryLibrary)
        Evaluate the requested CQL from the provided Library resource.
        Parameters:
        resourceHelper - Resource operation provider for loading related Library resources
        paramMap - Parameters object that describes the operation to perform
        primaryLibrary - Library resource that is the entry point for the evaluation
        Returns:
        Parameters describing the evaluation result
      • doEvaluation

        protected Parameters doEvaluation​(FHIRResourceHelpers resourceHelper,
                                          ParameterMap paramMap,
                                          SearchHelper searchHelper,
                                          java.util.List<Library> libraries)
        Evaluate the requested CQL from the provided Library resource.
        Parameters:
        resourceHelper - Resource operation provider for loading related Library resources
        paramMap - Parameters object that describes the operation to perform
        primaryLibrary - Library resource that is the entry point for the evaluation
        searchHelper - A helper class for working with FHIR search parameters
        libraries - List of all necessary library resources. The first entry in the list is the primary library.
        Returns:
        Parameters describing the evaluation result
      • getCqlContext

        protected org.apache.commons.lang3.tuple.Pair<java.lang.String,​java.lang.Object> getCqlContext​(ParameterMap paramMap)
        Retrieve subject parameter from the operation input
        Parameters:
        paramMap - operation input
        Returns:
        Pair of context name and value
      • getCqlContext

        protected org.apache.commons.lang3.tuple.Pair<java.lang.String,​java.lang.Object> getCqlContext​(Parameters.Parameter subjectParam)
        Retrieve subject parameter from the operation input
        Parameters:
        paramMap - operation input
        Returns:
        Pair of context name and value
      • getCqlParameters

        protected java.util.Map<java.lang.String,​java.lang.Object> getCqlParameters​(ParameterConverter converter,
                                                                                          ParameterMap paramMap)
        Retrieve CQL parameters data from the operation input. FHIR data types are automatically converted to CQL System data types.
        Parameters:
        converter - Converter logic for transforming FHIR data types to CQL input parameters.
        paramMap - operation input
        Returns:
        Map of parameter name to parameter value where value objects are types in the CQL typesystem.
      • getCqlEngineParameters

        protected java.util.Map<java.lang.String,​java.lang.Object> getCqlEngineParameters​(ParameterConverter converter,
                                                                                                Parameters.Parameter parametersParam)
        Retrieve CQL parameters data from the operation input. FHIR data types are automatically converted to CQL System data types.
        Parameters:
        converter - Converter logic for transforming FHIR data types to CQL input parameters.
        parametersParam - operation input
        Returns:
        Map of parameter name to parameter value where value objects are types in the CQL typesystem.
      • getCqlExpressionsToEvaluate

        protected abstract java.util.Set<java.lang.String> getCqlExpressionsToEvaluate​(ParameterMap paramMap)
        Get the expression names to evaluate in the primary library
        Parameters:
        paramMap - operation input
        Returns:
        expression names to evaluate
      • createLibraryLoader

        protected org.opencds.cqf.cql.engine.execution.LibraryLoader createLibraryLoader​(java.util.List<Library> libraries)
        Create a CQL Library loader for the content of the provided FHIR Library resources
        Parameters:
        libraries - FHIR Library resources containing CQL and/or ELM content
        Returns:
        CQL Engine LibraryLoader
      • getDebugMap

        protected org.opencds.cqf.cql.engine.debug.DebugMap getDebugMap​(ParameterMap paramMap)
        Create a CQL DebugMap object based on the configuation in the operation input
        Parameters:
        paramMap - operation input
        Returns:
        DebugMap
      • throwOperationException

        protected void throwOperationException​(java.lang.Exception ex)
                                        throws FHIROperationException
        Construct a FHIROperationExcepiton from the provided exception. This allows commonality of error handling between related operations.
        Throws:
        FHIROperationException