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
I have a function print_smoke_sentences() being called in the translation area of this radio button.
{
if(OBSNOW("SMOK STATUS")<>"")then
print_smoke_sentences()
else ""
endif
}
In print_smoke_sentences(), I have
if(OBSNOW("SMOK STATUS")=="current every day smoker" or OBSNOW("SMOK STATUS")=="current some day smoker")then
if(OBSNOW("CIGARET SMKG")<>"" and OBSNOW("CIGARETTE/D")<>"")then
return_string = "Patient currently smokes " + OBSNOW("CIGARETTE/D")
+ " packs of cigarettes per day."
endif
endif
.
.
.
return return_string
For some reason, nothing prints in my chart note until I select the radio button for the second time. For example, I click "current every day smoker", click the cigarettes checkbox, and type in '2' for 'packs per day' and nothing prints. But, if I deselect the radio button and select it again, it prints perfectly.
I've used this approach in my Pediatrics, Adult, and Neuro-Opthamology forms and it worked fine, without having to 'trick' the radio button. When I tried it in my Child Development form, I ran into this issue.
Seemingly, there is no difference between the smoking sections on the forms that do work and the one that is having this issue, except that the smoking section is only visible in Pediatrics and Child Development if the child is >=10 years old. Pediatrics still works fine though.
I've tried changing obs terms, and the same thing happens.
I've removed all suppression and visibility, just in case, and it still happens.
I've tried calling my print function in another area of the form, and it still happens.
I can't find any code anywhere that uses OBSNOW("SMOK STATUS") except this print function.
Once I perform the radio button trickery and the note prints correctly, I try to change from "1" pack per day to "2" packs per day. The note does not update automatically, and I must deselect/reselect the radio button again in order for the note to update.
Has anyone had any experience with stubborn radio buttons and translation, and if so, how did you manage to solve your issues?
Posted : July 23, 2012 6:12 am