I have a couple of check boxes on a custom form that I would like to work together but am having some trouble with the programming in VFE. Basically I have 2 checkboxes for Meds Reviewed located on two separate pages in the form. If one box is checked I would like the other box on a separate page to be checked as well. I also need both of these boxes to push to the same OBS term (that part I think I can figure out). Right now I currently have each check box set up to individual variable names to push the OBS term.
HI Jessica - I am not sure if this will work as I have not tried in awhile. What if you were to write both checkboxes directly to that same obs term. I think that may allow them to each be checked when one is checked.
I hope this helps, I think I remember accidentally doing this once and I linked two boxes together.
Why do the two checkboxes point to different local variables? And why not simply have them both point to the same OBS code (Meds Review)?
I tried attaching them to the same OBS term and it did not work. Checking one box did not check the other. And if I went to the other page to check the box that was not checked it then unchecked the original box I had checked.....
I did run a test on two checkboxes attached to the same OBS term on the same page of a form and that does work as expected. When one box is checked the other is checked as well.
Must not be working that way on my form because my checkboxes are located on different pages of the form......??
I tried that and it did not work. Must be because my check boxes are on separate pages??
You can try to use "obsnow" for the 2nd box. Thus, when you check the first one..... it should check the 2nd one if you use obsnow..... Try that!
Use the same connection to the obsterm as OBSNOW for both check boxes.
As a check box, the value MUST be identical (case/spelling/spacing/etc), otherwise it will not be visible in the other check box (it cannot show what it cannot display).
I suspect that may have been the issue you were experiencing all along.
One other condition that will prevent an obsterm from populating on a different tab or form is the presence of a MEL error. MEL errors 'reset' the code stack and often bypass code in the process. Always review a MEL Trace to ensure no errors exist for this reason.
are they in the same form, just on separate pages or on separate forms in the same document?
I think you have to do more than just attach them both to the same OBS term. Have you tried any conditional statements?
First, tie both checkboxes to whatever OBS term you want them to track. It sounds like it's just a "Yes/No", right? Either the meds have been reviewed or they haven't. That makes it easier.
{
if OBSNOW("MED_REVIEW") == "YES" THEN
DOCUMENT.YOUR_CHECK_BOX == "TRUE"
else
DOCUMENT.YOUR_CHECK_BOX == "FALSE"
endif
}
Checkboxes work on true/false values. "True" should equal "checked", "false" should equal "unchecked". If you put the above code (or a variation of it) into the code box of each form, they should behave the same, because it'll be based on the value of the OBS term.
Does that help/work?
Thank you!!! I went in to double check the values and found that I had a space in front of the value on one of the boxes!
Works great now!!
There are a few issues at play here:
1) Two DOCUMENT. variables being used. Unless 'make available to other forms' is selected on the item properties page, the variables might not share the same name in the created clinical kit. This check box converts the local document. variable to a global variable and preserves the name as is - use with caution and highly unique names to prevent collisions with other variables.
2) Unless the 'other' tab is displayed, a 'local' document variable may not be initialized. For this issue, one would need to create code to 'flash' the tabs on open. Fortunately, for this instance, it is not required.
3) Assuming that the OBSTERM being populated is one that is shared with the EMR's Medication Module, the ONLY accepted value is 'Done'. Any other value will not trigger the Module's control over the obsterm and potentially cause issues with MU reporting. Care should be taken.
4) The most simplistic approach is to connect BOTH of the check boxes to the obsterm "MEDS REVIEW" with a value of "Done". This will allow both check boxes on the form to share the connection AND the medication Module to function alongside of it. Again, this is assuming that the intent is to satisfy the common workflow via form in lieu of going to the medication module itself.
My recommendation is to dump the document variable approach to this workflow and go with a direct obsterm connection.