in my case it is particularly problematic because I build the form from a drawio file that is also use to create form in CHT and ODK, therefore I would like to keep the skip logic clean and not use concept when the data is from the form and bool if from history
Please advise
note: the answers list seem not mandatory for toggle
So far the only approach that I can find is to extend the helper with isTrue and isFalse along with select using the CIEL UUID for yes/no 1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
// LMM generated
// Import the Form Engine’s expression helper registration function
import { registerExpressionHelper } from '@openmrs/esm-form-engine-lib';
// Constants for CIEL Yes/No UUIDs
const CIEL_YES_UUID = '1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; //'3cd6f600-26fe-102b-80cb-0017a47871b2'; CIEL:1065 (Yes)
const CIEL_NO_UUID = '1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; //'3cd6f86c-26fe-102b-80cb-0017a47871b2'; CIEL:1066 (No)
// Custom function: isTrue
// Returns true if value is not undefined, not null, and either true (boolean) or CIEL Yes UUID
registerExpressionHelper('isTrue', (value) => {
if (value === undefined || value === null) {
return false;
}
return value === true || value === CIEL_YES_UUID;
});
// Custom function: isFalse
// Returns true if value is not undefined, not null, and either false (boolean) or CIEL No UUID
registerExpressionHelper('isFalse', (value) => {
if (value === undefined || value === null) {
return false;
}
return value === false || value === CIEL_NO_UUID;
});
thank you but I know that I can do that but it is still problematic because I also want to be able to have a streamlined approach when I test data entry and calculate output (the later does not work either ).
my current workarround is the generate more complex checks but it will harm performance, here a simple example (all operation are generated from either a decision tree or CQL like code):