-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path04_Using-Schemas.toml
More file actions
163 lines (143 loc) · 5.85 KB
/
04_Using-Schemas.toml
File metadata and controls
163 lines (143 loc) · 5.85 KB
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
[METADATA]
version = 0.1
description = "A sample prompt for RadPrompter"
[PROMPTS]
system_prompt = "You are a helpful assistant that has 20 years of experience in reading radiology reports and extracting data elements."
user_prompt_intro = "{{intro_prompt}}\n"
user_prompt_no_cot = """
I want you to extract the following data element from the report:
{{variable_name}}:
{{hint}}
Provide a single answer:
"""
[CONSTRUCTOR]
system = "rdp(system_prompt)"
user = [
"rdp(user_prompt_intro + user_prompt_no_cot)"
]
[SCHEMAS]
[SCHEMAS.PulmonaryEmbolism]
variable_name = "Pulmonary Embolism"
intro_prompt = """
Carefully review the provided chest CT report (in the <report> tag). Ensure that each data element is accurately captured.
Here is the report:
<report>
{{report}}
</report>
Please pay attention to the following details:
- Your attention to detail is crucial for maintaining the integrity of the medical records.
- You should not confabulate information, and if something is not mentioned, you should assume that it is `Absent` unless otherwise stated.
- The report may contain additional information that is not relevant to the requested data elements. Please ignore that information.
- We are interested at findings at the time of scan, not the previous ones, so only consider the impression and findings sections of the report.
- Do not print anything else other than the provided output format.
"""
type = "select"
options = ["Present", "Absent"]
show_options_in_hint = true
hint = """
Indicate `Present` if the report explicitly mentions the patient has pulmonary embolism in their CT scan.
Indicate `Absent` if pulmonary embolism is not seen or if a previously observed pulmonary embolism is mentioned as resolved.
"""
[SCHEMAS.PatientAge]
variable_name = "Patient Age"
intro_prompt = ""
type = "int"
show_options_in_hint = false
hint = """
Extract the patient's age in years from the report. If age is not explicitly mentioned, respond with -1.
Provide only the numerical value (e.g., 65).
"""
[SCHEMAS.LesionSize]
variable_name = "Largest Lesion Size"
intro_prompt = ""
type = "float"
show_options_in_hint = false
hint = """
Extract the size of the largest lesion mentioned in the report in centimeters.
If multiple dimensions are given, use the largest dimension.
If no lesion size is mentioned, respond with -1.0.
Provide only the numerical value (e.g., 2.5).
"""
[SCHEMAS.ClinicalImpression]
variable_name = "Clinical Impression"
intro_prompt = ""
type = "string"
show_options_in_hint = false
hint = """
Extract the main clinical impression or conclusion from the report.
Provide the exact text from the impression section, or summarize the key findings if no explicit impression is stated.
If no clear impression is available, respond with "Not specified".
"""
[SCHEMAS.NumberOfEmboli]
variable_name = "Number of Pulmonary Emboli"
intro_prompt = ""
type = "int"
show_options_in_hint = false
hint = """
Count the number of pulmonary emboli explicitly mentioned in the report.
If the report mentions "multiple" without a specific count, respond with -1.
If no emboli are present, respond with 0.
Provide only the numerical count.
"""
[SCHEMAS.Left]
variable_name = "Left-sided Pulmonary Embolism"
intro_prompt = ""
type = "select"
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report explicitly mentions the patient has a left-sided pulmonary embolism in their CT scan.
Indicate `Yes` if the report explicitly mentions the patient has a bilateral pulmonary embolism in their CT scan or if patient has both left and right sided pulmonary embolism.
Indicate `No` if the report doesn't explicitly mentions the patient has a left-sided or bilateral pulmonary embolism in their CT scan.
"""
[SCHEMAS.Right]
variable_name = "Right-sided Pulmonary Embolism"
type = "select"
intro_prompt = ""
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report explicitly mentions the patient has a right-sided pulmonary embolism in their CT scan.
Indicate `Yes` if the report explicitly mentions the patient has a bilateral pulmonary embolism in their CT scan or if patient has both left and right sided pulmonary embolism.
Indicate `No` if the report doesn't explicitly mentions the patient has a right-sided or bilateral pulmonary embolism in their CT scan.
"""
[SCHEMAS.Acute]
variable_name = "Acute Pulmonary Embolism"
type = "select"
intro_prompt = ""
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report explicitly mentions the patient has an acute pulmonary embolism in their CT scan.
Indicate `No` if the report doesn't explicitly mentions the patient has an acute pulmonary embolism in their CT scan.
"""
[SCHEMAS.Chronic]
variable_name = "Chronic Pulmonary Embolism"
type = "select"
intro_prompt = ""
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report explicitly mentions the patient has an chronic pulmonary embolism in their CT scan.
Indicate `No` if the report doesn't explicitly mentions the patient has an chronic pulmonary embolism in their CT scan.
"""
[SCHEMAS.RightHeartStrain]
variable_name = "Right Heart Strain"
type = "select"
intro_prompt = ""
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report does explicitly mentions that the patient has a right heart strain in their CT scan.
Indicate `No` if the report doesn't explicitly mentions that the patient has a right heart strain in their CT scan.
"""
[SCHEMAS.PulmonaryArteryHypertension]
variable_name = "Pulmonary Artery Hypertension"
type = "select"
intro_prompt = ""
options = ["Yes", "No"]
show_options_in_hint = true
hint = """
Indicate `Yes` if the report does explicitly mentions that the patient has a pulmonary artery hypertension in their CT scan.
Indicate `No` if the report doesn't explicitly mentions that the patient has a pulmonary artery hypertension in their CT scan.
"""