Cardiosense-AG commited on
Commit
ea20ae2
·
verified ·
1 Parent(s): 19b9d1d

Update pages/02_Workflow_UI.py

Browse files
Files changed (1) hide show
  1. pages/02_Workflow_UI.py +30 -0
pages/02_Workflow_UI.py CHANGED
@@ -177,6 +177,36 @@ if not items:
177
  st.error("No cases available.")
178
  st.stop()
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  # Keep selection stable in session
181
  default_case_id = st.session_state.get("_current_case_id") or items[0]["case_id"]
182
  opt_by_id = {i["case_id"]: i for i in items}
 
177
  st.error("No cases available.")
178
  st.stop()
179
 
180
+ # --- Optional: create a new case for ad hoc testing ---
181
+ if st.button("➕ New Case", use_container_width=True):
182
+ # Generate a new unique case ID
183
+ new_id = store.new_case_id()
184
+ store.create_case({
185
+ "case_id": new_id,
186
+ "status": "draft",
187
+ "patient": {"name": "New Patient", "age": None, "sex": ""},
188
+ "consult": {
189
+ "specialty": "Cardiology",
190
+ "question": "",
191
+ "history": "",
192
+ "medications": "",
193
+ "labs": "",
194
+ "consent_obtained": False,
195
+ },
196
+ "soap_draft": {
197
+ "subjective": "",
198
+ "objective": "",
199
+ "assessment": "",
200
+ "plan": "",
201
+ },
202
+ "billing": {"minutes": 5, "spoke": False, "cpt_code": None, "attested": False},
203
+ "explainability": {"manually_modified": False},
204
+ })
205
+ st.success(f"Created new case {new_id}. Refreshing list…")
206
+ st.rerun()
207
+
208
+
209
+
210
  # Keep selection stable in session
211
  default_case_id = st.session_state.get("_current_case_id") or items[0]["case_id"]
212
  opt_by_id = {i["case_id"]: i for i in items}