;; Timings for sleep commands are based on what reliably works on my work machine - may need adjusting if not working well ;; TODO: a search that loads appointment sarching instead of the patient record ;; Searches for the NHS number in SystmOne's F10 menu ;; Uses the clipboard as this is a method used by other AMGP actions/hotkeys SearchForPatientByNHS(ByRef patient_nhs) { ;; Trim and remove spaces patient_nhs := RTrim(patient_nhs, "`r`n") patient_nhs := RegExReplace(patient_nhs, "[^\d+]") ;; Checks to see if nhs_number is 10 digits, no checksum calculations currently if(!valid_nhs_number(patient_nhs)) { MsgBox, Invalid NHS number supplied - |%patient_nhs%| ;*[mybreak1] return } Clipboard := patient_nhs SearchForPatientFromClipboard() return } ;; Searches for clipboard contents in SystmOne's F10 menu (no NHS nuumbebr validation) SearchForPatientFromClipboard() { WinActivate, % "SystmOne GP" Sleep 100 Send {F10} Sleep 350 Send ^v Sleep 50 Send {ENTER} Sleep 200 Send {ENTER} return } ;; Search for copied NHS number ^F11:: SearchForPatientFromClipboard() Return ; Search current Patient from AMGP in S1 via NHS number ;^F10:: ;patient_name = "" ;patient_nhs = "" ;GetPatientDetails(patient_name, patient_nhs) ;if (patient_nhs = "") { ;MsgBox, Couldn't get NHS number %patient_nhs% ;} else { ;SearchForPatientByNHS(patient_nhs) ;} ;Return ;; Med3, Not fit for work, Free Text, in S1. To do this Assign med3 to F12 menu under letter M ^M:: med3: Send {F12} Sleep 200 SendRaw {m} Sleep 1000 Send {Space} Send {Tab 4} return ;; Copy email notes into record ^+E:: copyemailnotes: ClipBoard := RegExReplace(ClipBoard, "\R+\R", "`r`n") ; Removes blank lines Send ^w Sleep 600 Send {Shift down} Send {Tab 16} Send {Shift up} Sleep 200 Send {Shift down} Send {Home} Send {Shift up} Send {Del} Send {Control up} Send E-mail Send {Enter} Send {Tab} Send {Alt down}o{Alt up} Sleep 50 Send ^v Send {BS} Send {Home} Send {PgUp 2} Send {Shift down} Send {End} Send {Down 2} Send {Shift up} Send {Del 2} Send {End} Send {PgDn 2} return