Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,11 +42,11 @@ repo = Repository(
|
|
| 42 |
repo.git_pull() # Pull the latest changes (if any)
|
| 43 |
|
| 44 |
# Step 2: Load the PDF File
|
| 45 |
-
pdf_path = "Private_Book/
|
| 46 |
|
| 47 |
-
pdf_path2 = "Private_Book/
|
| 48 |
|
| 49 |
-
pdf_path3 = "Private_Book/
|
| 50 |
|
| 51 |
api_key = os.getenv("OPENAI_API_KEY")
|
| 52 |
# Retrieve the API key from st.secrets
|
|
@@ -186,7 +186,7 @@ def page1():
|
|
| 186 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 187 |
|
| 188 |
with col1:
|
| 189 |
-
st.title("
|
| 190 |
|
| 191 |
with col2:
|
| 192 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
@@ -200,7 +200,7 @@ def page1():
|
|
| 200 |
st.error("File not found. Please check the file path.")
|
| 201 |
return
|
| 202 |
|
| 203 |
-
VectorStore = load_vector_store(pdf_path, "
|
| 204 |
|
| 205 |
display_chat_history(st.session_state['chat_history_page1'])
|
| 206 |
|
|
@@ -218,21 +218,22 @@ def page1():
|
|
| 218 |
col1, col2 = st.columns(2)
|
| 219 |
|
| 220 |
with col1:
|
| 221 |
-
if st.button("
|
| 222 |
-
query = "
|
| 223 |
-
if st.button("
|
| 224 |
-
query = "
|
| 225 |
-
if st.button("
|
| 226 |
-
query = "
|
| 227 |
|
| 228 |
|
| 229 |
with col2:
|
| 230 |
-
if st.button("
|
| 231 |
-
query = "
|
| 232 |
-
if st.button("Was
|
| 233 |
-
query = "Was
|
| 234 |
-
if st.button("
|
| 235 |
-
query = "
|
|
|
|
| 236 |
|
| 237 |
|
| 238 |
if query:
|
|
@@ -296,7 +297,7 @@ def page2():
|
|
| 296 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 297 |
|
| 298 |
with col1:
|
| 299 |
-
st.title("
|
| 300 |
|
| 301 |
with col2:
|
| 302 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
@@ -311,7 +312,7 @@ def page2():
|
|
| 311 |
st.error("File not found. Please check the file path.")
|
| 312 |
return
|
| 313 |
|
| 314 |
-
VectorStore = load_vector_store(pdf_path2, "
|
| 315 |
|
| 316 |
|
| 317 |
|
|
@@ -331,21 +332,21 @@ def page2():
|
|
| 331 |
col1, col2 = st.columns(2)
|
| 332 |
|
| 333 |
with col1:
|
| 334 |
-
if st.button("
|
| 335 |
-
query = "
|
| 336 |
-
if st.button("Wie
|
| 337 |
-
query = ("Wie
|
| 338 |
-
if st.button("
|
| 339 |
-
query = "
|
| 340 |
|
| 341 |
|
| 342 |
with col2:
|
| 343 |
-
if st.button("
|
| 344 |
-
query = "
|
| 345 |
-
if st.button("
|
| 346 |
-
query = "
|
| 347 |
-
if st.button("
|
| 348 |
-
query = "
|
| 349 |
|
| 350 |
|
| 351 |
if query:
|
|
@@ -408,7 +409,7 @@ def page3():
|
|
| 408 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 409 |
|
| 410 |
with col1:
|
| 411 |
-
st.title("
|
| 412 |
|
| 413 |
with col2:
|
| 414 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
@@ -423,7 +424,7 @@ def page3():
|
|
| 423 |
st.error("File not found. Please check the file path.")
|
| 424 |
return
|
| 425 |
|
| 426 |
-
VectorStore = load_vector_store(pdf_path3, "
|
| 427 |
|
| 428 |
|
| 429 |
|
|
@@ -443,21 +444,21 @@ def page3():
|
|
| 443 |
col1, col2 = st.columns(2)
|
| 444 |
|
| 445 |
with col1:
|
| 446 |
-
if st.button("
|
| 447 |
-
query = "
|
| 448 |
-
if st.button("
|
| 449 |
-
query = ("
|
| 450 |
-
if st.button("
|
| 451 |
-
query = "
|
| 452 |
|
| 453 |
|
| 454 |
with col2:
|
| 455 |
-
if st.button("
|
| 456 |
-
query = "
|
| 457 |
-
if st.button("
|
| 458 |
-
query = "
|
| 459 |
-
if st.button("
|
| 460 |
-
query = "
|
| 461 |
|
| 462 |
|
| 463 |
if query:
|
|
|
|
| 42 |
repo.git_pull() # Pull the latest changes (if any)
|
| 43 |
|
| 44 |
# Step 2: Load the PDF File
|
| 45 |
+
pdf_path = "Private_Book/KH_Reform_230124.pdf" # Replace with your PDF file path
|
| 46 |
|
| 47 |
+
pdf_path2 = "Private_Book/Buch_23012024.pdf"
|
| 48 |
|
| 49 |
+
pdf_path3 = "Private_Book/Kosten_Grunddaten_KH_230124.pdf"
|
| 50 |
|
| 51 |
api_key = os.getenv("OPENAI_API_KEY")
|
| 52 |
# Retrieve the API key from st.secrets
|
|
|
|
| 186 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 187 |
|
| 188 |
with col1:
|
| 189 |
+
st.title("KH_reform!")
|
| 190 |
|
| 191 |
with col2:
|
| 192 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
|
|
| 200 |
st.error("File not found. Please check the file path.")
|
| 201 |
return
|
| 202 |
|
| 203 |
+
VectorStore = load_vector_store(pdf_path, "KH_Reform_2301", force_reload=False)
|
| 204 |
|
| 205 |
display_chat_history(st.session_state['chat_history_page1'])
|
| 206 |
|
|
|
|
| 218 |
col1, col2 = st.columns(2)
|
| 219 |
|
| 220 |
with col1:
|
| 221 |
+
if st.button("Wie viele Ärzte benötigt eine Klinik in der Leistungsgruppe Pädiatrie?"):
|
| 222 |
+
query = "Wie viele Ärzte benötigt eine Klinik in der Leistungsgruppe Pädiatrie?"
|
| 223 |
+
if st.button("Wie viele Leistungsgruppen gibt es?"):
|
| 224 |
+
query = ("Wie viele Leistungsgruppen gibt es?")
|
| 225 |
+
if st.button("Was sind die hauptsächlichen Änderungsvorhaben der Krankenhausreform?"):
|
| 226 |
+
query = "Was sind die hauptsächlichen Änderungsvorhaben der Krankenhausreform?"
|
| 227 |
|
| 228 |
|
| 229 |
with col2:
|
| 230 |
+
if st.button("Welche und wieviele Fachärzte benötige ich für die Leistungsgruppe Gastroenterologie? "):
|
| 231 |
+
query = "Welche und wieviele Fachärzte benötige ich für die Leistungsgruppe Gastroenterologie"
|
| 232 |
+
if st.button("Was soll die Reform der Notfallversorgung beinhalten?"):
|
| 233 |
+
query = "Was soll die Reform der Notfallversorgung beinhalten?"
|
| 234 |
+
if st.button("Was bedeutet die Vorhaltefinanzierung?"):
|
| 235 |
+
query = "Was bedeutet die Vorhaltefinanzierung?"
|
| 236 |
+
|
| 237 |
|
| 238 |
|
| 239 |
if query:
|
|
|
|
| 297 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 298 |
|
| 299 |
with col1:
|
| 300 |
+
st.title("Kennzahlenbuch 100 Kennzahlen!")
|
| 301 |
|
| 302 |
with col2:
|
| 303 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
|
|
| 312 |
st.error("File not found. Please check the file path.")
|
| 313 |
return
|
| 314 |
|
| 315 |
+
VectorStore = load_vector_store(pdf_path2, "Buch_2301", force_reload=False)
|
| 316 |
|
| 317 |
|
| 318 |
|
|
|
|
| 332 |
col1, col2 = st.columns(2)
|
| 333 |
|
| 334 |
with col1:
|
| 335 |
+
if st.button("Nenne mir 5 wichtige Personalkennzahlen im Krankenhaus."):
|
| 336 |
+
query = "Nenne mir 5 wichtige Personalkennzahlen im Krankenhaus."
|
| 337 |
+
if st.button("Wie ist die durchschnittliche Bettenauslastung eines Krankenhauses?"):
|
| 338 |
+
query = ("Wie ist die durchschnittliche Bettenauslastung eines Krankenhauses?")
|
| 339 |
+
if st.button("Welches sind die häufigsten DRGs, die von den Krankenhäusern abgerechnet werden?"):
|
| 340 |
+
query = "Welches sind die häufigsten DRGs, die von den Krankenhäusern abgerechnet werden? "
|
| 341 |
|
| 342 |
|
| 343 |
with col2:
|
| 344 |
+
if st.button("Wieviel Casemixpunkte werden im Median von einer ärztlichen Vollkraft erbracht?"):
|
| 345 |
+
query = "Wieviel Casemixpunkte werden im Median von einer ärztlichen Vollkraft erbracht?"
|
| 346 |
+
if st.button("Bitte erstelle mir einer Übersicht der wichtiger Strukturkennzahlen eines Krankenhauses der Grund- und Regelversorgung."):
|
| 347 |
+
query = "Bitte erstelle mir einer Übersicht der wichtiger Strukturkennzahlen eines Krankenhauses der Grund- und Regelversorgung."
|
| 348 |
+
if st.button("Wieviele Patienten eines Grund- und Regelversorgers kommen aus welcher Fahrzeitzone?"):
|
| 349 |
+
query = "Wieviele Patienten eines Grund- und Regelversorgers kommen aus welcher Fahrzeitzone?"
|
| 350 |
|
| 351 |
|
| 352 |
if query:
|
|
|
|
| 409 |
col1, col2 = st.columns([3, 1]) # Adjust the ratio to your liking
|
| 410 |
|
| 411 |
with col1:
|
| 412 |
+
st.title("Kosten- und Strukturdaten der Krankenhäuser")
|
| 413 |
|
| 414 |
with col2:
|
| 415 |
# Load and display the image in the right column, which will be the top-right corner of the page
|
|
|
|
| 424 |
st.error("File not found. Please check the file path.")
|
| 425 |
return
|
| 426 |
|
| 427 |
+
VectorStore = load_vector_store(pdf_path3, "Kosten_Str_2301", force_reload=False)
|
| 428 |
|
| 429 |
|
| 430 |
|
|
|
|
| 444 |
col1, col2 = st.columns(2)
|
| 445 |
|
| 446 |
with col1:
|
| 447 |
+
if st.button("Wie hat sich die Bettenanzahl in den letzten 10 Jahren entwickelt?"):
|
| 448 |
+
query = "Wie hat sich die Bettenanzahl in den letzten 10 Jahren entwickelt?"
|
| 449 |
+
if st.button("Wieviele Patienten werden pro Jahr stationär in Deutschland behandelt?"):
|
| 450 |
+
query = ("Wieviele Patienten werden pro Jahr stationär in Deutschland behandelt?")
|
| 451 |
+
if st.button("Wieviele Vollkräfte arbeiten in Summe in deutschen Krankenhäusern?"):
|
| 452 |
+
query = "Wieviele Vollkräfte arbeiten in Summe in deutschen Krankenhäusern? "
|
| 453 |
|
| 454 |
|
| 455 |
with col2:
|
| 456 |
+
if st.button("Welche unterschiedlichen Personalkosten gibt es im Krankenhaus?"):
|
| 457 |
+
query = "Welche unterschiedlichen Personalkosten gibt es im Krankenhaus?"
|
| 458 |
+
if st.button("Welche Sachkosten werden in Krankenhäusern unterschieden?"):
|
| 459 |
+
query = "Welche Sachkosten werden in Krankenhäusern unterschieden? "
|
| 460 |
+
if st.button("Wie hoch sind die Gesamtkosten der Krankenhäuser pro Jahr?"):
|
| 461 |
+
query = "Wie hoch sind die Gesamtkosten der Krankenhäuser pro Jahr?"
|
| 462 |
|
| 463 |
|
| 464 |
if query:
|