I've created several forms using the MEL_ADD_ORDER functions and they work great. But we're looking at creating many specialty specific forms this year and I would like to avoid reacreating/coping the same functions over and over so I'm trying to create them in a functions library, but its not working for me. Below is the function in the library, if this function is in the form, it works fine, but not pulling from the library. Any suggestions?? I saw a note about avoiding the use of Document.Variables in the functions library, but I'm not sure how else to write this function to be based on Document.Variables. Thank you for any help!!
{if match(ORDERS_NEW("list","T"),"CBC w/ Platelets + Diff")>0 then "" else if DOCUMENT.CBC<>"" and DOCUMENT.LAB_FACILITY<>"" then MEL_ADD_ORDER("T", DOCUMENT.LAB_FACILITY, "CBC w/ Platelets + Diff", "", fnGetProblemCodes(), fnGetProblemDescriptions(), DOCUMENT.LAB_EDIT + "", "", "", "", "") else if DOCUMENT.CBC<>"" then MEL_ADD_ORDER("T", "Providence Lab", "CBC w/ Platelets + Diff", "", fnGetProblemCodes(), fnGetProblemDescriptions(), DOCUMENT.LAB_EDIT + "", "", "", "", "") else "" endif endif endif}