Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,29 @@ from sheets_integration import SheetsLogger
|
|
12 |
service = DataAssessmentService(api_key=os.environ.get("OPENAI_API_KEY"))
|
13 |
sheets_logger = SheetsLogger()
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
# Department mapping from abbreviations to full names
|
16 |
DEPARTMENTS = {
|
17 |
"Executive Management": "บริหาร ผอ รอง ผู้ช่วย",
|
@@ -106,13 +129,16 @@ with gr.Blocks() as demo:
|
|
106 |
visible=False
|
107 |
)
|
108 |
|
109 |
-
# Show/hide other department textbox
|
110 |
department.change(
|
111 |
fn=lambda x: gr.update(visible=x=="Other"),
|
112 |
inputs=[department],
|
113 |
outputs=[other_dept]
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
116 |
with gr.Row():
|
117 |
request_details = gr.Textbox(
|
118 |
label="Request Details",
|
@@ -146,8 +172,9 @@ with gr.Blocks() as demo:
|
|
146 |
gr.Markdown("""
|
147 |
### Notes:
|
148 |
- Please provide detailed information about the data you need
|
|
|
|
|
149 |
- All communications will be sent to the provided email
|
150 |
-
- For urgent requests, please select appropriate urgency level
|
151 |
""")
|
152 |
|
153 |
if __name__ == "__main__":
|
|
|
12 |
service = DataAssessmentService(api_key=os.environ.get("OPENAI_API_KEY"))
|
13 |
sheets_logger = SheetsLogger()
|
14 |
|
15 |
+
EXAMPLE_REQUESTS = """
|
16 |
+
### Example 1: Clinical Data Request
|
17 |
+
I need OPD patient statistics for the Cardiology department from January to June 2024, including daily patient volume, types of cardiac conditions (ICD-10 codes), average waiting times, and number of follow-up vs. new cases. This data will be used for department capacity planning and resource allocation.
|
18 |
+
|
19 |
+
### Example 2: Quality Improvement Request
|
20 |
+
Requesting waiting time analysis for all OPD clinics for Q1 2024, including:
|
21 |
+
- Registration to first nurse contact time
|
22 |
+
- Nurse station to doctor examination time
|
23 |
+
- Doctor examination duration
|
24 |
+
- Time at pharmacy
|
25 |
+
- Total visit duration
|
26 |
+
Break down by day of week and time slots (morning/afternoon). This data will help identify service bottlenecks.
|
27 |
+
|
28 |
+
### Example 3: Department Performance Analysis
|
29 |
+
Need Emergency Department performance data for March 2024:
|
30 |
+
- Daily patient volume by triage level
|
31 |
+
- Door-to-doctor times
|
32 |
+
- Length of stay in ED
|
33 |
+
- Admission rates
|
34 |
+
- Transfer rates to other departments
|
35 |
+
Purpose: Monthly performance review and staff allocation planning.
|
36 |
+
"""
|
37 |
+
|
38 |
# Department mapping from abbreviations to full names
|
39 |
DEPARTMENTS = {
|
40 |
"Executive Management": "บริหาร ผอ รอง ผู้ช่วย",
|
|
|
129 |
visible=False
|
130 |
)
|
131 |
|
|
|
132 |
department.change(
|
133 |
fn=lambda x: gr.update(visible=x=="Other"),
|
134 |
inputs=[department],
|
135 |
outputs=[other_dept]
|
136 |
)
|
137 |
|
138 |
+
# Add collapsible examples section
|
139 |
+
with gr.Accordion("📝 Click here to see example requests", open=False):
|
140 |
+
gr.Markdown(EXAMPLE_REQUESTS)
|
141 |
+
|
142 |
with gr.Row():
|
143 |
request_details = gr.Textbox(
|
144 |
label="Request Details",
|
|
|
172 |
gr.Markdown("""
|
173 |
### Notes:
|
174 |
- Please provide detailed information about the data you need
|
175 |
+
- Include specific time periods and parameters
|
176 |
+
- Clearly state the purpose of your request
|
177 |
- All communications will be sent to the provided email
|
|
|
178 |
""")
|
179 |
|
180 |
if __name__ == "__main__":
|