Update app.py
Browse files
app.py
CHANGED
@@ -160,16 +160,38 @@ def create_ui(agent):
|
|
160 |
extracted = "\n".join(results)
|
161 |
file_hash_value = file_hash(files[0].name) if files else ""
|
162 |
|
163 |
-
prompt = f"""
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
{extracted[:12000]}
|
170 |
-
|
|
|
|
|
171 |
"""
|
172 |
|
|
|
173 |
try:
|
174 |
if history and history[-1]["content"].startswith("⏳"):
|
175 |
history.pop()
|
|
|
160 |
extracted = "\n".join(results)
|
161 |
file_hash_value = file_hash(files[0].name) if files else ""
|
162 |
|
163 |
+
prompt = f"""
|
164 |
+
You are a clinical reasoning assistant. Analyze the following medical records with a focus on identifying potential clinical oversights. Your task is to provide a comprehensive and structured summary addressing the following:
|
165 |
+
|
166 |
+
1. **Potential Missed Diagnoses**:
|
167 |
+
- Consider any contradictory or missing evidence regarding the patient’s history, symptoms, or test results.
|
168 |
+
- Take into account psychiatric, neurological, infectious, autoimmune, and genetic conditions.
|
169 |
+
- Consider family history, trauma history, and childhood developmental information.
|
170 |
+
|
171 |
+
2. **Flagged Medication Conflicts**:
|
172 |
+
- Cross-check all prescribed medications for contraindications, interactions, or off-label use without justification.
|
173 |
+
- Verify if any medications may worsen known diagnoses or contribute to adverse effects.
|
174 |
+
|
175 |
+
3. **Incomplete or Missing Assessments**:
|
176 |
+
- Identify any domains of assessment that are completely missing or only superficially addressed (e.g., cognitive, psychiatric, social, family).
|
177 |
+
- Point out gaps in documentation of prior medical history, substance use, or lab/imaging results.
|
178 |
+
|
179 |
+
4. **Abnormal Results Needing Urgent Follow-up**:
|
180 |
+
- Extract and highlight lab results, imaging, behavioral observations, or legal history that warrant immediate reassessment or specialist referral.
|
181 |
+
|
182 |
+
Make the answer precise, evidence-based, and structured clearly under each heading. Avoid repeating input and remove tool-call formatting.
|
183 |
+
|
184 |
+
---
|
185 |
+
|
186 |
+
Medical Records Input (Truncated to 12k chars):
|
187 |
+
|
188 |
{extracted[:12000]}
|
189 |
+
|
190 |
+
---
|
191 |
+
Begin your analysis below:
|
192 |
"""
|
193 |
|
194 |
+
|
195 |
try:
|
196 |
if history and history[-1]["content"].startswith("⏳"):
|
197 |
history.pop()
|