You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On calling the method 'getEncounter()' in a form_element rule, visit_schedule_rule, etc.
To Reproduce
Steps to reproduce the behavior:
I was trying to fetch a value from a general encounter and assign that value to a field in the registration.
Call this method and check for the logs in the client and on the web app.
You should see both of them return separate things.
Sample of code I was trying out
'use strict';
({params, imports}) => {
const individual = params.entity;
const moment = imports.moment;
const formElement = params.formElement;
const _ = imports.lodash;
let visibility = true;
let value = null;
let answersToSkip = [];
let validationErrors = [];
let valueOfConceptFromEncounter = individual.getEncounters(true).filter(enc => enc.encounterType.name = 'General encounter').map( val => val.getObservationValue('c02c9e4d-cb1b-4a92-a4a7-a53a1a5e044b'));
console.log('valueOfConceptFromEncounter--------->',valueOfConceptFromEncounter);
if (valueOfConceptFromEncounter) value = valueOfConceptFromEncounter[0];
return new imports.rulesConfig.FormElementStatus(formElement.uuid, visibility, value, answersToSkip, validationErrors);
};
Expected behavior
When calling this method, the rule should behave consistently on the client as well as on the web app.
The text was updated successfully, but these errors were encountered:
Describe the bug
On calling the method 'getEncounter()' in a form_element rule, visit_schedule_rule, etc.
To Reproduce
Steps to reproduce the behavior:
I was trying to fetch a value from a general encounter and assign that value to a field in the registration.
Sample of code I was trying out
Expected behavior
When calling this method, the rule should behave consistently on the client as well as on the web app.
The text was updated successfully, but these errors were encountered: