Rathapoom's picture
Create app.py
6c21314 verified
raw
history blame
2.81 kB
import streamlit as st
# Title and introduction
st.title("Case-Based Learning: Compartment Syndrome")
st.write("**Case:** A 25-year-old male with a tibial fracture from a motorcycle accident.")
st.write("**Presentation:** Severe pain in the lower leg, swelling, and difficulty moving his toes.")
st.image("1.jpg", caption="Initial Presentation", use_column_width=True)
# Scene 1: Initial choice
st.subheader("Scene 1: Patient Arrives at ER")
choice_1 = st.radio(
"What will you do first?",
["Examine the leg", "Send for X-ray", "Administer strong analgesics"],
index=0
)
if choice_1 == "Examine the leg":
st.image("2.jpg", caption="Examination Findings", use_column_width=True)
st.write("Findings: Swollen, tense leg with pain on passive stretching and decreased sensation.")
st.subheader("What is your next step?")
choice_2 = st.radio(
"Choose an action:",
["Measure compartment pressure", "Monitor and wait", "Repeat physical exam after medication"],
index=0
)
if choice_2 == "Measure compartment pressure":
st.image("3.jpg", caption="Pressure Measurement", use_column_width=True)
st.success("Pressure >30 mmHg. Confirmed Compartment Syndrome.")
st.write("**Action:** Perform fasciotomy immediately.")
st.image("4.jpg", caption="Fasciotomy Procedure", use_column_width=True)
st.success("Outcome: Patient improves, damage prevented.")
elif choice_2 == "Monitor and wait":
st.image("5.jpg", caption="Monitoring Patient", use_column_width=True)
st.error("Condition worsens. Outcome: Permanent damage or amputation.")
elif choice_2 == "Repeat physical exam after medication":
st.image("6.jpg", caption="Repeat Examination", use_column_width=True)
st.warning("Findings: Swelling worsens, sensory loss increases.")
st.write("**Action:** Proceed to measure compartment pressure.")
st.image("3.jpg", caption="Pressure Measurement", use_column_width=True)
st.success("Outcome: Pressure >30 mmHg. Perform fasciotomy.")
elif choice_1 == "Send for X-ray":
st.image("7.jpg", caption="X-ray Findings", use_column_width=True)
st.write("Findings: Tibial fracture noted. Still suspect Compartment Syndrome based on symptoms.")
st.write("Proceed to re-evaluate the patient.")
elif choice_1 == "Administer strong analgesics":
st.image("8.jpg", caption="Administering Pain Relief", use_column_width=True)
st.warning("Pain worsens despite medication. Signs of compartment syndrome persist.")
st.write("**Action:** Reassess and proceed to examination or measure compartment pressure.")
# End of the game
st.subheader("Game Over")
st.write("Reflect on your decisions and discuss what could be done differently in a real scenario.")