I was wondering if anyone has the language to have a radio button change color once it has been clicked? For example, when committing an immunization, the "click to commit" button is yellow until it is clicked then turns grey. This helps the user know that they did commit the vaccine if the button is no longer yellow.
Thank you,
Katy
If using VFE, you can use Enable/Disable expression from the Advanced tab of the item setup. If you're 'commiting' the immunization to an OBS term just set an expression to disable the radio button. This will gray out the button.
Ex:
{OBSNOW("YOUR IMMUNIZATION")==""}
When the expression is TRUE the button remains available, once it evaluates to FALSE, then the button will be disabled.
You could also us overlapping visibility regions but its a bit more work.
Hope this helps.
~Scott
I checked off the Enable/Disable expression item on the Advanced tab for this radio button. I then entered the expression:
{OBSNOW("HEPBVAX#1")==""}
But, now when I open the form, this button is already greyed out for a patient that does not already have a value for this obs term. What am I doing wrong?
the way i have my button set up is as a RUNPROCESS button that triggers the update to the OBS term and then the Enable/Disable expression looks at the same obsterm to disable the button once the obs is updated.
under the RUNPROCESS expression box
OBSNOW("HEPBVAX#1","Given")
and under the enable/disable expression box
OBSNOW("HEPBVAX#1")==""
Hope this helps. I don't actually use it for HEPBVAX but i use it for other OBS terms and it works great.
I also have this set up as a RUNPROCESS
{rec_hb1()}
which has this:
{fn rec_hb1(){IF DOCUMENT.DATE3 <> "" THEN OBSNOW("HEPBVAX#1", DOCUMENT.HEP_B__1, DOCUMENT.DATE3)ENDIF}}
Can I add your language to this somehow, or do I need to use visibility?
(Sorry, as you can see I am no forms expert, and I did not create this form, someone else did, I am just trying to make it a little more user friendly).
Thanks!
We have it this way so if the date is in the past, it pushes the obs term to the flowsheet with that date, not today's date. Most of the newborns had the vaccine in the hospital, so we want it pushed to that day.
strange, that should work. I just inserted your function into my form and placed the function call rec_hb1() in the RUNPROCESS field and it worked.
Do you have all of your code under the button or do you have the function code in the function window and only the function call rec_hb1() in the runprocess field?
Exactly. I have just the rec_hb1() in the runprocess field. Over to the right in that open space is where I have the {fn rec_hb1(){IF DOCUMENT.DATE3 <> "" THEN OBSNOW("HEPBVAX#1", DOCUMENT.HEP_B__1, DOCUMENT.DATE3)ENDIF}}
Can I put it all under the button and add your language?
hmmm? your code is correct, it should work exactly as you have it.
Is it possible another function is populating that OBS term so the button is being disabled right away?
If you really want to change the color of the buttons instead of greying out a single button, you could do this:
1) Add a visibility field at the very bottom of your form whose visibility condition is simply FALSE. Inside this visibility field, add an edit field linked to a document variable called WAS_CLICKED. Clear the translation area for this edit field.
2) In the code palate on the right, put {!DOCUMENT.WAS_CLICKED = "FALSE"}. This will make your new edit field have a value of "FALSE" when the form opens.
3) Layer another button with the different color underneath your original button. Both buttons will be inside a separate visibility field. The condition for your original button's visibility will be DOCUMENT.WAS_CLICKED == "FALSE", while your new button's condition will be DOCUMENT.WAS_CLICKED == "TRUE". In the RUNPROCESS code for the original button, put :
{
your_function()
DOCUMENT.WAS_CLICKED = "TRUE"
}
This will make the original button seem to change colors when you click it, although it is really disappearing. I don't know what you want the new button to do, but you could just make it do nothing.