SlideShare a Scribd company logo
1 of 37
Automation of
Electronic Medical Record(EMR) Tasks
using AutoHotkey in MS Windows
2023-05-11
Seoul National University Hospital
Department of Family Medicine
Min-Hyung Kim
Automation of EMR tasks using AutoHotkey
CONTENTS
• Motivation
• User Interface (UI) & User Experience (UX)
• 3 click rule & user navigation model
• Workflow process optimization
• Using Google Sheet in the workflow @ SNUH FM?
• AutoHotkey
• Window Spy (AutoHotkey Script itself!)
• Move to (x-axis, y-axis) & Click
• Send Ctrl+c, Ctrl+v
• Send Unicode Left Arrow ← (U+2190)
• Run Notepad.exe
• Define a hotkey @ AutoHotkey
• Define a function @ AutoHotkey
• Regular Expression @ AutoHotkey
• (Review) Tutorials for Regular Expression (정규표현식)
User Interface (UI) & User Experience (UX)
3 click rule & user navigation model
Workflow process optimization
Gittler, Halawa et al. (2019)
Using Google Sheet in the workflow @ SNUH FM?
Ideal
1. One-click, DONE!
Reality
1. Open Google Sheet
2. Copy (Ctrl+c) texts from EMR
3. Paste (Ctrl+v) texts into "Input Table"
4. Run calculation in Google Sheet
5. Move to "Output Table"
6. Copy (Ctrl+c) from "Output Table"
7. Paste (Ctrl+v) texts into EMR
Workforce?
Ideal Reality
AutoHotkey
Window Spy (AutoHotkey Script itself!)
AutoHotkey
Move to (x-axis, y-axis) & Click
mouseclick, left, %x%, %y%
!d:: ; Hotkey Alt+d
mouseclick, left, 930, 65, 1, 0
Sleep 800
mouseclick, left, 1010, 400, 1, 0
Sleep 800
mouseclick, left, 960, 920, 1, 0
Sleep 800
mouseclick, left, 970, 570, 1, 0
Sleep 800
mouseclick, left, 5, 257, 1, 0
Sleep 1000
mouseclick, left, 1630, 140, 1, 0
return
https://github.com/mkim0710/autohotkey/blob/main/BESTCare%202.0%20AutoClick%20Alt%2Bd%20clean%20(SNUBH)%20230107.ahk
Send Ctrl+c
Send Ctrl+v
Send ^c
Send ^v
Run Notepad.exe
Send Unicode Left Arrow ← (U+2190)
Send chr("0x2192")
Send " " . chr("0x2192") . " "
Define a hotkey @ AutoHotkey
!d:: ; Hotkey Alt+d
mouseclick, left, 930, 65, 1, 0
Sleep 800
mouseclick, left, 1010, 400, 1, 0
Sleep 800
mouseclick, left, 960, 920, 1, 0
Sleep 800
mouseclick, left, 970, 570, 1, 0
Sleep 800
mouseclick, left, 5, 257, 1, 0
Sleep 1000
mouseclick, left, 1630, 140, 1, 0
return
Define a function @ AutoHotkey
function_LeftArrowUnicode(InputText)
{
Return regexreplace(InputText, "<-",
chr("0x2190") )
}
EMR lab data @ SNUH EMR
Input
T4(free)(진검시행) 0.90 1.03
TSH(진검시행) 3.41 3.84
Calcium 9.2 8.9
Phosphorus 3.5 2.9
Glucose 95 102
Uric acid 3.3 3.0
Chol. 171 198
T. Protein 7.2 7.2
Albumin 4.5 4.4
T. Bil. 1.0 1.0
Alk. phos. 46 49
AST(GOT) 24 33
ALT(GPT) 29 47
GGT 32 37
BUN 10 13
Creatinine 0.77 0.73
eGFR(MDRD) 104.9 111.6
eGFR(CKD EPI Cr) 102.2 104.4
TG 270 179
HDL Chol. 36 44
LDL Chol. 87 113
LDL Chol.(계산식) 81 118
hs-CRP 0.03 0.06
WBC 4.71 5.27
Hb 15.3 16.2
Hct 45.5 47.0
MCV 95.0 95.7
Platelet 164 157
ESR 2 5
ANC 2421 2466
Hb A1c 5.2 5.3
Regular Expression @ AutoHotkey
functionEMR_TSV_AddLeftArrowUnicode(EMR_TSV)
{
Return regexreplace(EMR_TSV, "(.*)t([0-9]+(?:.[0-
9]*)?).*t([0-9]+(?:.[0-9]*)?).*", "$1`t`t$2`t" " "
chr("0x" . "2190") " " "$3") . "`r`n"
}
^#!Numpad4:: ; Ctrl+Win+Alt+Numpad4 ; Add
←(U+2190) between the numbers
Send ^c
Sleep 100
ClipWait 2 ; Waits until the
clipboard contains data, up to 2s
ClipBoard2Text = %ClipBoard% ; Store
%ClipBoard% to ClipBoard2Text - Automatically converted
to text without any format?!
Sleep 100
ClipWait 2 ; Waits until the
clipboard contains data, up to 2s
functionCopy2Clipboard2Txt(functionEMR_TSV_AddLeftArr
owUnicode(ClipBoard2Text))
VarSetCapacity(ClipBoard2Text, 0) ; Free memory
Return
https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
EMR lab data @ SNUH EMR
Input
T4(free)(진검시행) 0.90 1.03
TSH(진검시행) 3.41 3.84
Calcium 9.2 8.9
Phosphorus 3.5 2.9
Glucose 95 102
Uric acid 3.3 3.0
Chol. 171 198
T. Protein 7.2 7.2
Albumin 4.5 4.4
T. Bil. 1.0 1.0
Alk. phos. 46 49
AST(GOT) 24 33
ALT(GPT) 29 47
GGT 32 37
BUN 10 13
Creatinine 0.77 0.73
eGFR(MDRD) 104.9 111.6
eGFR(CKD EPI Cr) 102.2 104.4
TG 270 179
HDL Chol. 36 44
LDL Chol. 87 113
LDL Chol.(계산식) 81 118
hs-CRP 0.03 0.06
WBC 4.71 5.27
Hb 15.3 16.2
Hct 45.5 47.0
MCV 95.0 95.7
Platelet 164 157
ESR 2 5
ANC 2421 2466
Hb A1c 5.2 5.3
Output
T4(free)(진검시행) 0.90 ← 1.03
TSH(진검시행) 3.41 ← 3.84
Calcium 9.2 ← 8.9
Phosphorus 3.5 ← 2.9
Glucose 95 ← 102
Uric acid 3.3 ← 3.0
Chol. 171 ← 198
T. Protein 7.2 ← 7.2
Albumin 4.5 ← 4.4
T. Bil. 1.0 ← 1.0
Alk. phos. 46 ← 49
AST(GOT) 24 ← 33
ALT(GPT) 29 ← 47
GGT 32 ← 37
BUN 10 ← 13
Creatinine 0.77 ← 0.73
eGFR(MDRD) 104.9 ← 111.6
eGFR(CKD EPI Cr) 102.2 ← 104.4
TG 270 ← 179
HDL Chol. 36 ← 44
LDL Chol. 87 ← 113
LDL Chol.(계산식) 81 ← 118
hs-CRP 0.03 ← 0.06
WBC 4.71 ← 5.27
Hb 15.3 ← 16.2
Hct 45.5 ← 47.0
MCV 95.0 ← 95.7
Platelet 164 ← 157
ESR 2 ← 5
ANC 2421 ← 2466
Hb A1c 5.2 ← 5.3
Regular Expression @ AutoHotkey
functionFilterLines(TextInput, RegEx2Filter)
{
TextOutput := regexreplace(TextInput, "(.*" . RegEx2Filter .
".*)|(.)", "$1")
TextOutput := TextOutput . "`r`n"
TextOutput := regexreplace(TextOutput, "(r?n)+", "`r`n")
TextOutput := regexreplace(TextOutput, "^(r?n)+", "")
return TextOutput
}
functionTSV_ExtractColumn3(Input_TSV)
{
TextOutput := regexreplace(Input_TSV,
"([^nrt]*)t([^nrt]*)(?:t([^nrt]*))?", "$3") . "`r`n"
Return TextOutput
}
functionTSV_ExtractColumn4(Input_TSV)
{
TextOutput := regexreplace(Input_TSV,
"([^nrt]*)t([^nrt]*)t([^nrt]*)(?:t([^nrt]*))?",
"$4") . "`r`n"
Return TextOutput
}
https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
Regular Expression @ AutoHotkey
functionProcessText_EMR_TSV4_lipid(Input_TSV)
{
TextOutput3 := ""
TextOutput4 := ""
SimpleArray01 := ["`tChol.`t", "TG", "HDL", "LDL Chol.`t"]
for index, value in SimpleArray01
{
var4search := value
TextOutput3 := TextOutput3 .
functionTSV_ExtractColumn3(functionFilterLines(Input_TSV, var4search)) . "/"
TextOutput3 := functionRemoveCarriageReturn(TextOutput3)
TextOutput4 := TextOutput4 .
functionTSV_ExtractColumn4(functionFilterLines(Input_TSV, var4search)) . "/"
TextOutput4 := functionRemoveCarriageReturn(TextOutput4)
}
TextOutput3 := regexreplace(TextOutput3, "/$", "")
TextOutput4 := regexreplace(TextOutput4, "/$", "")
TextOutput := TextOutput3 . " " . chr("0x" . "2190") . " " . TextOutput4
Return TextOutput
}
^#l:: ; Ctrl+Win+l
Send ^c
Sleep 100
ClipWait 2
ClipBoard2Text = %ClipBoard%
Sleep 100
ClipWait 2
functionCopy2Clipboard2Txt(functionProcessText_lab(ClipBoard2Text))
ClipWait 2
VarSetCapacity(ClipBoard2Text, 0) ; Free memory
Return
https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
EMR lab data @ SNUH EMR
Input
T4(free)(진검시행) 0.90 1.03
TSH(진검시행) 3.41 3.84
Calcium 9.2 8.9
Phosphorus 3.5 2.9
Glucose 95 102
Uric acid 3.3 3.0
Chol. 171 198
T. Protein 7.2 7.2
Albumin 4.5 4.4
T. Bil. 1.0 1.0
Alk. phos. 46 49
AST(GOT) 24 33
ALT(GPT) 29 47
GGT 32 37
BUN 10 13
Creatinine 0.77 0.73
eGFR(MDRD) 104.9 111.6
eGFR(CKD EPI Cr) 102.2 104.4
TG 270 179
HDL Chol. 36 44
LDL Chol. 87 113
LDL Chol.(계산식) 81 118
hs-CRP 0.03 0.06
WBC 4.71 5.27
Hb 15.3 16.2
Hct 45.5 47.0
MCV 95.0 95.7
Platelet 164 157
ESR 2 5
ANC 2421 2466
Hb A1c 5.2 5.3
Output
TChol/TG/HDL/LDL : 171/270/36/87 ← 198/179/44/113
Review
Tutorials for Regular Expression
(정규표현식)
Regular Expressions
@ Google Sheets
https://support.google.com/a/answer/1371415?hl=en
Input Regular Expression Output
1 Abc1234 .?(){} [A-Za-z] A
b
c
2 Abc1234 .?(){} [A-Za-z]{2} Ab
3 Abc1234 .?(){} [0-9]{2} 12
34
4 Abc1234 .?(){} [0-9]+ 1234
5 Abc1234 .?(){} .{6} Abc123
4 .?(
6 Abc1234 .?(){} . .
7 Abc1234 .?(){} [A-Za-z][0-9]|[0-9]{2} c1
23
8 Abc1234 .?(){} [A-Za-z]?[0-9]{2} c12
34
9 Abc1234 .?(){} [^0-9]* Abc
.?(){}
Regular Expressions
@ Google Sheets
Input Regular Expression Output
1 2022-06-03 [0-9]+ 2022
06
03
2 2022-06-03 -[0-9]{2} -06
-03
3 2022-06-03 [0-9]{4}-[0-9]{2}-
[0-9]{2}
2022-06-03
4 175
67.5
[0-9]+ 175
67
5
5 175
67.5
[0-9]+.[0-9]* 67.5
6 175
67.5
[0-9]+.?[0-9]* 175
67.5
https://support.google.com/a/answer/1371415?hl=en
tbl_input @ Google Sheets
Example input table @ SNUHFM HPDP
A B C D E
호흡기계 단순 흉부 촬영 (Chest X-Ray) Chest X-Ray 2022-06-03No significant interval change
since last study.
신체 측정 복부 지방 CT (Abdominal FAT CT) Abdominal FAT CT 2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
근골격계 골밀도 검사 (Dexa Bone Densitometry) Bone Densitometry <T - score>
Spine L1 - L4 : - 0.6
Femur neck : - 2.2
Femur total : - 2.6
Osteoporosis
https://tinyurl.com/SNUHFMRegEx
2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
=regexextract(
query(tbl_input!$A:$E, "select E where C
contains 'Abdominal FAT CT'")
, "[0-9]{4}-[0-9]{2}-[0-9]{2}" )
2022-06-03
=query(tbl_input!$A:$E, "select E where C contains
'Abdominal FAT CT'")
Regular Expression @ Google Sheets
Extract dates
[0-9]{4}-[0-9]{2}-[0-9]{2}
2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
=regexreplace(
regexextract(
query(tbl_input!$A:$E, "select E where C
contains 'Abdominal FAT CT'")
, "[0-9]{4}-[0-9]{2}-[0-9]{2}" )
,"-" ,"." )
2022.06.08
=query(tbl_input!$A:$E, "select E where C contains
'Abdominal FAT CT'")
Regular Expression @ Google Sheets
Extract dates
[0-9]{4}-[0-9]{2}-[0-9]{2}
2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
=regexextract(
query(tbl_input!$A:$E, "select E where C
contains 'Abdominal FAT CT'")
, "= *[0-9]+.?[0-9]*/" )
= 7051.11/
=query(tbl_input!$A:$E, "select E where C contains
'Abdominal FAT CT'")
Regular Expression @ Google Sheets
Extract visceral adipose tissue (VAT)
= *[0-9]+.?[0-9]*/
2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
=regexreplace(
regexreplace(
regexextract(
query(tbl_input!$A:$E, "select E where
C contains 'Abdominal FAT CT'")
, "= *[0-9]+.?[0-9]*/" )
,"= *" ,"" )
,"/" ,"" )
7051.11
=query(tbl_input!$A:$E, "select E where C contains
'Abdominal FAT CT'")
Regular Expression @ Google Sheets
Extract visceral adipose tissue (VAT)
= *[0-9]+.?[0-9]*/
2022-06-03Fat amount ratio
= Visceral fat/Subcutaneous fat
= 7051.11/7723.56
= 0.91
=round(value(
regexreplace(
regexreplace(
regexextract(
query(tbl_input!$A:$E, "select E where
C contains 'Abdominal FAT CT'")
, "= *[0-9]+.?[0-9]*/" )
,"= *" ,"" )
,"/" ,"" )
)) / 100 &" cm²"
70.51 cm²
=query(tbl_input!$A:$E, "select E where C contains
'Abdominal FAT CT'")
Regular Expression @ Google Sheets
Extract visceral adipose tissue (VAT)
= *[0-9]+.?[0-9]*/
<T - score>
Spine L1 - L4 : - 0.6
Femur neck : - 2.2
Femur total : - 2.6
Osteoporosis
=regexextract(query(tbl_input!$A:$E, "select E
where C contains 'Bone
Densitometry'"),"[Oo]steop[a-z]+")
Osteoporosis
=query(tbl_input!$A:$E, "select E where C contains
'Bone Densitometry'")
Regular Expression @ Google Sheets
Extract Dual Energy X-ray Absorptiometry (DEXA) results
[Oo]steop[a-z]+
<T - score>
Spine L1 - L4 : - 0.6
Femur neck : - 2.2
Femur total : - 2.6
Osteoporosis
=regexextract(query(tbl_input!$A:$E, "select E where C
contains 'Bone Densitometry'"),"[Oo]steop[a-z]+")
&"("&regexextract(query(tbl_input!$A:$E, "select E where C
contains 'Bone Densitometry'"),"[Ll][1-4] *- *[Ll][1-4]
*: *- [0-9]+.?[0-9]*")
&", "&regexextract(query(tbl_input!$A:$E, "select E where
C contains 'Bone Densitometry'"),"[Ff]emur [Nn]eck *: *-
[0-9]+.?[0-9]*")
&", "&regexextract(query(tbl_input!$A:$E, "select E where
C contains 'Bone Densitometry'"),"[Ff]emur [Tt]otal *:
*- [0-9]+.?[0-9]*")&")"
Osteoporosis(L1 - L4 : - 0.6, Femur neck :
- 2.2, Femur total : - 2.6)
=query(tbl_input!$A:$E, "select E where C contains
'Bone Densitometry'")
Regular Expression @ Google Sheets
Extract Dual Energy X-ray Absorptiometry (DEXA) results
[Oo]steop[a-z]+

More Related Content

Similar to 20230511 Automation of EMR Tasks using AutoHotkey in MS Windows_MKv1.1.pdf

Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Sergey Platonov
 
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdfSolve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdfsnewfashion
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysisDr. Rajdeep Chatterjee
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashingecomputernotes
 
Explanations to the article on Copy-Paste
Explanations to the article on Copy-PasteExplanations to the article on Copy-Paste
Explanations to the article on Copy-PastePVS-Studio
 
Photon Technical Deep Dive: How to Think Vectorized
Photon Technical Deep Dive: How to Think VectorizedPhoton Technical Deep Dive: How to Think Vectorized
Photon Technical Deep Dive: How to Think VectorizedDatabricks
 
Solution Manual for Introduction to Programming Using Python 1st Edition by S...
Solution Manual for Introduction to Programming Using Python 1st Edition by S...Solution Manual for Introduction to Programming Using Python 1st Edition by S...
Solution Manual for Introduction to Programming Using Python 1st Edition by S...romanelins
 
Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon GaliciaUnit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon GaliciaRobot Media
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4Abed Bukhari
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functionsVineeta Garg
 
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingEelco Visser
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsAsuka Nakajima
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++Neeru Mittal
 
Next Generation Developer Testing: Parameterized Testing
Next Generation Developer Testing: Parameterized TestingNext Generation Developer Testing: Parameterized Testing
Next Generation Developer Testing: Parameterized TestingTao Xie
 

Similar to 20230511 Automation of EMR Tasks using AutoHotkey in MS Windows_MKv1.1.pdf (20)

Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++Kirk Shoop, Reactive programming in C++
Kirk Shoop, Reactive programming in C++
 
8th Semester (June; July-2015) Computer Science and Information Science Engin...
8th Semester (June; July-2015) Computer Science and Information Science Engin...8th Semester (June; July-2015) Computer Science and Information Science Engin...
8th Semester (June; July-2015) Computer Science and Information Science Engin...
 
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdfSolve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
Solve the coding errors for upvotemake test-statsg++ -g -std=c++.pdf
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashing
 
Explanations to the article on Copy-Paste
Explanations to the article on Copy-PasteExplanations to the article on Copy-Paste
Explanations to the article on Copy-Paste
 
Photon Technical Deep Dive: How to Think Vectorized
Photon Technical Deep Dive: How to Think VectorizedPhoton Technical Deep Dive: How to Think Vectorized
Photon Technical Deep Dive: How to Think Vectorized
 
Solution Manual for Introduction to Programming Using Python 1st Edition by S...
Solution Manual for Introduction to Programming Using Python 1st Edition by S...Solution Manual for Introduction to Programming Using Python 1st Edition by S...
Solution Manual for Introduction to Programming Using Python 1st Edition by S...
 
Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon GaliciaUnit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
7th Semester (June; July-2014) Mechanical Engineering Question Paper
7th Semester (June; July-2014) Mechanical Engineering Question Paper7th Semester (June; July-2014) Mechanical Engineering Question Paper
7th Semester (June; July-2014) Mechanical Engineering Question Paper
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
 
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
 
Library functions in c++
Library functions in c++Library functions in c++
Library functions in c++
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Next Generation Developer Testing: Parameterized Testing
Next Generation Developer Testing: Parameterized TestingNext Generation Developer Testing: Parameterized Testing
Next Generation Developer Testing: Parameterized Testing
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 

More from Min-hyung Kim

20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx
20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx
20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptxMin-hyung Kim
 
MH prediction modeling and validation in r (2) classification 190709
MH prediction modeling and validation in r (2) classification 190709MH prediction modeling and validation in r (2) classification 190709
MH prediction modeling and validation in r (2) classification 190709Min-hyung Kim
 
MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709Min-hyung Kim
 
MH Prediction Modeling and Validation -clean
MH Prediction Modeling and Validation -cleanMH Prediction Modeling and Validation -clean
MH Prediction Modeling and Validation -cleanMin-hyung Kim
 
r for data science 2. grammar of graphics (ggplot2) clean -ref
r for data science 2. grammar of graphics (ggplot2)  clean -refr for data science 2. grammar of graphics (ggplot2)  clean -ref
r for data science 2. grammar of graphics (ggplot2) clean -refMin-hyung Kim
 
r for data science 4. exploratory data analysis clean -rev -ref
r for data science 4. exploratory data analysis  clean -rev -refr for data science 4. exploratory data analysis  clean -rev -ref
r for data science 4. exploratory data analysis clean -rev -refMin-hyung Kim
 
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403Min-hyung Kim
 

More from Min-hyung Kim (7)

20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx
20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx
20221001 KAFM 의학 형의상학(Medical Ontology) v5 -clean.pptx
 
MH prediction modeling and validation in r (2) classification 190709
MH prediction modeling and validation in r (2) classification 190709MH prediction modeling and validation in r (2) classification 190709
MH prediction modeling and validation in r (2) classification 190709
 
MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709MH prediction modeling and validation in r (1) regression 190709
MH prediction modeling and validation in r (1) regression 190709
 
MH Prediction Modeling and Validation -clean
MH Prediction Modeling and Validation -cleanMH Prediction Modeling and Validation -clean
MH Prediction Modeling and Validation -clean
 
r for data science 2. grammar of graphics (ggplot2) clean -ref
r for data science 2. grammar of graphics (ggplot2)  clean -refr for data science 2. grammar of graphics (ggplot2)  clean -ref
r for data science 2. grammar of graphics (ggplot2) clean -ref
 
r for data science 4. exploratory data analysis clean -rev -ref
r for data science 4. exploratory data analysis  clean -rev -refr for data science 4. exploratory data analysis  clean -rev -ref
r for data science 4. exploratory data analysis clean -rev -ref
 
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
 

Recently uploaded

Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in AnantapurCall Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapurgragmanisha42
 
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Thane Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in Chandigarh
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in ChandigarhChandigarh Escorts, 😋9988299661 😋50% off at Escort Service in Chandigarh
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in ChandigarhSheetaleventcompany
 
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetOzhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetJalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabad
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In FaridabadCall Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabad
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabadgragmanisha42
 
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...Ahmedabad Call Girls
 
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012adityaroy0215
 
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591adityaroy0215
 
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur RajasthanJaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthanindiancallgirl4rent
 
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetraisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF ...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF  ...❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF  ...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF ...Gfnyt.com
 
VIP Call Girl Sector 10 Noida Call Me: 9711199171
VIP Call Girl Sector 10 Noida Call Me: 9711199171VIP Call Girl Sector 10 Noida Call Me: 9711199171
VIP Call Girl Sector 10 Noida Call Me: 9711199171Call Girls Service Gurgaon
 
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR Call G...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR   Call G...❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR   Call G...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR Call G...Gfnyt.com
 
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetnagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetNanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...indiancallgirl4rent
 
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetHubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetCall Girls Service
 
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.ktanvi103
 

Recently uploaded (20)

Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in AnantapurCall Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
Call Girls Service Anantapur 📲 6297143586 Book Now VIP Call Girls in Anantapur
 
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Thane Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Thane Just Call 9907093804 Top Class Call Girl Service Available
 
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in Chandigarh
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in ChandigarhChandigarh Escorts, 😋9988299661 😋50% off at Escort Service in Chandigarh
Chandigarh Escorts, 😋9988299661 😋50% off at Escort Service in Chandigarh
 
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetOzhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Ozhukarai Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetJalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Jalna Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabad
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In FaridabadCall Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabad
Call Girls Service Faridabad 📲 9999965857 ヅ10k NiGhT Call Girls In Faridabad
 
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
(Deeksha) 💓 9920725232 💓High Profile Call Girls Navi Mumbai You Can Get The S...
 
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012
VIP Call Girl DLF Phase 2 Gurgaon (Noida) Just Meet Me@ 9711199012
 
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
VIP Call Girl Sector 88 Gurgaon Delhi Just Call Me 9899900591
 
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur RajasthanJaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
Jaipur Call Girls 9257276172 Call Girl in Jaipur Rajasthan
 
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetraisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
raisen Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF ...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF  ...❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF  ...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Jaispreet Call Girl Services in Jaipur QRYPCF ...
 
VIP Call Girl Sector 10 Noida Call Me: 9711199171
VIP Call Girl Sector 10 Noida Call Me: 9711199171VIP Call Girl Sector 10 Noida Call Me: 9711199171
VIP Call Girl Sector 10 Noida Call Me: 9711199171
 
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR Call G...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR   Call G...❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR   Call G...
❤️♀️@ Jaipur Call Girls ❤️♀️@ Meghna Jaipur Call Girls Number CRTHNR Call G...
 
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetnagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
nagpur Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetNanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Nanded Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...
(Ajay) Call Girls in Dehradun- 8854095900 Escorts Service 50% Off with Cash O...
 
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real MeetHubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
Hubli Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meetooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
ooty Call Girls 👙 6297143586 👙 Genuine WhatsApp Number for Real Meet
 
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.
Call Now ☎ 9999965857 !! Call Girls in Hauz Khas Escort Service Delhi N.C.R.
 

20230511 Automation of EMR Tasks using AutoHotkey in MS Windows_MKv1.1.pdf

  • 1. Automation of Electronic Medical Record(EMR) Tasks using AutoHotkey in MS Windows 2023-05-11 Seoul National University Hospital Department of Family Medicine Min-Hyung Kim
  • 2. Automation of EMR tasks using AutoHotkey CONTENTS • Motivation • User Interface (UI) & User Experience (UX) • 3 click rule & user navigation model • Workflow process optimization • Using Google Sheet in the workflow @ SNUH FM? • AutoHotkey • Window Spy (AutoHotkey Script itself!) • Move to (x-axis, y-axis) & Click • Send Ctrl+c, Ctrl+v • Send Unicode Left Arrow ← (U+2190) • Run Notepad.exe • Define a hotkey @ AutoHotkey • Define a function @ AutoHotkey • Regular Expression @ AutoHotkey • (Review) Tutorials for Regular Expression (정규표현식)
  • 3. User Interface (UI) & User Experience (UX)
  • 4. 3 click rule & user navigation model
  • 6. Using Google Sheet in the workflow @ SNUH FM? Ideal 1. One-click, DONE! Reality 1. Open Google Sheet 2. Copy (Ctrl+c) texts from EMR 3. Paste (Ctrl+v) texts into "Input Table" 4. Run calculation in Google Sheet 5. Move to "Output Table" 6. Copy (Ctrl+c) from "Output Table" 7. Paste (Ctrl+v) texts into EMR
  • 9.
  • 10. Window Spy (AutoHotkey Script itself!)
  • 11. AutoHotkey Move to (x-axis, y-axis) & Click
  • 12.
  • 13.
  • 14.
  • 15. mouseclick, left, %x%, %y% !d:: ; Hotkey Alt+d mouseclick, left, 930, 65, 1, 0 Sleep 800 mouseclick, left, 1010, 400, 1, 0 Sleep 800 mouseclick, left, 960, 920, 1, 0 Sleep 800 mouseclick, left, 970, 570, 1, 0 Sleep 800 mouseclick, left, 5, 257, 1, 0 Sleep 1000 mouseclick, left, 1630, 140, 1, 0 return https://github.com/mkim0710/autohotkey/blob/main/BESTCare%202.0%20AutoClick%20Alt%2Bd%20clean%20(SNUBH)%20230107.ahk
  • 18. Send Unicode Left Arrow ← (U+2190) Send chr("0x2192") Send " " . chr("0x2192") . " "
  • 19. Define a hotkey @ AutoHotkey !d:: ; Hotkey Alt+d mouseclick, left, 930, 65, 1, 0 Sleep 800 mouseclick, left, 1010, 400, 1, 0 Sleep 800 mouseclick, left, 960, 920, 1, 0 Sleep 800 mouseclick, left, 970, 570, 1, 0 Sleep 800 mouseclick, left, 5, 257, 1, 0 Sleep 1000 mouseclick, left, 1630, 140, 1, 0 return
  • 20. Define a function @ AutoHotkey function_LeftArrowUnicode(InputText) { Return regexreplace(InputText, "<-", chr("0x2190") ) }
  • 21. EMR lab data @ SNUH EMR Input T4(free)(진검시행) 0.90 1.03 TSH(진검시행) 3.41 3.84 Calcium 9.2 8.9 Phosphorus 3.5 2.9 Glucose 95 102 Uric acid 3.3 3.0 Chol. 171 198 T. Protein 7.2 7.2 Albumin 4.5 4.4 T. Bil. 1.0 1.0 Alk. phos. 46 49 AST(GOT) 24 33 ALT(GPT) 29 47 GGT 32 37 BUN 10 13 Creatinine 0.77 0.73 eGFR(MDRD) 104.9 111.6 eGFR(CKD EPI Cr) 102.2 104.4 TG 270 179 HDL Chol. 36 44 LDL Chol. 87 113 LDL Chol.(계산식) 81 118 hs-CRP 0.03 0.06 WBC 4.71 5.27 Hb 15.3 16.2 Hct 45.5 47.0 MCV 95.0 95.7 Platelet 164 157 ESR 2 5 ANC 2421 2466 Hb A1c 5.2 5.3
  • 22. Regular Expression @ AutoHotkey functionEMR_TSV_AddLeftArrowUnicode(EMR_TSV) { Return regexreplace(EMR_TSV, "(.*)t([0-9]+(?:.[0- 9]*)?).*t([0-9]+(?:.[0-9]*)?).*", "$1`t`t$2`t" " " chr("0x" . "2190") " " "$3") . "`r`n" } ^#!Numpad4:: ; Ctrl+Win+Alt+Numpad4 ; Add ←(U+2190) between the numbers Send ^c Sleep 100 ClipWait 2 ; Waits until the clipboard contains data, up to 2s ClipBoard2Text = %ClipBoard% ; Store %ClipBoard% to ClipBoard2Text - Automatically converted to text without any format?! Sleep 100 ClipWait 2 ; Waits until the clipboard contains data, up to 2s functionCopy2Clipboard2Txt(functionEMR_TSV_AddLeftArr owUnicode(ClipBoard2Text)) VarSetCapacity(ClipBoard2Text, 0) ; Free memory Return https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
  • 23. EMR lab data @ SNUH EMR Input T4(free)(진검시행) 0.90 1.03 TSH(진검시행) 3.41 3.84 Calcium 9.2 8.9 Phosphorus 3.5 2.9 Glucose 95 102 Uric acid 3.3 3.0 Chol. 171 198 T. Protein 7.2 7.2 Albumin 4.5 4.4 T. Bil. 1.0 1.0 Alk. phos. 46 49 AST(GOT) 24 33 ALT(GPT) 29 47 GGT 32 37 BUN 10 13 Creatinine 0.77 0.73 eGFR(MDRD) 104.9 111.6 eGFR(CKD EPI Cr) 102.2 104.4 TG 270 179 HDL Chol. 36 44 LDL Chol. 87 113 LDL Chol.(계산식) 81 118 hs-CRP 0.03 0.06 WBC 4.71 5.27 Hb 15.3 16.2 Hct 45.5 47.0 MCV 95.0 95.7 Platelet 164 157 ESR 2 5 ANC 2421 2466 Hb A1c 5.2 5.3 Output T4(free)(진검시행) 0.90 ← 1.03 TSH(진검시행) 3.41 ← 3.84 Calcium 9.2 ← 8.9 Phosphorus 3.5 ← 2.9 Glucose 95 ← 102 Uric acid 3.3 ← 3.0 Chol. 171 ← 198 T. Protein 7.2 ← 7.2 Albumin 4.5 ← 4.4 T. Bil. 1.0 ← 1.0 Alk. phos. 46 ← 49 AST(GOT) 24 ← 33 ALT(GPT) 29 ← 47 GGT 32 ← 37 BUN 10 ← 13 Creatinine 0.77 ← 0.73 eGFR(MDRD) 104.9 ← 111.6 eGFR(CKD EPI Cr) 102.2 ← 104.4 TG 270 ← 179 HDL Chol. 36 ← 44 LDL Chol. 87 ← 113 LDL Chol.(계산식) 81 ← 118 hs-CRP 0.03 ← 0.06 WBC 4.71 ← 5.27 Hb 15.3 ← 16.2 Hct 45.5 ← 47.0 MCV 95.0 ← 95.7 Platelet 164 ← 157 ESR 2 ← 5 ANC 2421 ← 2466 Hb A1c 5.2 ← 5.3
  • 24. Regular Expression @ AutoHotkey functionFilterLines(TextInput, RegEx2Filter) { TextOutput := regexreplace(TextInput, "(.*" . RegEx2Filter . ".*)|(.)", "$1") TextOutput := TextOutput . "`r`n" TextOutput := regexreplace(TextOutput, "(r?n)+", "`r`n") TextOutput := regexreplace(TextOutput, "^(r?n)+", "") return TextOutput } functionTSV_ExtractColumn3(Input_TSV) { TextOutput := regexreplace(Input_TSV, "([^nrt]*)t([^nrt]*)(?:t([^nrt]*))?", "$3") . "`r`n" Return TextOutput } functionTSV_ExtractColumn4(Input_TSV) { TextOutput := regexreplace(Input_TSV, "([^nrt]*)t([^nrt]*)t([^nrt]*)(?:t([^nrt]*))?", "$4") . "`r`n" Return TextOutput } https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
  • 25. Regular Expression @ AutoHotkey functionProcessText_EMR_TSV4_lipid(Input_TSV) { TextOutput3 := "" TextOutput4 := "" SimpleArray01 := ["`tChol.`t", "TG", "HDL", "LDL Chol.`t"] for index, value in SimpleArray01 { var4search := value TextOutput3 := TextOutput3 . functionTSV_ExtractColumn3(functionFilterLines(Input_TSV, var4search)) . "/" TextOutput3 := functionRemoveCarriageReturn(TextOutput3) TextOutput4 := TextOutput4 . functionTSV_ExtractColumn4(functionFilterLines(Input_TSV, var4search)) . "/" TextOutput4 := functionRemoveCarriageReturn(TextOutput4) } TextOutput3 := regexreplace(TextOutput3, "/$", "") TextOutput4 := regexreplace(TextOutput4, "/$", "") TextOutput := TextOutput3 . " " . chr("0x" . "2190") . " " . TextOutput4 Return TextOutput } ^#l:: ; Ctrl+Win+l Send ^c Sleep 100 ClipWait 2 ClipBoard2Text = %ClipBoard% Sleep 100 ClipWait 2 functionCopy2Clipboard2Txt(functionProcessText_lab(ClipBoard2Text)) ClipWait 2 VarSetCapacity(ClipBoard2Text, 0) ; Free memory Return https://github.com/mkim0710/autohotkey/blob/main/Ctrl%2BWin%2BAlt%2Bc%2C%20Ctrl%2BWin%2Bl%20(LeftArrow)%20SNUBH%20230118.ahk
  • 26. EMR lab data @ SNUH EMR Input T4(free)(진검시행) 0.90 1.03 TSH(진검시행) 3.41 3.84 Calcium 9.2 8.9 Phosphorus 3.5 2.9 Glucose 95 102 Uric acid 3.3 3.0 Chol. 171 198 T. Protein 7.2 7.2 Albumin 4.5 4.4 T. Bil. 1.0 1.0 Alk. phos. 46 49 AST(GOT) 24 33 ALT(GPT) 29 47 GGT 32 37 BUN 10 13 Creatinine 0.77 0.73 eGFR(MDRD) 104.9 111.6 eGFR(CKD EPI Cr) 102.2 104.4 TG 270 179 HDL Chol. 36 44 LDL Chol. 87 113 LDL Chol.(계산식) 81 118 hs-CRP 0.03 0.06 WBC 4.71 5.27 Hb 15.3 16.2 Hct 45.5 47.0 MCV 95.0 95.7 Platelet 164 157 ESR 2 5 ANC 2421 2466 Hb A1c 5.2 5.3 Output TChol/TG/HDL/LDL : 171/270/36/87 ← 198/179/44/113
  • 27. Review Tutorials for Regular Expression (정규표현식)
  • 28. Regular Expressions @ Google Sheets https://support.google.com/a/answer/1371415?hl=en Input Regular Expression Output 1 Abc1234 .?(){} [A-Za-z] A b c 2 Abc1234 .?(){} [A-Za-z]{2} Ab 3 Abc1234 .?(){} [0-9]{2} 12 34 4 Abc1234 .?(){} [0-9]+ 1234 5 Abc1234 .?(){} .{6} Abc123 4 .?( 6 Abc1234 .?(){} . . 7 Abc1234 .?(){} [A-Za-z][0-9]|[0-9]{2} c1 23 8 Abc1234 .?(){} [A-Za-z]?[0-9]{2} c12 34 9 Abc1234 .?(){} [^0-9]* Abc .?(){}
  • 29. Regular Expressions @ Google Sheets Input Regular Expression Output 1 2022-06-03 [0-9]+ 2022 06 03 2 2022-06-03 -[0-9]{2} -06 -03 3 2022-06-03 [0-9]{4}-[0-9]{2}- [0-9]{2} 2022-06-03 4 175 67.5 [0-9]+ 175 67 5 5 175 67.5 [0-9]+.[0-9]* 67.5 6 175 67.5 [0-9]+.?[0-9]* 175 67.5 https://support.google.com/a/answer/1371415?hl=en
  • 30. tbl_input @ Google Sheets Example input table @ SNUHFM HPDP A B C D E 호흡기계 단순 흉부 촬영 (Chest X-Ray) Chest X-Ray 2022-06-03No significant interval change since last study. 신체 측정 복부 지방 CT (Abdominal FAT CT) Abdominal FAT CT 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 근골격계 골밀도 검사 (Dexa Bone Densitometry) Bone Densitometry <T - score> Spine L1 - L4 : - 0.6 Femur neck : - 2.2 Femur total : - 2.6 Osteoporosis https://tinyurl.com/SNUHFMRegEx
  • 31. 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 =regexextract( query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") , "[0-9]{4}-[0-9]{2}-[0-9]{2}" ) 2022-06-03 =query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") Regular Expression @ Google Sheets Extract dates [0-9]{4}-[0-9]{2}-[0-9]{2}
  • 32. 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 =regexreplace( regexextract( query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") , "[0-9]{4}-[0-9]{2}-[0-9]{2}" ) ,"-" ,"." ) 2022.06.08 =query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") Regular Expression @ Google Sheets Extract dates [0-9]{4}-[0-9]{2}-[0-9]{2}
  • 33. 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 =regexextract( query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") , "= *[0-9]+.?[0-9]*/" ) = 7051.11/ =query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") Regular Expression @ Google Sheets Extract visceral adipose tissue (VAT) = *[0-9]+.?[0-9]*/
  • 34. 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 =regexreplace( regexreplace( regexextract( query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") , "= *[0-9]+.?[0-9]*/" ) ,"= *" ,"" ) ,"/" ,"" ) 7051.11 =query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") Regular Expression @ Google Sheets Extract visceral adipose tissue (VAT) = *[0-9]+.?[0-9]*/
  • 35. 2022-06-03Fat amount ratio = Visceral fat/Subcutaneous fat = 7051.11/7723.56 = 0.91 =round(value( regexreplace( regexreplace( regexextract( query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") , "= *[0-9]+.?[0-9]*/" ) ,"= *" ,"" ) ,"/" ,"" ) )) / 100 &" cm²" 70.51 cm² =query(tbl_input!$A:$E, "select E where C contains 'Abdominal FAT CT'") Regular Expression @ Google Sheets Extract visceral adipose tissue (VAT) = *[0-9]+.?[0-9]*/
  • 36. <T - score> Spine L1 - L4 : - 0.6 Femur neck : - 2.2 Femur total : - 2.6 Osteoporosis =regexextract(query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'"),"[Oo]steop[a-z]+") Osteoporosis =query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'") Regular Expression @ Google Sheets Extract Dual Energy X-ray Absorptiometry (DEXA) results [Oo]steop[a-z]+
  • 37. <T - score> Spine L1 - L4 : - 0.6 Femur neck : - 2.2 Femur total : - 2.6 Osteoporosis =regexextract(query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'"),"[Oo]steop[a-z]+") &"("&regexextract(query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'"),"[Ll][1-4] *- *[Ll][1-4] *: *- [0-9]+.?[0-9]*") &", "&regexextract(query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'"),"[Ff]emur [Nn]eck *: *- [0-9]+.?[0-9]*") &", "&regexextract(query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'"),"[Ff]emur [Tt]otal *: *- [0-9]+.?[0-9]*")&")" Osteoporosis(L1 - L4 : - 0.6, Femur neck : - 2.2, Femur total : - 2.6) =query(tbl_input!$A:$E, "select E where C contains 'Bone Densitometry'") Regular Expression @ Google Sheets Extract Dual Energy X-ray Absorptiometry (DEXA) results [Oo]steop[a-z]+