Howdy everyone! Longtime fan of DMPE and it's advanced scripting. Lets me automate a huge portion of my note/EMR management to spend more time with patients or get home sooner. I moved to new state, got a job with a wonderful new hospital system that uses EPIC (hurray!), but unfortunately it uses DMO, and accesses both DMO and EPIC via Citrix (boo!).
DMO's scripting capabilities are...lackluster. The most it has is fairly good Step-By-Step commands, compared to DMPE's advanced scripting and ability to use <lists>/ListVars, and just variables in general. As an example, you want to delete 10 sentences up? Get ready to click "new step" select "hotkey", press "shift up", select "hotkey", and press "delete". Now do that 10 times. Compare that to actual advanced scripting, something along the lines of +{up 10}{delete}. Or at least something similar, forgive me if it's missing "'s or the like, it's been many months since I actually did some scripting in it. Finally, DMO lacks the basic ability to click on the screen, allowing only keystrokes/key combinations.
So, in order to get around some of these deficits, I've been using AutoHotKey, a free, very straightforward scripting language with some great documentation, with practically all the benefits of VBS or Dragon's Advanced scripting. The biggest problem with it is that it uses keyboard and mouse inputs to activate. While it can be triggered by something like Windows Speech Recognition typing, DMO typing fails to do so, or at least DMO and EPIC accessed through Citrix, like my system uses. So, I've developed a workaround that I want to share with y'all. I'll post this in "Third Party Command Utilities" too since it might fit better there, but wanted to make you all aware of it in this category as it is likely most relevant to you all.
So, how it works first:
1. You design your "advanced scripting" in AHK. Set it to be triggered by a one word hotstring (::hotstring:
2. Make a DMO step-by-step command that types the first part of the hotstring (::hotstring), highlights it, then cuts it to the clipboard.
So long as you have the below code in your .ahk document that is running, that's all you need! The script will execute. The .ahk script has code at that top which fills an array with a list of all the hotstrings in the .ahk document itself. It monitors the clipboard, and when what is put on the clipboard matches a hotstring, it runs it via the function at the bottom.
Limitations!
1. Current verson only looks at one word hotstrings.
2. I have it set up so that anything else that is copied with but after the hostring is put into a variable for use (i.e. ::hotstring additionalWordsHerePutIntoAVariableAsAString). This "limitation" is on the DMO end; since it doesn't use "listVars", you'll have to verbalize what you'll want copied on a new line (so you don't copy unintentional stuff), then have your DMO Step-By-Step command {home} to the beginning of that line before it types your ::hotstring, then {end}, shift{home}, then cut to capture the whole thing.
3. If you are in the same situation as myself, you'll need to find a place for DMO to actually type its ::hotstring in EPIC. Meaning, Citrix makes everything look like an image, no access to "Controls", and if you are on a screen that doesn't have an edit DMO can type into (like your patient schedule), you'll have to bring something up for it to type into. I've found that bringing up a search bar gives you an edit to type into. The keystroke combo to bring up the search bar is either alt{space} or ctrl{space}, can't remember which right now.
So, on to the ahk script/coding. Note that a comment is anything following a ; or between /* */.
Begin AHK coding which you would put into a new .ahk under the autoexecute section:
;=====================================
;=====================================
; ---Global Variables---
;=====================================
;Global Array holding the list of hotstrings in this script
Global ahkScriptsArray := {}
;=====================================
;Declared Global Variable to hold additional information for manipulation.
Global Input := ""
;=====================================
; ---Additional Auto-Execute stuff---
;=====================================
;part that pulls the ::hotstrings:: out of this .ahk document and puts it into the array.
FileRead, fileInfoVar, %A_ScriptFullPath%re">
While pos := RegExMatch(fileInfoVar, "\R(::\w+)::", m, pos ? pos + StrLen(m) : 1)
ahkScriptsArray.Push(m1)
;=====================================
;Monitors for the clipboard to change, to compare to the below called function, which should compare to the hotstrings.
OnClipboardChange("DragonCompare")
;=====================================
;Put your "Advanced Scripting" ::hotstrings below here:
;=====================================
;Functions section, having the part that compares your clipboard to your ::hotstrings
DragonCompare()
{
For A , hotString in ahkScriptsArray
{
RegExMatch(Clipboard, "(?P<ClipCompare>(?<!.)::\w*\b)(?P<Input>.*)", var)
If (hotString = varClipCompare)
{
Input := varInput
Try GoSub % varClipCompare
Input := ""
Return
}
Else
Continue
}
Return
}
End AHK coding.
Hope this helps someone, as DMO's lack of functionality has frustrated me to know end, and knowing others have benefited from my frustration coding will make it worth it.