You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Adjust the style and level of clinical detail based on the 'writing_style': "
143
+
"- Draft: Use minimal structure, brief statements, and omit some details; clinical indicators may be less clear. "
144
+
"- Adequate: Use complete sentences, include all relevant clinical indicators, but avoid excessive detail. "
145
+
"- Polished: Be thorough, precise, and clear; include nuanced or subtle signs and show strong clinical reasoning. "
146
+
"Also, adjust level of detail based on urgency (ESI 1 is always brief). "
147
+
"Respond with ONLY the note text, starting with 'CC:'."
148
+
),
149
+
model_alias=model_alias_generator,
150
+
)
151
+
)
152
+
153
+
# Rubric: clinical coherence
154
+
clinical_coherence_rubric=Score(
155
+
name="Clinical Coherence",
156
+
description="Evaluates how well the clinical details in the triage note align with the assigned ESI level and scenario.",
157
+
options={
158
+
"5": "Note is perfectly aligned with the ESI level and scenario; details are clinically plausible and specific.",
159
+
"4": "Note is well-aligned, with only minor details that might be slightly inconsistent.",
160
+
"3": "Note is generally consistent, but some key clinical indicators are missing or don't fully match the ESI level.",
161
+
"2": "Note shows significant inconsistency between the clinical details and the assigned ESI level.",
162
+
"1": "Note is clinically incoherent and does not reflect the assigned ESI level or scenario at all."
163
+
}
164
+
)
165
+
166
+
# Rubric: ESI level complexity (reduced to 3 levels: Simple, Moderate, Complex)
167
+
esi_level_complexity_rubric=Score(
168
+
name="ESI Level Complexity",
169
+
description="Evaluates how difficult it is to infer the correct ESI level from the note. Higher scores indicate greater complexity, which is desirable for creating a challenging dataset.",
170
+
options={
171
+
"Complex": "Note contains subtle or conflicting information, requiring clinical reasoning to distinguish between ESI levels.",
172
+
"Moderate": "Note requires some clinical inference; indicators are present but not always immediately obvious.",
173
+
"Simple": "Note uses clear, direct, or textbook indicators that make the ESI level obvious."
174
+
}
175
+
)
176
+
177
+
jsonl_entry_template= {
178
+
"messages": [
179
+
{
180
+
"role": "system",
181
+
"content": (
182
+
"You are an expert ER triage nurse. Your task is to classify the following triage note into one of the five Emergency Severity Index (ESI) levels."
183
+
f" The possible levels are: {', '.join([repr(level) forlevelinESI_LEVELS])}."
184
+
" Carefully analyze the clinical details in the triage note, focusing on patient acuity, resource needs, and risk of rapid deterioration."
185
+
" Respond with only the selected ESI level description, exactly matching one of the listed possibilities. Do not provide extra text or explanation."
186
+
)
187
+
},
188
+
{
189
+
"role": "user",
190
+
"content": (
191
+
"Triage Note: {{ content }}\n"
192
+
"Classify the ESI level for this note based on the provided definitions."
193
+
" Respond in JSON format only: { \"esi_level_description\": \"...\" }"
0 commit comments