I have a radio button linked to OBSNOW("SMOK STATUS") with choices:
current every day smoker
current some day smoker
former smoker
never smoker
current tobacco use status unknown
unknown if ever smoked.
These are currently on the Risk Factors-CCC form. I would like them to also be populated from the entries on the FH-SH-CCC form. I have had no luck.
I have tried obsany also and that did not work. I can not get the radio button to darken.
Here is a sample of the code I am trying using mel function:
{!IF obsany("SMOK STATUS") <> "" THEN
DOCUMENT.tobacco use == "current every day smoker"
ELSE
DOCUMENT.tobacco use == ""
ENDIF}
That cant be the actual document variable name, document variables cannot have spaces in them. If you get the right name for the variable something as simple as DOCUMENT.VARIABLE = OBSANY("SMOK STATUS") should work
You can find out the name of the variable by checking the "view contributors list" in a document where the option is checked on the CCC form, make sure the box that says "dont shows changes to document temporary symbols" is unchecked. If you dont see the temporary symbols you have to go to administration -> system -> auditing (clinical) and uncheck the last box that says do not record changes to document symbols (at least long enough to figure out the variable name) and then start a new document, check the variable and try again. Hopefully that makes sense
if both radio buttons are tied to the same obs term and the choices are exactly the same for both radio buttons, then setting one radio button in an update should automatically set the other in the same update.
Thank you both for your responses. I learned a lot! It works now.
== is for comparison
= is for assignment
== returns a Boolean value (ex: 1==2 would return false because 1 does not equal 2)
= does not return anything, but stores the value on the right into the address on the left
DOCUMENT.VARIABLE = "abc" will store the string "abc" into the document variable called VARIABLE