#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=nurse.ico #AutoIt3Wrapper_Outfile=Nurses6.exe #AutoIt3Wrapper_Outfile_x64=Nurses6.exe #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Nurses ; ; ;Script for use with ZedMed Clinical Module ; Used to speed the entry of patients into the treatment room waiting room ; when transferring their care to the registered nurses ; ;Author : Ross Newbery ;Version 1.0 ;Date 20/5/2009 ;Version 1.1 updated to cope with minor change in field labels introduced by ZedMed update 19 ; Date 9/4/2013 ;Version 1.2 updated to fix intermittent failures to pick up surname field and occ failures to select Registered Nurse as "doctor" in waiting room attendance dialog ; Date 12/4/2013 ;Version 1.3 Added multiple WinWaitActive Statements in the patient Data section to improve reliability ;This eliminated the need for multiple Sleep statements ; Date 29/11/2017 ;Version 1.4 Edited to restore function after ZedMed version 27 update broke script with multiple dialog box channges ;Currently works as script but fails when compiled as exe ;Date 14/9/2018 ;Version 1.4 Edited to restore sleep statements to get reliable name data collection ;Version 1.6 Edited to restore function when Zedmed Version 30 update broke script ;activate clinical module If WinExists("Zedmed Clinical") Then WinActivate("Zedmed Clinical", "") WinWaitActive("Zedmed Clinical", "") Else MsgBox(0, "Nurses Waiting Room", "ZedMed Clinical does not appear to be open") Exit EndIf ;open the patient data section (through arcane kludge due to lack of direct hotkey access) Send ("^h") ;move to the section tabs after a small pause - exra pauses added 11/4/2013 to avoid unresponsiveness WinWaitActive("Patient - ", "");WinWaitActive (with default window matching mode) appears to work more reliably than multiple "Sleep" parameters sleep(200) Send ("{TAB}") sleep(200) WinWaitActive("Patient - ", "") Send ("{TAB}") sleep(200) WinWaitActive("Patient - ", "") Send ("{TAB}") ;a small delay here seems to stop unpredictable results sleep(200) WinWaitActive("Patient - ", "") ;move left to the patient info tab Send ("{LEFT 2}") ;another delay to stop weirdness Sleep (200) WinWaitActive("Patient - ", "") ;move to the first name field Send ("{TAB 2}") WinWaitActive("Patient - ", "") ;Sleep (500) ;initialise the variable to make it obvious if bad stuff is happening to the script $first = "wrong" ;get the first name $first = ControlGetText ( "Patient", "", "[CLASS:TDBEdit; INSTANCE:15]") ;add a comma and space before the first name - this is for new incarnation of Medipak - ;$first = ", " & $first ;initialise this variable too $last = "wrong2" WinWaitActive("Patient - ", "") ;move to the last name field Send ("{TAB 3}") WinWaitActive("Patient - ", "") ; get the last name $last = ControlGetText ( "Patient", "", "[CLASS:TDBEdit; INSTANCE:13]") WinWaitActive("Patient - ", "") ;close patient data section Send ("!c") ;check if Appointments open and close if it is If WinExists("Appointments Display Grid - Auto-refresh every 1 minutes") Then WinActivate("Appointments Display Grid - Auto-refresh every 1 minutes", "") WinWaitActive("Appointments Display Grid - Auto-refresh every 1 minutes", "") Send ("!{F4}") EndIf ;Activate the waiting Room If WinExists("Waiting Room - Auto-refresh every 30 second") Then WinActivate("Waiting Room - Auto-refresh every 30 second", "") WinWaitActive("Waiting Room - Auto-refresh every 30 second", "") ;or open it if it is not already open ElseIf WinExists("Uni. Of Canberra Medical Centre") Then WinActivate("Uni. Of Canberra Medical Centre", "") Send ("!w") WinWaitActive("Waiting Room - Auto-refresh every 30 second", "") ;or if that doesn't work notify the user that bad stuff is happening ;Else ; MsgBox(0, "Nurses Waiting Room", "ZedMed does not appear to be open" & @CRLF & "Please check to make sure there are no message dialogs " & @CRLF & "that require closing") EndIf ;Now to clear the decks of rubbish - ;If that bloody Intramail box is active get rid of it If WinExists("Confirm") Then WinActivate("Confirm", "") WinWaitActive("Confirm") ;click "No" ControlClick("Confirm", "", "[CLASS:TButton; INSTANCE:1]") ;make sure the waiting room is active after that WinActivate("Waiting Room - Auto-refresh every 30 second", "") WinWaitActive("Waiting Room - Auto-refresh every 30 second", "") EndIf ;and death to the Office Tray! Damn the torpedoes! (Watch out for complaints that this closes important stuff) ;but for some unexplained reason this subroutine blocks execution of the script - there may be difficulty in determining whether ; the Office Tray window exists or not ;If WinExists("Office Tray")Then ; WinActivate("Office Tray", "") ; WinWaitActive("Office Tray") ; ;Close it ; Send ("!{F4}") ; If WinExists("Message Dialog") Then ; Send ("!y") ; EndIf ; EndIf ;activate the Quick Attend Button (via mouseclick because some dropkick programmer eliminated the keyboard shortcut) WinActivate("Waiting Room - Auto-refresh every 30 second", "") WinWaitActive("Waiting Room - Auto-refresh every 30 second", "") MouseClick("Left",45,55) ;Send ("!q");if keyboard shortcut reinstated this may be more robust than mouseclick ;Find the patient WinWaitActive("Find / Add Patient") ;enter the last name WinActivate("Find / Add Patient") Send ("{HOME}") ;this extra keystroke appears to fix the problem of missing initial characters ControlSend("Find / Add Patient", "", "[CLASS:TEdit; INSTANCE:3]", $last) ;enter the first name; WinActivate("Find / Add Patient") Send ("{HOME}") ;this extra keystroke appears to fix the problem of missing initial characters ControlSend("Find / Add Patient", "", "[CLASS:TEdit; INSTANCE:2]", $first) ;find patient and check it is the right one ;search Send("!f") ;wait till the result has been checked by the user and the attendance details screen has appeared WinWaitActive("Attendance Details") ;pause to allow other script to complete Sleep(1000) ;Select the "Doctor" Selector Combo box ControlClick("Attendance Details", "", "[CLASS:TKeyComboBox; INSTANCE:4]") ;scroll down ControlCommand("Attendance Details", "", "[CLASS:TKeyComboBox; INSTANCE:4]","ShowDropDown", "") ;select registered nurse ControlCommand("Attendance Details", "", "[CLASS:TKeyComboBox; INSTANCE:4]","SetCurrentSelection", 10) ControlClick("Attendance Details", "", "[CLASS:TKeyComboBox; INSTANCE:4]") ;Send("{ENTER}");not needed - this breaks script Send("r");insurance to make sure that "Registered Nurse" is selected ;and confirm selection ;Send("{ENTER}");appears this keystroke send is unnecessary after sending the "r" ;select Notes field for entry of instructions ControlClick("Attendance Details", "", "[CLASS:TDBMemo; INSTANCE:1]") ;go up in case there is more than one line in the details field Send ("{UP}") ;and back home for entry Send ("{HOME}") ;and do it again because sometimes it doesn't work the first time Send ("{HOME}") Exit