Ali2206 commited on
Commit
769cea3
·
verified ·
1 Parent(s): 1de8c2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -122,17 +122,17 @@ def generate_analysis_prompt(patient_data: Dict[str, Any], booking: str) -> str:
122
  latest = max((e for e in entries if e['booking'] == booking), key=lambda x: x['date'])
123
  current_diags.append(f"- {diag}: {latest['response']} (as of {latest['date']})")
124
 
125
- prompt = f"""
126
  **Comprehensive Patient Analysis - Booking {booking}**
127
 
128
  **Patient Timeline:**
129
  {timeline}
130
 
131
  **Current Medications:**
132
- {'\n'.join(current_meds) if current_meds else "None recorded"}
133
 
134
  **Current Diagnoses:**
135
- {'\n'.join(current_diags) if current_diags else "None recorded"}
136
 
137
  **Analysis Instructions:**
138
  1. Review the patient's complete history across all visits
@@ -157,7 +157,12 @@ def generate_analysis_prompt(patient_data: Dict[str, Any], booking: str) -> str:
157
 
158
  ### Doctor Consistency
159
  [Discrepancies between different providers]
160
- """
 
 
 
 
 
161
  return prompt
162
 
163
  def chunk_patient_data(patient_data: Dict[str, Any]) -> List[Dict[str, Any]]:
@@ -324,7 +329,7 @@ def create_ui(agent):
324
  summary_prompt = """
325
  **Comprehensive Patient Summary**
326
 
327
- Analyze all bookings ({bookings_processed} total) to identify:
328
  1. Patterns across the entire treatment history
329
  2. Chronic issues that may have been missed
330
  3. Medication changes over time
@@ -343,7 +348,7 @@ Analyze all bookings ({bookings_processed} total) to identify:
343
 
344
  ### Comprehensive Recommendations
345
  [Overall care plan]
346
- """.format(bookings_processed=bookings_processed)
347
  summary = analyze_with_agent(agent, summary_prompt)
348
  full_report.append(f"## Overall Patient Summary\n{summary}\n")
349
 
 
122
  latest = max((e for e in entries if e['booking'] == booking), key=lambda x: x['date'])
123
  current_diags.append(f"- {diag}: {latest['response']} (as of {latest['date']})")
124
 
125
+ prompt = """
126
  **Comprehensive Patient Analysis - Booking {booking}**
127
 
128
  **Patient Timeline:**
129
  {timeline}
130
 
131
  **Current Medications:**
132
+ {meds}
133
 
134
  **Current Diagnoses:**
135
+ {diags}
136
 
137
  **Analysis Instructions:**
138
  1. Review the patient's complete history across all visits
 
157
 
158
  ### Doctor Consistency
159
  [Discrepancies between different providers]
160
+ """.format(
161
+ booking=booking,
162
+ timeline=timeline,
163
+ meds='\n'.join(current_meds) if current_meds else "None recorded",
164
+ diags='\n'.join(current_diags) if current_diags else "None recorded"
165
+ )
166
  return prompt
167
 
168
  def chunk_patient_data(patient_data: Dict[str, Any]) -> List[Dict[str, Any]]:
 
329
  summary_prompt = """
330
  **Comprehensive Patient Summary**
331
 
332
+ Analyze all bookings ({0} total) to identify:
333
  1. Patterns across the entire treatment history
334
  2. Chronic issues that may have been missed
335
  3. Medication changes over time
 
348
 
349
  ### Comprehensive Recommendations
350
  [Overall care plan]
351
+ """.format(bookings_processed)
352
  summary = analyze_with_agent(agent, summary_prompt)
353
  full_report.append(f"## Overall Patient Summary\n{summary}\n")
354