-
Notifications
You must be signed in to change notification settings - Fork 0
/
digipres.qmd
603 lines (419 loc) · 15.8 KB
/
digipres.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
---
title: "Empowering Medical Professionals"
subtitle: "Leveraging GPT Models for Informatics Solutions"
author: "Christopher Snyder, MD, PhD"
date: "2024-10-02"
slide-number: true
format:
revealjs:
scrollable: true
theme: solarized
preview-links: true
css: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css
include-in-header:
- text: |
<link href="https://cdn.jsdelivr.net/npm/@jupyter-widgets/[email protected]/dist/embed-amd.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@jupyter-widgets/[email protected]/dist/embed-amd.js"></script>
jupyter: python3
execute:
freeze: auto
enabled: true
cache: false
---
<style>
.blue {
color: blue;
}
</style>
<style>
.yellow {
color: yellow;
}
</style>
<!-- stock themes
[default, beige, blood, dark, league, moon, night, serif, simple, sky, solarized] -->
<!-- # ipynb-shell-interactivity: all -->
## Financial Diclosures
I have no financial disclosures and no conflicts of interest to declare.
## AI Hootenanny
::::: columns
::: {.column width="50%"}
### Pervasive Hype
- focus is on heralding future innovation
- my Natural Language Processing(NLP) professor around 2018 lamented that his work seems to follow him home in the news
- will reshape our daily lives - similar to industrial revolution - eventually reaches "Singularity" - potential to "transform healthcare"
:::
::: {.column width="50%"}
### Sparse Real-World Problem Solving
- "in the wild" either doesn't happen or isn't talked about
- [**Can anyone think of any examples where AI could *maybe* be applied?**]{ .blue}
:::
:::::
## Like Most Prophecies, 'AI Forcasts' are Hardly Actionable
- What should I do?
- When should I do it?
::: {.notes}
what constitutes an adaptive response
depends on your assesment of Two Variables
:::
## A Timeline for AI
::: {.r-stack}
![](src/intro/ai-hype01_boombust.jpg){.fragment .fade-in-then-out}
![](src/intro/ai-hype02_nextbigthing.jpg){.fragment .fade-in-then-out}
![](src/intro/ss-punnet-fragile0.png){.fragment .fade-in-then-out}
![](src/intro/ss-punnet-fragile1.png){.fragment .fade-in-then-out}
![](src/intro/ai-hype03_colorfultimeline.png){.fragment .fade-in-then-out}
:::
## Objectives
1. Formative experience applying AI to pathology call
2. Why AI will let anyone do informatics
3. Demos applying AI to problems from real-world resident tenure
4. Classification System for AI application
5. A few suggestions about the future
<!--
### outline
1. Outline the mechanisms by which AI adapts and accelerates real world workflows *today* (from my tenor as a pathology resident)
2. Explain conceptually: how to anticipate when AI will be useful to apply to a particualr circumstance.
3. Demonstrate "hands-off" informatics implementation of AI solutions, also made possible by AI.
4. Give a Theoretical Basis: why proficiency in ai-tools (in-principle) should be (a) empowering and (b) eventually universal, vis-a-vis literacy
5. Introduce Diagramatically a classification system for AI-Application facilitating computer-tasks.
6. Automate Call Log Entry via an AI Application. <!-- - entry of call metadata into the pathology resident call-log form from simulated call audio. -->
::: { .smaller .indent=2em}
- if time, show how an AI agent can be used to append, modify, save, query, analyze past log-entries.
- if time, show easy integration with downstream informatic-endpoints e.g. email notification for impending sample expiration, ai entry summarization and report generation. -->
## Calibrating Perceptions of Informatics: *a prerequisite to discussing change*
::::: columns
::: {.column width="50%"}
#### What is Informatics to *You*
- baseline *status quo ante* AI
- perceptions vary
:::
::: {.column width="50%"}
<img src="src/intro/aram-mojtabai-hacking.gif" alt="Hacking GIF" style="width:100%;max-width:100%;"/><p style="margin-top:10px;font-weight:bold;">
honest impressions, 2012
</p>
:::
:::::
::: notes
Truth -No one ever gets dramatically more efficient than a beginner Truth- No one is naturally advantaged or inclined. Informatics is naturally inclusive
:::
## Informatics is Hard for Everyone
Always has been
<!-- , \[~~Always will be~~\] -->
<!-- ![](src/intro/xkcd_terminal.webp){width="50%" max-width="50%"} -->
#### **the terminal**
- intimidating, unforgiving, powerful
##### Previous approach
```{bash}
tar -czvf file.tar.gz mydata.csv
```
##### AI aided approach
```{bash}
gh copilot suggest "please compress my file with `tar` command
Use the most common, generic approach.
You know what I want...Just do the thing, please."
```
## Gene Panels, Spot the Difference
![](src/gene-panels-03.png){width="30%"}
![](src/gene-panels-02.png){.r-stretch}
## Gene Panels, Spot the Difference
::::: columns
::: {.column width="25%"}
[chatgpt thread](https://chatgpt.com/share/66f2e625-ab44-8005-a883-686a92017a51)
:::
::: {.column width="75%"}
![](src/gene-panels-01.png)
:::
:::::
## "Just Autocomplete"
#### [A Slippery Slope]{style="color: blue;"}
| | |
|----|----|
| **Text** Autocomplete | -> next word |
| **Language** Translation | <X> in Spanish would be -> |
| **Information** Transformation | \- data representation \<-\> (img, txt, code.py) |
| | -> board material -> podcast discussing it |
| **Instruction** Implementation | goal -> code achieving goal |
# WUSTL Weekly Biogram Report Analysis
data from <https://diorama.wustl.edu/weekly-report>
## Weekly WUSTL Biogram
![](src/biogram-01.png)
## LLM-Driven Data Slicing (1/3)
![](src/biogram-alldata.png)
## LLM-Driven Slicing (2/3)
![](src/biogram-justviruses.png)
## LLM-Driven Slicing (3/3)
![](src/biogram-gettingworse.png)
## LLM-Driven Data (?)Dicing
![](src/biogram-piegraph.png)
# Intermission
<!-- ## Progress Outline
- [x] Introduction to "Computers that Know What You Mean"
- [ ] Why would anyone want to "talk to computers"?
- [ ] Overview of current tools and methologies
- [ ] Example walkthrough of a simple informatics task
- [ ] Recommendations for leveraging this and future transformative technologies -->
# Why Should I Talk to Computers? How is that empowering?
## Communication Critical for Humans
::::: columns
::: {.column width="50%"}
- Children Universally Geared toward learning language
- Why?
- tool for learning
- exploring feasibility
- coordinating resources
- accomplishing goals
:::
::: {.column width="50%"}
![Charlie \~ 6 weeks](src/language/charlie01.png)
:::
:::::
## Communication Critical in the Workplace
::::: columns
::: {.column width="50%"}
- Doctors - Patient Bedside <!-- - Describing symptoms --> <!-- - Understanding treatment options -->
- Multi-Diciplinary Care Teams <!-- - Discussing prognosis --> <!-- - Coordinating care -->
- Blood Bank <!-- - Requires >1 person -->
:::
::: {.column width="50%"}
<!-- ![](src/language/meeting.webp) -->
![](src/language/meeting_skinny.png)
:::
:::::
## Communication is Empowering
|
|
<!-- |--------------------|------------------------| -->
| Benefit | Communication Example |
|----|----|
| Economies of Scope | \- enlisting adults<br>- Multi-disciplinary <br>[ - **learning from data**]{.fragment fragment-index="1"} |
| Economies of Scale | \- cooperation <br>- minimum staffing, redundancy <br>[ - **automating tasks**]{.fragment fragment-index="1"} |
## AI: Key to Efficiency
- By lowering the barrier working with computers, and by expanding the pool of practitioners who can do so...
- AI most likely **will remove essentially all present operational inefficiencies** of today
- everything is worth the squeeze when you have a juicer
## AI-Informatic Approaches
0. task to code (by hand)
1. task as prompt
2. task to code
3. code as prompt
![](src/tools/aitools-flowchart-byhand.png){width="100%"}
## AI-Informatic Approaches
0. task to code (by hand)
- tedious, "too literal": always requires 100% specification
1. task as prompt
- easy, difficult to specify what you mean precisely enough
2. task to code
- Can jumpstart coding, modifying easier than writing
3. code as prompt
- sweet spot: clearly specifies what you want the output to "look like" while leaving the details to the model
## UDS Parse {.scrollable}
#### Task: parse UDS screen results for positive patient+drugs resulted
<!-- [uds_notebook](http://localhost:8888/doc/tree/drugscreen_result_parsing.ipynb){preview-links=true} -->
[uds_notebook](file:///Users/christophersnyder/Projects/digital-path-talk-2024/uds_parse/drugscreen_result_parsing.html){preview-links="true"}
SCREEN_RESULT_COMMENT
"The following compounds were detected:
Tetrahydrocannabinol (THC)
Repeated and verified. Medical Director review to follow." "The following compounds were detected:
Tetrahydrocannabinol (THC)
Repeated and verified. Medical Director review to follow."
"The following compounds were detected:\
Benzoylecgonine (BEG) Fentanyl Tramadol O-Desmethyl tramadol Repeated and verified. Medical Director review to follow."
"The following compounds were detected:
Amphetamine Methamphetamine Alprazolam (Xanax) Lorazepam-glucuronide
Repeated and verified. Medical Director review to follow."
"The following compounds were detected:
Morphine Morphine-3-glucuronide Fentanyl
Repeated and verified. Medical Director review to follow." "The following compounds were detected:
Tetrahydrocannabinol (THC),
Repeated and verified. Medical Director review to follow." "The following compounds were detected:
Oxycodone,
Repeated and verified. Medical Director review to follow."
"The following compounds were detected:
Amphetamine
Methamphetamine . . .
## 1. Task as Prompt
::::: columns
::: {.column width="50%"}
- try [chatgpt](https://chatgpt.com/share/66faa53f-91fc-8005-b9a6-243465db3d1d) directly
- clearly feasible
- difficult to specify what I mean precisely enough
:::
::: {.column width="50%"}
![caption: screenshot of thread with chatgpt](src/tools/uds-chatgpt-01.png)
:::
:::::
## 0. Task to Code (by hand)
<!-- ```{python} -->
#### code to parse UDS screen results for positive patient+drugs
``` {.python code-line-numbers="3-5|11|1-100"}
def parse_section(section: str) -> list[str]:
"""Parses a section of the screen result for detected compounds."""
start = section.find("detected:")
end = section.rfind("Repeated")
lines = section[start + len("detected:") : end].strip().split("\n")
compounds = [l.strip() for l in lines if l.strip()]
return compounds
results_file = Path( "screen_result.txt" )
result_text = results_file.read_text()
sections = result_text.split('"')[1::2]
parsed_sections = [parse_section(section) for section in sections]
print(*parsed_sections, sep='\n--------------------\n')
```
#### !"overly specific", hyper granular, brittle
``` {.text .scrollable}
['Tetrahydrocannabinol (THC)']
--------------------
['Tetrahydrocannabinol (THC)']
--------------------
['Benzoylecgonine (BEG)', 'Fentanyl', 'Tramadol', 'O-Desmethyl tramadol']
--------------------
['Amphetamine', 'Methamphetamine', 'Alprazolam (Xanax)', 'Lorazepam-glucuronide']
--------------------
['Morphine', 'Morphine-3-glucuronide', 'Fentanyl']
--------------------
['Tetrahydrocannabinol (THC),']
--------------------
['Oxycodone,']
--------------------
['Amphetamine', 'Methamphetamine']
--------------------
['Amphetamine', 'Methamphetamine']
--------------------
['Cocaine', 'Benzoylecgonine (BEG)', 'Fentanyl', 'Ketamine']
--------------------
['Nordiazepam,']
--------------------
['Oxycodone', 'Lorazepam-glucuronide', 'Tetrahydrocannabinol (THC)', 'Fentanyl']
--------------------
['Methadone', 'Fentanyl']
--------------------
['Tetrahydrocannabinol (THC)', 'Fentanyl']
--------------------
['Tetrahydrocannabinol (THC)']
--------------------
['Hydrocodone']
--------------------
['Oxycodone']
--------------------
['Methadone,', 'EDDP (Methadone Metabolite),', 'Fentanyl,']
--------------------
['Tetrahydrocannabinol (THC),']
--------------------
['Amphetamine,']
--------------------
['Benzoylecgonine (BEG)', 'Tetrahydrocannabinol (THC)']
--------------------
['Methadone', 'EDDP (Methadone Metabolite)', 'Fentanyl']
--------------------
['Tetrahydrocannabinol (THC)', 'Oxycodone', 'Hydrocodone']
--------------------
['Methadone', 'EDDP (Methadone Metabolite)', 'Bupropion', 'Hydroxy-bupropion']
--------------------
['Tetrahydrocannabinol (THC)']
--------------------
['owing compounds were detected', 'Tetrahydrocannabinol (THC)']
--------------------
['7-aminoclonazepam']
--------------------
['Amphetamine,', 'Methamphetamine,', 'Tetrahydrocannabinol (THC),', 'Oxycodone']
--------------------
['Methamphetamine']
--------------------
['Amphetamine,', 'Methamphetamine,', 'Morphine,', 'Morphine-3-glucuronide']
--------------------
['Amphetamine']
--------------------
['Venlafaxine(Effexor)']
--------------------
['Cocaine,', 'Benzoylecgonine (BEG),', 'Oxycodone,', 'Fentanyl']
--------------------
['Benzoylecgonine (BEG),', 'Tetrahydrocannabinol (THC),', 'Methadone,', 'EDDP (Methadone Metabolite),', 'Fentanyl']
--------------------
['Amphetamine,', 'Methamphetamine']
--------------------
['Amphetamine,', 'Methamphetamine']
--------------------
['Lorazepam-glucuronide.']
--------------------
['Benzoylecgonine (BEG)']
--------------------
['Lorazepam-glucuronide.']
--------------------
['Methylphenidate (Ritalin)']
--------------------
['Lorazepam-glucuronide.']
--------------------
['Clonidine']
--------------------
['Tetrahydrocannabinol (THC)', 'Norbuprenorphine']
--------------------
['7-aminoclonazepam']
```
## 2. Task to Code
uds_parse/drugscreen_result_parsing.ipynb
![](src/tools/uds-chatgpt-code-02b.png)
[chatgpt uds task -> code](https://chatgpt.com/c/66faa511-42c4-8005-86c0-ae32a866b1b3){preview-link="true" style="text-align: center"}
## 3. Code as Prompt
![Coding without Rigid Rules](src/tools/uds-marvin-03.png)
# Suggestions
## "low hanging fruit" for AI application
- Flow lab dashboard
- make "pull" processes "push" processes
- Txfsn Service AI Assistant for inpatient
- logging, updating, retrieving, summarizing log info
- "Jarvis-like" interface
- addtl functions:
- notifications
- auto rounds printouts
<!-- ## Pursuit Angle -->
## Scales of Leadership {.smaller}
::::: columns
::: {.column width="33%"}
### Tactical
- update specific lectures
- ai elective
:::
::: {.column width="33%"}
### Operational
- gpt-api part of onboarding
- safe environment for prototyping and learning
- incentivize process improvement
:::
::: {.column width="33%"}
### Grand-Strategic
- what mentality or philosophy is most adaptive in the long-term?
<!-- - How to cope with change that is accelerating? -->
<!-- - What short term targets keep us relevant in the long-term? -->
:::
:::::
## trivia call-back
<!-- ["Beast Mode"](src/pusuit_angle/BeastQuake720p.mp4) -->
<video width="100%" height="auto" controls>
<source src="src/pusuit_angle/BeastQuake720p.mp4" type="video/mp4">
Your browser does not support the video tag. </video>
##
![](src/pusuit_angle/ss_before.png)
##
![](src/pusuit_angle/ss_after.png)
##
![](src/pusuit_angle/ss_directly-chasing-the-ball.png)
##
![](src/pusuit_angle/ss_slower-adopters-must-plan-farther-ahead.png)
## Gist
* We should prepare for the future like it’s already here. And, by the time we are ready, it will be.
* It is exactly because medicine will have the most obstacles to AI adoption that we need to plan the farthest ahead.
* Each *future* barrier to adoption makes less relevant the *present* technical limitations of AI
## on free time
#### The rate of return on an investment of your time is perhaps the highest ever
![](src/conclusion/xkcd_11th_grade.png)
## Final Remarks
|
|
### AI - The Peripheral Nervous System of the Laboratory
- AI removes friction in informed decision making
- ease of information content appreciation
- more contextualized and timely process adaptation
- decisions only as informed as access to information
- most data not perceptible to the 5 senses
## Thank you!