Does anyone know if it's possible to include input fields or action buttons on a userok or other popup?
I'd like to include a "Feedback" button on my custom forms that will allow the users to send questions/revision requests directly from the form. For this, I'll need to code one or more input fields and a "Submit" button with a MEL_SEND_FLAG command.
Does anyone have anything similar already coded or know if this is possible?
Thanks!
Jennifer,
Controls cannot be placed directly on the userok or useryesno popups, but the response to the popup can do almost anything you want. A "Yes" response to a useryesno could redirect the user to a certain form, send a flag, complete a field with a particular response, add a form or text component to the update, add a med, allergy, problem, various combinations of things, etc. So, while it may not be exactly what you want, you may be able to achieve the same or similar results by having the response to the popup do some of the work.
Here's an example for a useryesno that does a number of things based on the response:
{if obsprev(
"MHTRTDISCRT") == "" then
if useryesno(
"Please review the problems and diagnoses below:" + hret + hret + " Click 'Yes' to indicate that you have reviewed and accepted these problems." + hret + hret + " Click 'No' to just continue with the treatment plan without reviewing the problems." + hret + hret + "(N.B.: Use the 'Diagnosis Management' Encouter Type to update diagnosis as needed." + hret + "If problems or diagnoses have changed, it is best to update the problem list BEFORE" + hret + "starting the treatment plan to insure that the current problems are listed.)" + hret + hret + "Primary diagnosis: " + obsprev("mhprimdx") + hret + hret + "Problems and Diagnoses on Axes I - III:" + hret + prob_prior("list") + hret + hret + "Axis IV:" + hret + obsprev("mhdxaxisiv") + hret + hret + "Axis V: " + obsprev("gaf scale") )=="Yes"
then OBSNOW(
"TXP_TYPE", "Review") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan DC Plan", "10","") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan Patient Sig Line", "11") + OBSNOW("PROBS REVWD", "Problems and diagnoses were reviewed during this Treatment Plan Review")
else OBSNOW(
"TXP_TYPE", "Review") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan DC Plan", "10","") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan Patient Sig Line", "11") endif endif
if obsprev(
"MHTRTDISCRT") <> "" then
if useryesno(
"Please review the problems and diagnoses below:" + hret + hret + " Click 'Yes' to indicate that you have reviewed and accepted these problems." + hret + hret + " Click 'No' to just continue with the treatment plan without reviewing the problems." + hret + hret + "(N.B.: Use the 'Diagnosis Management' Encouter Type to update diagnosis as needed." + hret + "If problems or diagnoses have changed, it is best to update the problem list BEFORE" + hret + "starting the treatment plan to insure that the current problems are listed.)" + hret + hret + "Primary diagnosis: " + obsprev("mhprimdx") + hret + hret + "Problems and Diagnoses on Axes I - III:" + hret + prob_prior("list") + hret + hret + "Axis IV:" + hret + obsprev("mhdxaxisiv") + hret + hret + "Axis V: " + obsprev("gaf scale"))=="Yes"
then OBSNOW(
"TXP_TYPE", "Review") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan DC Plan", "10","") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan Patient Sig Line", "11") + OBSNOW("PROBS REVWD", "Problems and diagnoses were reviewed during this Treatment Plan Review")
+ (if useryesno(
"Please review the Discharge Criteria below." + hret + hret + " Click 'Yes' to accept the previous criteria." + hret + hret + " Click 'No' to enter new criteria." + hret + hret + get_last_dc_crit_prov_date("MHTRTDISCRT"))== "Yes" then obsnow("MHTRTDISCRT", obsprev("MHTRTDISCRT")) else "" endif)
else OBSNOW(
"TXP_TYPE", "Review") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan DC Plan", "10","") + ADD_FORM_COMP("Enterprise\Gallahue\PCP Treatment Plan", "PCP Tx Plan Patient Sig Line", "11")
+(if useryesno(
"Please review the Discharge Criteria below." + hret + hret + " Click 'Yes' to accept the previous criteria." + hret + hret + " Click 'No' to enter new criteria." + hret + hret + get_last_dc_crit_prov_date("MHTRTDISCRT"))== "Yes" then obsnow("MHTRTDISCRT", obsprev("MHTRTDISCRT")) else "" endif)
endif
endif
}
Thanks for your detailed response!
I'll need to wrap my head around how I want to approach this. I thought I had seen something similar at the Spring CHUG in Las Vegas.
here's another approach. Put an edit field and "suggestion box" button and drop it off to an external file. Here's an example of some code for the action button:
{fn dn_push_pe_suggestions_to_ext_file() {
local new_sugg=DOCUMENT.SUGGESTIONS
if new_sugg=="" then
userok("This functionality does not add anything to this patient's chart." + hret + hret + "Type in white space above to suggest new items for this form. " + hret + hret + "After you have typed your suggestion click the 'Suggest New PE Item' button") dn_gbl_pe_vis_ctrl_suggest="open" return "" else "" endif
?
new_sugg= "|" + new_sugg + "==>made by " + user.realname + " on " + document.clinicaldate + ". "
local fname_lst = "//opemrXXX/DynamicContent/suggestion_box/PE_suggestions.txt"
local fhnd_lst = FILEOPEN(fname_lst, "a")
if fhnd_lst <> NULL then FILEWRITE(fhnd_lst, new_sugg) FILECLOSE(fhnd_lst) else "" endif
//write the suggestion
DOCUMENT.SUGGESTIONS= ""
userok("Thanks. Feel free to add as many as you want. ")
return ""
}}
I like this idea! It would be great to have it launch a new email addressed to someone as well... theoretically to send an enhancement request via email.
Did you have any luck in getting this in place?
In the end, I set this up as a new "Page" (or tab) on the form.
I included a "Feedback" button with a JUMP_TO_TAB command.
Then, on the new tab, I included the following:
- a radio button field named DOCUMENT.FEEDBACK_TYPE with the following options: content error,misspelling,doesn't work,enhancement request,could you...,other comment
- a multi-line edit field named DOCUMENT.FEEDBACK_DETAILS that will only be displayed after an option is selected in the previous field
- a "Click to Send!" button which processes the following command:
MEL_SEND_FLAG("Flag","jgardner","Normal",str(._todaysdate),"Feedback: Form Name",DOCUMENT.FEEDBACK_TYPE + ": " + HRET + DOCUMENT.FEEDBACK_DETAILS,"Documents","")
I received my first Flag within minutes of putting this into place: it was a request to correct a misspelled word on a form that had been in place for over two years (oops!). The response from the users has been extremely positive.
Good luck!
Very cool! Do you know if the ability exists to send this flag to a group of users instead of just one individual?
Thanks!
Sorry, should have tried my first though prior to replying...
To send to multiple users, just add their ID within the "" after the initial user ID. For example: "user1,user2,user3"
Thanks
Yep, here's an example from another form:
MEL_SEND_FLAG("Flag", "hwinston,jbennetthill", "Normal", str(._todaysdate), "Subject line", "Message", "Documents", "")