RulesFactory

class RulesFactory @Inject constructor(val context: Context, val configurationRegistry: ConfigurationRegistry, val fhirPathDataExtractor: FhirPathDataExtractor, val dispatcherProvider: DispatcherProvider, val locationService: LocationService, val fhirContext: FhirContext, val defaultRepository: DefaultRepository) : RulesListener

Constructors

Link copied to clipboard
@Inject
constructor(context: Context, configurationRegistry: ConfigurationRegistry, fhirPathDataExtractor: FhirPathDataExtractor, dispatcherProvider: DispatcherProvider, locationService: LocationService, fhirContext: FhirContext, defaultRepository: DefaultRepository)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class RulesEngineService

Provide access to utility functions accessible to the users defining rules in JSON format.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val fhirContext: FhirContext
Link copied to clipboard

Functions

Link copied to clipboard
fun Map<String, List<*>>.addToFacts(facts: Facts)
Link copied to clipboard
open override fun afterEvaluate(rule: Rule, facts: Facts, evaluationResult: Boolean)
Link copied to clipboard
open override fun beforeEvaluate(rule: Rule, facts: Facts): Boolean
Link copied to clipboard
open fun beforeExecute(p0: Rule, p1: Facts)
Link copied to clipboard
fun fireRules(rules: Rules, repositoryResourceData: RepositoryResourceData?, params: Map<String, String>): Map<String, Any>

This function executes the actions defined in the Rule s generated from the provided list of RuleConfig against the Facts populated by the provided FHIR Resource s available in the RepositoryResourceData.resource, RepositoryResourceData.relatedResourcesMap and RepositoryResourceData.relatedResourcesCountMap. All related resources of same type are flattened in a map for ease of usage in the rule engine.

Link copied to clipboard
fun generateRules(ruleConfigs: List<RuleConfig>): Rules
Link copied to clipboard
fun log(exception: Exception, message: String? = null)
Link copied to clipboard
open override fun onEvaluationError(rule: Rule, facts: Facts, exception: Exception)
Link copied to clipboard
open override fun onFailure(rule: Rule, facts: Facts, exception: Exception)
Link copied to clipboard
open override fun onSuccess(rule: Rule, facts: Facts)