I am collecting patient information, and based on a certain criteria (the logic of which I am collecting from the answers of the previous questions the user filled), I need to decide whether there is a need to refer the person to a doctor or not. If the logic is fulfilled, I want to lock the question that asks whether the referral should be done or not (probably by fixing the answer as YES and making READ-ONLY so that user cannot change the answer. If the logic is not met, the referral question remains open and user is free to choose from YES or NO.
How to make READ-ONLY programmable? One idea is to calculate a variable and switch it from NO to YES based on logic. Any other way?
First have the to-be read only state (false and true) as a calculate question, say named determined_referral. Under the calculation column of this question, use a conditional statement such as if(${S1_Q1}='1' and ${S1_Q2}='2',"True","False"). Now, the read_only column of the question asking whether the referral should be done or not will just have what the calculate question resolved.
Hi Saad,
You can try this: in the readonly column for the question you want to disable, input your condition in the format as below it should work.
if(${question1}='yes',"TRUE","FALSE"))
note: the true/false values must be in quotes.
all the best
Have you tried to do under calculate for the question, put this condition so that it preloads a YES, in addition to the condition I gave earlier, for the readonly question.
if(${question1}='yes',"Yes","No"))
Note: Ensure that the Values for Yes/No are the values in the choices sheet under name of the list group. Hope this works
Thanks,