Closed allan-on closed 3 months ago
a. Query for unique ID Group resource b. Retrieve unique ID for pre-population into a Questionnaire
"rules": [...
{
"condition": "true",
"actions": [
"data.put('uniqueIdGroup', service.filterResources(uniqueIds, \"Group.active = true and Group.type = 'device' and Group.name = 'Unique IDs'\"))"
]
},
{
"name": "uniqueIdGroupId",
"condition": "true",
"priority": 2,
"actions": [
"data.put('uniqueIdGroupId', fhirPath.extractValue(data.get('uniqueIdGroup').get(0), 'Group.id'))"
]
},
{
"name": "uniqueId",
"condition": "true",
"priority": 2,
"actions": [
"data.put('uniqueId', fhirPath.extractValue(data.get('uniqueIdGroup').get(0), \"Group.characteristic.where(exclude=false and code.text='phn').first().value.text\"))"
]
}, ...
These can be tested from the diabetes-compass
branch in fhircore
cc @ellykits
This is no longer required because the configs were refactored here https://github.com/opensrp/fhircore/pull/3075 The configs introduced in that PR allow the use of the unique ID configs from register configs
Describe the feature request. Implement support for the use of rules and computed values in Register configs and FAB actions.
Additional context There's no support for rules in the register config (Other than
configRules
) outside ofregisterCard
configs. Rules with access to the resource data can only be defined within theregisterCard
.Acceptance criteria Rules based on the resource data can be defined outside the
registerCard
. Rules and the computed values should be accessible within the FAB actions.Implementation plan (For Engineers) The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed. i.e. Describe how you intend to solve the problem