File size: 5,027 Bytes
6c21314
9d8fb1d
6c21314
4faf225
9d8fb1d
4faf225
9d8fb1d
4faf225
 
 
 
 
9d8fb1d
 
 
 
 
 
 
 
 
 
6c21314
9d8fb1d
 
 
 
4faf225
 
9d8fb1d
 
 
 
4faf225
 
9d8fb1d
 
 
 
4faf225
 
 
9d8fb1d
 
 
 
 
 
 
9caef31
9d8fb1d
 
9caef31
9d8fb1d
4faf225
3d0ac67
 
 
9d8fb1d
 
 
 
4faf225
 
9d8fb1d
 
 
 
4faf225
 
9d8fb1d
 
 
 
 
 
 
941e41b
9d8fb1d
 
 
 
6c21314
4faf225
 
9d8fb1d
941e41b
 
 
 
 
 
 
9d8fb1d
4faf225
 
9d8fb1d
 
 
 
 
 
 
941e41b
9d8fb1d
 
 
 
 
941e41b
 
9d8fb1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import streamlit as st
import time

# Initialize session state variables
if "scene" not in st.session_state:
    st.session_state["scene"] = 1  # Start at Scene 1
if "pain_increase" not in st.session_state:
    st.session_state["pain_increase"] = False  # Tracks whether pain has worsened

# Function to change the scene
def change_scene(next_scene):
    st.session_state["scene"] = next_scene

# Scene 1: Patient arrives at ER
if st.session_state["scene"] == 1:
    st.title("Scene 1: Patient Arrives at ER")
    st.image("1.jpg", caption="Patient presenting with leg pain and swelling", use_container_width=True)
    st.write("The patient presents with severe pain in the lower leg after a motorcycle accident.")

    choice = st.radio(
        "What will you do first?",
        ["Select an option", "Examine the leg", "Send for X-ray", "Administer painkillers"]
    )

    if choice == "Examine the leg":
        st.image("2.jpg", caption="Exam findings: Swollen leg, no significant tension", use_container_width=True)
        st.write("Findings: Swollen leg with mild tenderness. Compartment Syndrome is not confirmed.")
        if st.button("Proceed to next step"):
            change_scene(2)

    elif choice == "Send for X-ray":
        st.image("3.jpg", caption="X-ray: Tibial fracture observed", use_container_width=True)
        st.write("Findings: Tibial fracture confirmed. This does not rule out Compartment Syndrome.")
        if st.button("Go Back to Scene 1"):
            change_scene(1)

    elif choice == "Administer painkillers":
        st.image("4.jpg", caption="Painkillers administered", use_container_width=True)
        st.success("The patient reports feeling better for now.")
        st.session_state["pain_increase"] = True  # Set pain to increase later
        if st.button("Proceed to next step"):
            change_scene(2)

# Scene 2: Monitoring or Further Action
elif st.session_state["scene"] == 2:
    st.title("Scene 2: Monitoring or Further Action")
    st.write("The patient is stable for now. What would you like to do?")
    choice = st.radio(
        "Choose your next step:",
        ["Select an option", "Observe and Monitor", "Repeat Exam", "Measure Compartment Pressure"]
    )

    if choice == "Observe and Monitor":
        st.write("Monitoring the patient... Please wait.")
        time.sleep(5)  # Simulate waiting
        st.warning("The patient reports severe pain again.")
        if st.button("Proceed to next step"):
            change_scene(3)

    elif choice == "Repeat Exam":
        st.image("5.jpg", caption="Repeat examination shows no major changes", use_container_width=True)
        st.write("Findings: The swelling remains mild. Compartment Pressure is not elevated yet.")
        if st.button("Go Back to Scene 2"):
            change_scene(2)

    elif choice == "Measure Compartment Pressure":
        st.image("6.jpg", caption="Compartment pressure measurement", use_container_width=True)
        st.write("Results: Compartment pressure is within normal limits at this time.")
        if st.button("Proceed to next step"):
            change_scene(2)

# Scene 3: Progression of Symptoms
elif st.session_state["scene"] == 3:
    st.title("Scene 3: Worsening Symptoms")
    st.write("The patient's symptoms are worsening: severe pain, tense swelling.")
    choice = st.radio(
        "Choose your next step:",
        ["Select an option", "Re-check Compartment Pressure", "Administer additional painkillers", "Continue Observation"]
    )

    if choice == "Re-check Compartment Pressure":
        st.image("7.jpg", caption="Re-measurement of Compartment Pressure", use_container_width=True)
        st.success("Pressure >30 mmHg. Confirmed Compartment Syndrome.")
        if st.button("Proceed to next step"):
            change_scene(4)

    elif choice == "Administer additional painkillers":
        st.image("4.jpg", caption="Painkillers administered again", use_container_width=True)
        st.warning("The patient reports temporary relief but symptoms persist.")
        if st.button("Go Back to Scene 3"):
            change_scene(3)

    elif choice == "Continue Observation":
        st.error("The patient's condition worsens further. Necrosis has begun.")
        if st.button("Proceed to next step"):
            change_scene(4)

# Scene 4: Treatment
elif st.session_state["scene"] == 4:
    st.title("Scene 4: Treatment")
    st.write("What action will you take?")
    choice = st.radio(
        "Choose your treatment:",
        ["Select an option", "Perform Fasciotomy", "Observe further without Fasciotomy"]
    )

    if choice == "Perform Fasciotomy":
        st.image("8.jpg", caption="Fasciotomy performed", use_container_width=True)
        st.success("Outcome: Patient recovers with minimal damage.")
    elif choice == "Observe further without Fasciotomy":
        st.image("9.jpg", caption="Continued observation leads to necrosis", use_container_width=True)
        st.error("Outcome: Permanent damage or amputation required.")