ResourceConfig
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)