I have some injections built using the multifactorial form. Once those were built, I created quick texts which pull in the actual items from the mx form. Example
.h1r {ccc_Fx_extr("Hyalgan Right 1")}
When this QT is entered, it writes a small note, adds a diagnosis, adds an order, and associates the two together.
I would like to create an action button that performs this quick text for the provider but cannot seem to get it to work.
Any help would be greatly appreciated.
I've gotten this work for a different purpose, so it should be possible to do what you want. What have you tried? document.a="quicktext abbreviation here"? Just pushing the string abbreviation to a filed won't cause it to execute, so I used a fn to return the actual quicktext by abbreviation, then when the button is clicked it finds and pushes the actual text to whatever component on the form.
Here's an example - used on a test form that allow the user to select from a listbox of their own quicktexts, and choose the field into which they want to insert it. If you contact me at [email protected] I'll send you the form if it will help, or we can further discuss how to make it work for you.
Regards,
Paul
/*_TextMacroLookup is in mldefs6 EMR 9.2*/
{fn pa_get_qt(qt) {
local text = ""
if FIND("_TextMacroLookup","EXP","TRIGTEXT",qt) <> "" then
text = FIND("_TextMacroLookup","EXP","TRIGTEXT",qt)
else
text = ""
endif
text
}}
{fn show_qt_user(){
local i,a,trig, qt, result=""
i=getrowcount("_TextMacroLookup")
while i> 0 do
i=i-1
a= getrow("_TextMacroLookup", i, "TRIGTEXT","EXP")
trig=a[1]
qt=a[2]
result=result + hret + trig + ": " + qt
endwhile
return result}}
{!fn display_qt(){
local i,a,trig, qt, result=""
i=getrowcount("_TextMacroLookup")
while i> 0 do
a= getrow("_TextMacroLookup", i, "TRIGTEXT","EXP")
trig=a[1]
qt=a[2]
if trig <> "" and (qt <> "" and match(qt, "{")==0) then
if result <> "" then result=result + "," + trig + " (" + replacestr(qt, ",",";") + ")" else result = trig + " (" + replacestr(qt, ",",";") + ")"
endif
endif
i=i-1
endwhile
return result}}
{fn get_qt_abrev(item){
if item == "" then return "" else "" endif
local arrItem, n, result=""
arrItem=getfield(item, "(","")
result = sub(str(arrItem[1]),1, size(str(arrItem[1]))-1)
return result}}
{fn pa_push_qt_selected_item(){
if document.qt_list == "" or document.choose_field == "" then userok("Both the 'Select QuickText' and 'Choose field' items must be completed." + hret + hret + "Sorry, nothing recorded.") return ""
endif
local qt, f
qt=document.qt_list
f=document.choose_field
if f=="a"
then if document.a == "" then document.a = pa_get_qt(get_qt_abrev(qt), "") else document.a=document.a + hret + pa_get_qt(get_qt_abrev(qt), "")
endif
endif
if f=="b"
then if document.b == "" then document.b = pa_get_qt(get_qt_abrev(qt), "") else document.b=document.b + hret + pa_get_qt(get_qt_abrev(qt), "")
endif
endif
if f=="c"
then if document.c == "" then document.c = pa_get_qt(get_qt_abrev(qt), "") else document.c=document.c + hret + pa_get_qt(get_qt_abrev(qt), "")
endif
endif
document.qt_list=""
return ""
}}
I've tried adding it as a text component and I've tried just having the button type the .h1r but nothing is working exactly the way I want.
Basically, all I need is for the action button to execute a quick text I already have working if you type it out.
just have your action button set to SETVALUES and put {ccc_Fx_extr("Hyalgan Right 1")} next to the field where you want the results to populate.
or
set your action button to RUNPROCESS and put DOCUMENT.whatever = ccc_Fx_extr("Hyalgan Right 1") in the code area.
stop trying to execute a quick text, unless you're trying to execute one of many personal quick texts for a provider chosen from a list like Paul A appears to be doing.
That worked perfect. Thank you very much.
How can I get this runprocess to work
[1]["PTDIRGOALS",CVD Goals
1. Current BP is {LASTOBSVALUE("BP systolic")}/{LASTOBSVALUE("BP diastolic")}. Optimal BP </80
2. Current LDL is {LASTOBSVALUE("LDL")}. Optimal LDL </=
3. Current weight is {LASTOBSVALUE("WEIGHT")}. Expected weight loss lbs
4. Smoking cessation
5. Alcohol consumption
6. Nutrition counseling
]
When I import into EMR I get the following:
{
/*FUNCTION DEFINITIONS*/
/*Function for RUNPROCESS Button */
fn fn1891_515_1415309309(){
[ <-COMPILER ERROR NEARBY: Expect FUNCTION NAME. Instead had LEFT SQUARE BRACKET after LEFT CURLY BRACE
If I change it to
[1]["PTDIRGOALS",CVD Goals
1. Current BP is "BP systolic"/"BP diastolic". Optimal BP </80
2. Current LDL is "LDL". Optimal LDL </=
3. Current weight is "WEIGHT". Expected weight loss lbs
4. Smoking cessation
5. Alcohol consumption
6. Nutrition counseling
]
I get the same error.