ResourceConfig

@Serializable
data class ResourceConfig(val id: String? = null, val resource: ResourceType, val filterId: String? = null, val searchParameter: String? = null, val isRevInclude: Boolean = true, val dataQueries: List<DataQuery>? = null, val relatedResources: List<ResourceConfig> = emptyList(), val sortConfigs: List<SortConfig> = emptyList(), val resultAsCount: Boolean = false, val countResultConfig: CountResultConfig? = CountResultConfig(), val nestedSearchResources: List<NestedSearchConfig>? = null, val configRules: List<RuleConfig>? = emptyList(), val planDefinitions: List<String>? = null, val attributesToUpdate: List<KeyValueConfig>? = emptyList(), val filterFhirPathExpressions: List<KeyValueConfig>? = emptyList()) : Parcelable, Serializable

This is the data class used to hold configurations for FHIR resources used in Profile and Registers. The property resource represents the ResourceType. id is a unique name used as key in the rules engine fact's map. resultAsCount property is used to indicate whether to perform count SQL query or not. Count queries return a count whereas search queries return the result of SQL SELECT statement.

Data filtering: dataQueries are used to apply conditions for filtering data in the WHERE clause of the SQL statement run against the SQLite database. The data queries follow the pattern provided by the Search DSL. NestedSearchConfig can be used to apply conditional filter against other resources. Example: Retrieve all Patients with Condition Diabetes; result will be a list of Patient (Condition resources will NOT be included in the returned results)

Sorting: Some resource properties support sorting. To configure how to sort the data SortConfig can be used.

isRevInclude property is a required configuration (default: true) needed to determine whether to use forward or reverse include operations of the Search DSL to include the configured resource in the final result of the query.

If isRevInclude is set to false, the configured resource will be retrieved via the referenced property on the parent resource, provided via searchParameter. Usage example: Retrieve all Group as well as the Patient resources referenced in the 'Group.member' property.

If isRevInclude is set to true, the database will query for any of the configured resources that include the parent resource in their references (the reverse of forward include). Usage example: Retrieve all Patients including their Immunizations, Observation etc in the result.

Both reverse and forward include require searchParameter which refers to the name of the property or search parameter used to reference other resources.

A ResourceConfig can have nested list of other ResourceConfig configured via relatedResources property.

CountResultConfig is used to configure how to compute the total counts returned. If CountResultConfig.sumCounts is set to true, all the related resources counts are computed once via one query. However there may be scenarios to return count for each related resource e.g. for every Patient in a Group, return their Tasks count.

filterId Refers to a unique ID used to identify the Resource in data filter screen (The data filter screen renders a questionnaire with the linkIds for the content to be filtered)

Constructors

Link copied to clipboard
constructor(id: String? = null, resource: ResourceType, filterId: String? = null, searchParameter: String? = null, isRevInclude: Boolean = true, dataQueries: List<DataQuery>? = null, relatedResources: List<ResourceConfig> = emptyList(), sortConfigs: List<SortConfig> = emptyList(), resultAsCount: Boolean = false, countResultConfig: CountResultConfig? = CountResultConfig(), nestedSearchResources: List<NestedSearchConfig>? = null, configRules: List<RuleConfig>? = emptyList(), planDefinitions: List<String>? = null, attributesToUpdate: List<KeyValueConfig>? = emptyList(), filterFhirPathExpressions: List<KeyValueConfig>? = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val dataQueries: List<DataQuery>? = null
Link copied to clipboard
val filterId: String? = null
Link copied to clipboard
val id: String? = null
Link copied to clipboard
val isRevInclude: Boolean = true
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resource: ResourceType
Link copied to clipboard
val resultAsCount: Boolean = false
Link copied to clipboard
val searchParameter: String? = null
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)