[MT-L] Scripting Tools

129 views
Skip to first unread message

Jon Reny

unread,
Feb 4, 2013, 4:59:15 PM2/4/13
to medit...@mtusers.com
We are at 5.65 and like many others, ready to move to 5.66. One of our computers will be used to display the ED Tracker Board. When the computer boots up, I want Meditech to login by itself and then start a specific routine.
Does anyone know if there is a "macro" or scripting feature within Meditech I could use to fulfill what I want?
Thanks
Jon Reny
St John's Lutheran Hospital

This communication and any files or attachments transmitted with it may contain information that is confidential, privileged and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited and may be unlawful. If you have received this e-mail in error, please contact the sender immediately and delete the material from any computer.

===###===###===###===###===###===###===
To unsubscribe from the meditech-l, follow the instructions at the URL http://mtusers.com/mailman/options/meditech-l_mtusers.com/

Please do NOT send messages that ask "Please post to the list" or "I'd like to see your answers" or "Send that info to me, too" These are useless messages that just waste the email server's resources. Instead, email the original requester and ask that they send you or post the results of their question.

Go to http://MTUsers.net for other information on the list, as well as:
1) reading meditech-l messages online
2) job opportunities
3) vendor products and service


Do NOT send email to meditech...@MTUsers.com. This is a system email box that is NOT monitored by a human. If you need help or advice on how to use the meditech-l, email ju...@MTUsers.net. Julia helps manage the meditech-l, so she is your best resource.

===***===***===***===***===***===***===

Seth Bosack

unread,
Feb 4, 2013, 5:03:25 PM2/4/13
to Jon Reny, medit...@mtusers.com
I've done that sort of thing with the PCS status board using BostonWorkstation. Don't know of any native feature within Meditech. It sure would be nice.


Seth Bosack
Revenue Cycle Consultant - Healthcare Revenue Strategies
Tel. 401 285 1969
sbo...@hhc.org
sbo...@healthcarerevenuestrategies.com
www.healthcarerevenuestrategies.com
This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication. Thank you.

Still, Charles

unread,
Feb 5, 2013, 8:06:08 AM2/5/13
to Jon Reny, medit...@mtusers.com
I have written one in AutoIt, I will see if I can post it.
(AutoIt is a free scripting tool.)

Basically the program runs every 5 min to see if Meditech is running. If it is not, it launches Meditech and logs in as the ED Tracker or RAD Tracker ID.

I've set it up to read a network INI file, so you can remotely update the application itself, ie copy down a new version / turn it off or disable it on all devices running.

You will need to download the autoit script tool, edit the code once I post it for your environment (Your tracker user id & PW, network path etc..), and you should be up and running.

Charles J. Still, MBA
Information Services Team
Southwestern Vermont Health Care
100 Hospital Drive
Bennington, VT 05201
phone: 802.447.5411 fax 802.447.5495
email: Charle...@svhealthcare.org
website: www.svhealthcare.org

-----Original Message-----
From: meditech-...@mtusers.com [mailto:meditech-...@mtusers.com] On Behalf Of Jon Reny
Sent: Monday, February 04, 2013 4:59 PM
To: 'medit...@mtusers.com'
Subject: [MT-L] Scripting Tools

DISCLAIMER: The information contained in this electronic message is
legally privileged and confidential under applicable law and is intended
for a particular addressee(s). If it is not clear that you are the intended
recipient, you are hereby notified that you have received this transmittal
in error; any review, copying or distribution or dissemination is strictly
prohibited. If you suspect that you have received this transmittal in
error, please notify Southwestern VT Health Care Corporation
immediately by return email reply to (help...@phin.org), and
immediately delete the transmittal and any attachments without making
any copy or distribution. Thank you.

Taylor, John

unread,
Feb 5, 2013, 8:16:18 AM2/5/13
to Jon Reny, medit...@mtusers.com
I've used Boston Workstation to do this sort of thing.


Thanks,

John Taylor
Systems Analyst, Information Technology
Augusta Health | Office: (540)332-4882

-----Original Message-----
From: meditech-...@mtusers.com [mailto:meditech-...@mtusers.com] On Behalf Of Jon Reny
Sent: Monday, February 04, 2013 4:59 PM
To: 'medit...@mtusers.com'
Subject: [MT-L] Scripting Tools

Still, Charles

unread,
Feb 5, 2013, 8:38:58 AM2/5/13
to Jon Reny, medit...@mtusers.com
OK.

The file links are all internal so they need to be updated for your environment. Passwords also. I will post the raw code where you can download it.

http://svhealthcare.net/media/MT-L/EDM_Tracker_Launcher.zip

There it is, use it freely modify whatever. Again you will need to download the Autoit compiler.

Charles J. Still, MBA
Southwestern Vermont Health Care
St...@phin.org



================================================================================

Meditech RAD EDM Tracker Auto Login Utility and Notes - RADLT-r1.exe and RADLT-r1-Wrapper.exe

Two programs have been written to support the auto launch of the RAD EDM Read only Tracker.

RADLT-r1.exe
RADLT-r1-Wrapper.exe <-- Run in startup.

They are located herre:

file://issvhc/sharedir/IS/Meditech_EDM

To install to a workstation copy the two files to the

C:\Program Files\MEDITECH\Workstation4.x

and create a shortcut to the RADLT-r1-Wrapper.exe file in the computers SVMC auto start directory.

The program runs every 5 minutes and if the PC is idle, and the application is not running, it auto logsin and starts the tracker.

The *.AU3 files are also in the file://issvhc/sharedir/IS/Meditech_EDM directory.


=========================================================================

The SHARED INI file can be used to manage all trackers.

file://issvhc/ShareDir/EDCannedText/EDMTracker/RADLT.ini



[Version]
VersionCurrent="RADLT-r1.exe"
VersionOld="EDMLT-r7.exe"

[Location]
Source="\\issvhc\ShareDir\EDCannedText\EDMTracker\"
Destination="C:\Program Files\MEDITECH\Workstation4.x\"

[Status]
;Note Run, Disabled, Kill <- Changing this line can Disable or EXIT the application on all workstations entirely.
Status1="Run"

=========================================================================

=========================================================================
Code Below RADLT-r1-Wrapper.exe
=========================================================================

Code for Wrapper Application



;' This script wrapps the MEDITCH EDM RAD Tracker Application and runs it every 5 minutes
;' It will restart the program if it is closed, Maximize if minimized, If the pc is idle,
;' Charles Still, 2012 - 2013
;' Added Move Mouse for Screensaver Disable 1/11/13

#include <Timers.au3>
#include <_CompareFileTimeEx.au3>

DIM $switch=1
DIM $IniFile="\\issvhc\ShareDir\EDCannedText\EDMTracker\RADLT.ini"
DIM $version=IniRead($IniFile,"Version","VersionCurrent","NotFound")
DIM $hSource=IniRead($IniFile,"Location","Source","NotFound") & $version
DIM $hDestination=IniRead($IniFile,"Location","Destination","NotFound") & $version
DIM $Status=IniRead("\\issvhc\ShareDir\EDCannedText\EDMTracker\RADLT.ini ")
DIM $iMethod=0
DIM $FileCompare=0
DIM $wtf=0 ;Debug Util

sleep(50000) ;50 Second Sleep Delay befor running script for fitst time should help with slow booting computers

While 1
;Disables screen saver with mouse move every 4 min if device is idle
Global $iIdleTime = _Timer_GetIdleTime()

If $iIdleTime > 240000 Then
MouseMove(10, 100, 0)
EndIf

IF Mod(@MIN,5) = 0 Then
If FileExists($hDestination)=0 Then FileCopy ($hSource, $hDestination, 1)
If FileExists($IniFile)=0 Then
MsgBox("Error","Inifile not found at" & $IniFile, 5)
Exit
EndIf
Global $FileCompare = _CompareFileTimeEx($hSource, $hDestination, $iMethod)
If $FileCompare=1 then FileCopy ($hSource, $hDestination, 1)
If $switch = 0 and $Status="Run" Then
Run($hDestination)
$switch=1
Else
$switch=0
EndIf
Endif
;EndIf
Sleep(10000)
WEnd


=======================================================================
Code for RADLT-r1.exe
=======================================================================

;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
;'
;' SVMC Tracker Board Script (Via Auto-It!)
;'
;' Written by Damian Shepard in IT NAMC, to assist with automatically logging into
;' the ED Tracker board in the Emergency Room for our EDM Module Go-LIVE
;' - 6/2012 - updated by Charles Still SVMC
;' - Includes exits if a step in the macro fails
;' - Includes stop if Meditech is Already Running
;' - Includes stop if Script is already executing
;' - Includes Maximize Window on launch
;' - Added functionality to handle Login Messages displaying on screen
;' - 12/2012 Added idle timer so script will not run if device has been used in last 30 seconds
;' - 1/2013 Rewritten from scratch to handle multiple startup options
;' - 1/2013 Added feature to maximize window of tracker if it is minimized
;' - Note the EDMLT-r#-Wrapper or RADLT-r# application calls this script every 5 min.
;' - version RADLT-r1 - revision 1 - 1/25/13
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
;' Start of Script
;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim $Test=0
Dim $numberOfAppInstances=0
Dim $FAIL=0
Dim $FAIL1=0
DIM $FAIL2=0
Dim $ProcessName = "T.exe"
Dim $Y=0
Dim $state=0
Opt("WinTitleMatchMode", 2)

#include <Process.au3>
#include <Timers.au3>

$numberOfAppInstances = ProcessList(_ProcessGetName(@AutoItPID))
$numberOfAppInstances = $numberOfAppInstances[0][0]
Global $iIdleTime = _Timer_GetIdleTime()

;MsgBox(64, "_Timer_GetIdleTime", "Idle time = " & $iIdleTime & "ms")
;'Checks idle time delay, and does not run if computer has been used in last 30 sec.
;To use this script as an autolauncher shortcut, remark it out with ;'s
If $iIdleTime < 30000 Then
Exit
EndIf

$state = WinGetState("Radiology Tracker") ;gets the state of your ticker window
If BitAnd($state, 16) Then ;if it's minimized
WinSetState("Radiology Tracker","",@SW_RESTORE) ;restore it
EndIf

If $numberOfAppInstances > 1 Then
Exit
EndIf

If ProcessExists($ProcessName) Then
Exit
EndIf

;' Run("C:\Program Files\MEDITECH\Workstation4.x\T.exe")
Run("C:\Program Files\MEDITECH\Workstation4.x\T.exe", "" , @SW_MAXIMIZE)

Do
$FAIL1 = WinWaitActive("[CLASS:MRWF]","Sign On",2)
$FAIL2 = WinWaitActive("[TITLE:Magic Workstation]","MIS Directories",2)

If $FAIL1 = 0 AND $FAIL2 = 0 Then
Send("{ENTER}")
$Y=$Y+1
EndIf

If $FAIL1 <> 0 Then
Send("radtracker{ENTER}")
Send("password{ENTER}")
Sleep(200)
Send("{ENTER}")
Exit
EndIf

If $FAIL2 <> 0 THEN
Send("1{ENTER}")
Sleep(100)
Send("radtracker{ENTER}")
Send("password{ENTER}")
Sleep(200)
Send("{ENTER}")
Exit
EndIf

Until $Y=4

Exit


Charles J. Still, MBA
Information Services Team
Southwestern Vermont Health Care
100 Hospital Drive
Bennington, VT 05201
phone: 802.447.5411 fax 802.447.5495
email: Charle...@svhealthcare.org
website: www.svhealthcare.org


-----Original Message-----
From: meditech-...@mtusers.com [mailto:meditech-...@mtusers.com] On Behalf Of Jon Reny
Sent: Monday, February 04, 2013 4:59 PM
To: 'medit...@mtusers.com'
Subject: [MT-L] Scripting Tools

DISCLAIMER: The information contained in this electronic message is
legally privileged and confidential under applicable law and is intended
for a particular addressee(s). If it is not clear that you are the intended
recipient, you are hereby notified that you have received this transmittal
in error; any review, copying or distribution or dissemination is strictly
prohibited. If you suspect that you have received this transmittal in
error, please notify Southwestern VT Health Care Corporation
immediately by return email reply to (help...@phin.org), and
immediately delete the transmittal and any attachments without making
any copy or distribution. Thank you.



David McNally

unread,
Feb 5, 2013, 2:23:38 PM2/5/13
to Still, Charles, Jon Reny, medit...@mtusers.com
Wouldn't this pose a security risk? You would need to code a user name and password which can be seen in the code as clear type and/or use generic users and passwords. This should be done using Single Sign On with a secure/encrypted password vault (authentication servers). What you are proposing would allow anyone who has access to that computer to look up patient information.

http://en.wikipedia.org/wiki/Single_sign_on


David McNally
Sr. Programmer
Southcoast Hospitals
CONFIDENTIALITY NOTICE:
This e-mail and any files transmitted with it are confidential and may contain health information protected by law. Any unauthorized use or disclosure is strictly prohibited. If you are not the intended recipient, please notify the sender by return email, delete this email, and destroy any copies. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Southcoast. The recipient should check this e-mail and any attachments for the presence of viruses. Southcoast accepts no liability for any damage caused by any virus transmitted by this e-mail.

Still, Charles

unread,
Feb 5, 2013, 2:33:47 PM2/5/13
to David McNally, Jon Reny, medit...@mtusers.com
:) Actually, no, but great concern.

Meditech KB Article ID: 11727 pasted below.

The Meditech Tracker ID's have been specially designed (If you follow Meditech setup routines) to have only read access to the Meditech Public Tracker and no access to patient information.

You can hit the right control key to login with a real user id when the tracker is running, but when you exit you are dropped back to a read only tracker with no access.

At last Year's MUSE I did the HCA Site visit and saw how they had setup Trackers throughout their ED and RAD areas to maximize patient throughput. (Thanks HCA) Not sure what they used for a login tool.

This also does require a local OS id without access to patient data.



==================================================================
Article ID: 11727
Date: 7/17/2001
Published: 7/26/2001 Application: EDM
Subject: Application Issues
Platform: MAGIC

How to build a generic user so the Public tracker can be constantly displayed

The goal of the public tracker in EDM is to be used on large display monitors or idling clients. In order to get the public tracker started, a user must sign onto the system. This could create a security breech so the solution is to build a generic user with access only to the tracker.

In MIS, define a new user with an easy name and password like ED password TRACKER. On page 2, give access to EDM database and the procedure "EDM.MULTI.public.tracker. When the arguments prompt displays, enter the mnemonic of the tracker to be displayed. This 10 character entry must be in quotes. File the user and give it a test.

A user can then sign onto the system from this user using the Rt. Control from any running public tracker.

David McNally

unread,
Feb 5, 2013, 3:15:48 PM2/5/13
to Still, Charles, Jon Reny, medit...@mtusers.com
Thanks for the info. My bad, I wasn't looking at it in the context of the question - for the tracker.
In general it's a bad idea, but yes, there are cases where you need to or it's safe to do so I guess. :)

I do have a question for you. Have you been able to use Autoit to call the MT scripting dll to do scripting?

I've found that if you want to do screen field reads, you need to init the MT workstation using the dll first. I see that Autoit can call a dll, and when I try to call MRWStartup to launch the session, it returns, but never launches the session.

I had:

local $result=DllCall("C:\Program Files (x86)\MEDITECH\Workstation3.x\MRWScript.dll","int","MRWStartup","str","C:\Program Files (x86)\MEDITECH\Workstation3.x\T.exe","BOOLEAN","FALSE")

Verified my path is correct and the file is there.

Still, Charles

unread,
Feb 5, 2013, 3:52:40 PM2/5/13
to David McNally, Jon Reny, medit...@mtusers.com
Hey David;

Given the fines if we make a mistake with patient data, the security question is a very first must ask. Then at the end of the day, document your concerns and let management make the call.

I had not thought it would be possible to read the medteich screens themselves from within AutoIT. For that I have used the Free iatric basic scripting tool. Can you load that at the command line / in a batch file and have the Autoit window tool see the text?

David McNally

unread,
Feb 7, 2013, 2:40:22 PM2/7/13
to Bryce Schloyer, medit...@mtusers.com
Sure, the notes can be found on the MT web site, under Systems Support->Scripting
They work well with Workstation 3. If you have a MT account on their web site, you can find them here.
If not, send me an email and I can send them to you.

https://www.meditech.com/prsystems/Pages/SYSmcSCscripting.htm

For Workstation 4 it takes a lot more effort, but they can be used. Problem is that in Workstation 3, it's always on one Window. With Workstation 4, each screen you go to can open in a new window or even be a pop up box or message box window. When you send the script commands to the wrong window, they don't work, so you have to track all the windows buy getting their memory handles. Once you get the right one, you can use the dll to read/write to the screen. I only use the screen read back functions myself, which MUST be used in conjunction with MRWStartup. If you don't launch the workstation with this function, you cannot use the screen read back function. As far as the other functions, they are slow and you can use .NET UIAUTOMATION functions instead.

I ended up writing an entire VB.NET API for scripting in Workstation 4 (and it supports 3), that works great. We have been able to script almost anything we need with it except, I don't yet have OCR to read the data in the tables but there are usually work arounds to that but they are slower. We can also min/max windows, find and click buttons, select menu items, etc. but it took some time to get it working. Actually, it's still a bit of a work in progress as we make it faster and add more features. It can accurately move quite fast through the screens now.

David McNally
Sr. Programmer
Southcoast Hospitals Group

-----Original Message-----
From: Bryce Schloyer [mailto:bsch...@savanthealthcare.com]
Sent: Tuesday, February 05, 2013 11:21 PM
To: David McNally
Subject: Re: [MT-L] Scripting Tools

David,
Do you happen to have any notes on the function calls for the MRWScript.dll?

For your question below, have you done the DllOpen function before your DllCall?

Thanks!
Bryce

----
BRYCE A. SCHLOYER
SAVANT HEALTHCARE SOLUTIONS, INC.
email: bsch...@savanthealthcare.com
office: (805) 253-3624



On Feb 5, 2013, at 2:15 PM, David McNally <McNa...@southcoast.org>
wrote:
> We are at 5.65 and like many others, ready to move to 5.66. One of our computers will be used to display the ED Tracker Board. When the computer boots up, I want Meditech to login by itself and then start a specific routine..
This email and any attachments may contain confidential and privileged information. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. If you are not the intended recipient, please notify the sender immediately by return email, delete this email and destroy any copies.

David McNally

unread,
Feb 7, 2013, 2:57:10 PM2/7/13
to Still, Charles, Jon Reny, medit...@mtusers.com, mu...@museweb.org
Yes, I was getting the same thing when I tried - a 1 result. My thought was because the dll MT gives you is not registered in Windows, you essentially blind call the functions.

We use ScriptLink for small stuff, but it seems slow even when we set it fast. I actually wrote an entire API for Workstation scripting on my own that can do almost anything. I just posted another message that explains it a bit more, but I always like to have as many tools under my belt as I can, and was wondering if we could get Autoit to use the dll, in which case the screen read/write functions would work in it as well.

The only feature my stuff lacks is OCR to read the tables in WS 4. In MT's new HR product, it's almost a must have to be able to script anything. Almost anything else I can script. So far only Boston Workstation has proven to us the they can read the tables as well, as they have an OCR screen read ability. I could probably buy that component, as my system can take screen shots of windows or just buttons and labels that I can pass to it. I do have a plan to create my own, but it would be a lot of work and I just don't have any more time to spend on it right now.

David McNally
Sr. Programmer
Southcoast Hospitals Group

-----Original Message-----
From: Still, Charles [mailto:Charle...@svhealthcare.org]
Sent: Thursday, February 07, 2013 10:40 AM
To: Still, Charles; David McNally; 'Jon Reny'; 'medit...@mtusers.com'
Cc: 'mu...@museweb.org'
Subject: RE: [MT-L] RE: Scripting Tools


Hi David;

I am getting a 1 on the DllOpen command which I believe means "unable to use the DLL file"

From googling, which I am sure you have done, there is reference to a 2007 Muse presentation that explains the fix. But the MUSE site has already cleared them. Alan do you have the 2007 conference files in archive somewhere?

But, once you are in reading screens, http://www.iatric.com/Scriptlink is likely better than AutoIt....



Code:

Dim $result=""
Dim $dll=""

;MsgBox("Return","WTH",$result)

local $dll = DllOpen ("C:\Program Files\MEDITECH\Workstation4.x\mrwscript.dll")

MsgBox("Return","WTH",$dll)

local $result=DllCall($dll, "int", "MRWStartup", "str", "C:\Program Files\MEDITECH\Workstation4.x\T.exe", "Null")

MsgBox("Return","WTH",$result)

DllClose($dll)

Rianto, Harry

unread,
Feb 8, 2013, 2:12:23 PM2/8/13
to medit...@mtusers.com
Is there a way (attribute) to launch a website base on the response to a
query? Say if the query response is "Y" then open "www.meditech.com"
automatically.

Thanks,
Harry Rianto
Technical Analyst
Interprofessional Informatics
Bluewater Health
89 Norman Street
Sarnia, ON N7T 6S3

519-464-4400 ext.8534
hri...@bluewaterhealth.ca
www.bluewaterhealth.ca

Mission: We create exemplary healthcare experiences for patients and
families every time.

Confidentiality Notice: This communication (and any attachment) is a
confidential document. It should only be read by the person(s) to whom
it is addressed. If you have received this communication in error,
please notify the sender by reply and delete this communication
immediately.

Joe Cocuzzo

unread,
Feb 8, 2013, 2:29:14 PM2/8/13
to Rianto, Harry, medit...@mtusers.com
FCL1=IF{@.response="Y" ""^A,%Z.link.to.shell("www.meditech.com")}

This is set up so that the "Y" is cleared, so the query can be used as a trigger to go to the website, but the Y does not persist.




Joe Cocuzzo
Sr. Vice President
Reporting Services
Iatric Systems, Inc.
Phone/Fax: (978) 805-4115
Email: mailto:Joe.C...@iatric.com
Web: http://www.iatric.com/

Iatric Systems helps healthcare providers achieve success by delivering the most comprehensive healthcare IT integration.
__________
-----Original Message-----
From: meditech-...@mtusers.com [mailto:meditech-...@mtusers.com] On Behalf Of Rianto, Harry
Sent: Friday, February 08, 2013 2:12 PM
To: medit...@mtusers.com

Joe Cocuzzo

unread,
Feb 8, 2013, 3:15:57 PM2/8/13
to Joe Cocuzzo, Rianto, Harry, medit...@mtusers.com
PS - This code is for Magic platform. I happen to know that Bluewater is Magic.

Still, Charles

unread,
Feb 7, 2013, 10:39:46 AM2/7/13
to Still, Charles, David McNally, Jon Reny, medit...@mtusers.com, mu...@museweb.org

Hi David;

I am getting a 1 on the DllOpen command which I believe means "unable to use the DLL file"

From googling, which I am sure you have done, there is reference to a 2007 Muse presentation that explains the fix. But the MUSE site has already cleared them. Alan do you have the 2007 conference files in archive somewhere?

But, once you are in reading screens, http://www.iatric.com/Scriptlink is likely better than AutoIt....



Code:

Dim $result=""
Dim $dll=""

;MsgBox("Return","WTH",$result)

local $dll = DllOpen ("C:\Program Files\MEDITECH\Workstation4.x\mrwscript.dll")

MsgBox("Return","WTH",$dll)

local $result=DllCall($dll, "int", "MRWStartup", "str", "C:\Program Files\MEDITECH\Workstation4.x\T.exe", "Null")

MsgBox("Return","WTH",$result)

DllClose($dll)




Reply all
Reply to author
Forward
0 new messages