I give up can anyone get me started I got part way. I need a form that will pop up if a patient is on a certain med for example Orencia and has not had a TB in the last year and it needs to put the order in the orders module with a dx, but if the first 2 do not apply or the TB is less than 1 year it will not pop up or show up or what ever. It doesn't even at this point have to be a pop up (all though that is what he prefers) if anyone can get it to work in data fields this would be fine with me. Help my sanity or what is left anyway. PLEASE
For general setup, I would do something like -
{!if document.is_it_open == "" then
Check_Med_TB()
document.is_it_open = "Yes"
endif}
{fn Check_Med_TB(){
if match(MEDS_AFTER(),"certain med")>0 and durationdays(OBSNOW("TB Obsname"),str(document.clinicaldate))>365 then
if useryesno("Popup text here") == "Yes" then
if match(PROB_AFTER(),"diagnosis to add")<1 then MEL_ADD_PROBLEM(stuff) endif
MEL_ADD_ORDER(stuff)
ADD_FORM_COMP(stuff)
else return "" endif
else return "" endif}}
Needless to say I did no testing of this, but I think the setup should get you started. If you get stuck you can post your code or sections of it and we can try to help further.