Create prompt_templates.py
Browse files- prompt_templates.py +31 -0
prompt_templates.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# prompt_templates.py
|
2 |
+
import json
|
3 |
+
from typing import Dict
|
4 |
+
|
5 |
+
DECISION_FRAME = """FRAME:
|
6 |
+
- SAFETY/RISK: crowding proxy; p95 boarding time; # critical waits; isolation/telemetry constraints.
|
7 |
+
- CAPACITY: staffed beds now; free beds; unit occupancy & imbalance; EVS/transport turnaround.
|
8 |
+
- DISCHARGES: # ready now; # by noon; barriers (AH, placement, Rx, paperwork).
|
9 |
+
- ADMISSIONS: ED admits waiting (by service/needs); forecast next 6–24h; elective admits deferrable.
|
10 |
+
- STAFFING: RN/RT/Allied gaps; redeploy/OT/agency options.
|
11 |
+
- MATH: beds needed now to clear ED; additional buffer for next 12h; target occupancy.
|
12 |
+
- DECISION: ranked actions with owner, ETA, expected beds, and risks.
|
13 |
+
"""
|
14 |
+
|
15 |
+
def build_system_preamble(snapshot: Dict, policy_context: str, computed_numbers: Dict) -> str:
|
16 |
+
return f"""
|
17 |
+
You are ClarityOps, a hospital flow decision co-pilot.
|
18 |
+
Use the snapshot JSON, computed numbers, and policy excerpts to recommend next actions.
|
19 |
+
Return EXACTLY: (1) Risks, (2) Beds needed & by when, (3) Actions ranked with owner/ETA/expected beds, (4) Expected impact, (5) Escalations/Comms.
|
20 |
+
|
21 |
+
Policies & SOP Excerpts:
|
22 |
+
{policy_context}
|
23 |
+
|
24 |
+
Snapshot (JSON):
|
25 |
+
{json.dumps(snapshot, indent=2)}
|
26 |
+
|
27 |
+
Computed Numbers:
|
28 |
+
{json.dumps(computed_numbers, indent=2)}
|
29 |
+
|
30 |
+
{DECISION_FRAME}
|
31 |
+
""".strip()
|