liammatt5 commited on
Commit
e7b09cd
·
verified ·
1 Parent(s): 0dd8145

Update gnn.py

Browse files
Files changed (1) hide show
  1. gnn.py +11 -1
gnn.py CHANGED
@@ -434,6 +434,8 @@ class EnhancedPatientStateManager(PatientStateManager):
434
  pdata = self.patient_data.get(patient_id, {})
435
  if pdata.get("breathing_rate_history"):
436
  base_state["breathing_rate_mean"] = float(statistics.mean(pdata["breathing_rate_history"]))
 
 
437
  else:
438
  base_state["breathing_rate_mean"] = None
439
 
@@ -454,7 +456,15 @@ class EnhancedPatientStateManager(PatientStateManager):
454
  clinical["clinical_summary"] = " | ".join(summary_parts) if summary_parts else "No significant abnormalities detected"
455
 
456
  base_state["clinical_assessment"] = clinical
457
- base_state["comment"] = clinical.get("clinical_summary", "Establishing baseline...")
 
 
 
 
 
 
 
 
458
  return base_state
459
 
460
 
 
434
  pdata = self.patient_data.get(patient_id, {})
435
  if pdata.get("breathing_rate_history"):
436
  base_state["breathing_rate_mean"] = float(statistics.mean(pdata["breathing_rate_history"]))
437
+ elif breathing_rate is not None and breathing_rate > 0:
438
+ base_state["breathing_rate_mean"] = breathing_rate
439
  else:
440
  base_state["breathing_rate_mean"] = None
441
 
 
456
  clinical["clinical_summary"] = " | ".join(summary_parts) if summary_parts else "No significant abnormalities detected"
457
 
458
  base_state["clinical_assessment"] = clinical
459
+
460
+ overall_status = clinical.get("overall_clinical_status", "green")
461
+ if overall_status == "red":
462
+ base_state["comment"] = "RED - patient requires clinical review."
463
+ elif overall_status == "orange":
464
+ base_state["comment"] = "ORANGE - patient warrants clinical attention."
465
+ else:
466
+ base_state["comment"] = "GREEN - no immediate attention required."
467
+
468
  return base_state
469
 
470