schung said:
I am able to show and hide the V.R.
The program is not able to determine if the V.R. is hidden or not.
The code that I use is the following.
If DOCUMENT.PersistenAsthma <> "HIDE" then
//do stuffendif
Still a little unclear on what you are trying to do. What do you mean by "The program is not able to determine it"? The VR only works by evaluating what you have in the VR conditions - and you can only put in conditions that evaluate to TRUE or FALSE in a VR. Again, not sure what you mean by the system isn't able to tell - but shouldn't the system just be able to evaluate the same criteria you are putting in the VR?
Do you want to be able to display visibility regions based on the out come of some other set of more advanced code (seeing as VR conditions must equal true or false)? For this - you'd want to create a function in the VFE workspace and then call that function within your visibility region.
Like I have a form that checks to see if the patient has a handful of high priority diagnoses and then uses visibility regions to display buttons to launch forms accordingly to record info on those conditions.
In my workspace I have my function (way simplified here - you can do a ton with functions and just make them return a final value of True or False to control visibilites based on almost anything. The full function from below breaks up problem list into arrays and then problem into a sub array, checking for qualifiers, etc...):
{diabetestrue(ProbList){
local diagcheck=""
//*Always initialize variables back to blank or else when it re-runs based on an argument changing, the original variable value will still be stored there*//
if match(ProbList,"ICD-250")>0 then diagcheck="True"
else diagcheck="False" endif
return diagcheck}}
I then plug the function into the VFE using the patient's problem list as the ProbList variable - so if you wanted to display something based on if the patient had an ICD of 250, in the VFE definition you would put:
diabetestrue(PROB_AFTER)=="True"
Not sure if that's going to help at all or if you still needed assistance, but thought I'd give it a whack!
Ryan