File size: 2,266 Bytes
8e844df
8b893c4
8e844df
1b8f14b
07f4fdf
22dc694
e9cfc22
4468aa8
e9cfc22
2f6133f
4468aa8
37259df
2f6133f
 
8b893c4
 
 
 
 
 
 
1ba86d2
8b893c4
 
 
 
 
 
ff0c773
8b893c4
ff0c773
8b893c4
8e844df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import pandas as pd 

#st.title("📘SBS mapper")
st.header("Map internal descriptions to SBS codes V2.0")
st.subheader("Work in progress; Demo currently limited to Chapter 20: Imaging services")
#st.image("images/SBS_Chapter_Index.png", use_container_width=True) 
st.subheader("Select specific Chapter for quicker results")
df_chapters = pd.read_csv("SBS_V2_Chapter_Index.csv")
df_chapters.iloc[25] = {"Chapter": "ALL", "Chapter title": "ALL CHAPTERS (will take more time)", "Blocks": "Total", "No. Codes": 10081}
#st.dataframe(df_chapters, hide_index=True) # redundant, as dataframe will be displayed by below function

def dataframe_with_selections(df_chapters: pd.DataFrame, init_value: bool = False) -> pd.DataFrame:
    df_with_selections = df_chapters.copy()
    df_with_selections.insert(0, "Select", init_value)

    # Get dataframe row-selections from user with st.data_editor
    edited_df = st.data_editor(
        df_with_selections,
        hide_index=True,
        column_config={"Select": st.column_config.CheckboxColumn(required=True)},
        disabled=df_chapters.columns,
    )

    # Filter the dataframe using the temporary column, then drop the column
    selected_rows = edited_df[edited_df.Select]
    return selected_rows.drop('Select', axis=1)

chapter_names = dataframe_with_selections(df_chapters)
st.write("Your selection:")
st.write(chapter_names)

#'Procedures on nervous system'
#'Procedures on endocrine system'
#'Procedures on eye and adnexa'
#'Procedures on ear and mastoid process'
#'Procedures on nose, mouth and pharynx'
#'Dental services'
#'Procedures on respiratory system'
#'Procedures on cardiovascular system'
#'Procedures on blood and blood-forming organs'
#'Procedures on digestive system'
#'Procedures on urinary system'
#'Procedures on male genital organs'
#'Gynaecological procedures'
#'Obstetric procedures'
#'Procedures on musculoskeletal system'
#'Dermatological and plastic procedures'
#'Procedures on breast'
#'Radiation oncology procedures'
#'Non-invasive, cognitive and other interventions, not elsewhere classified'
#'Imaging services'
#'Laboratory and Pathology Services'
#'Ambulance and Transport Services'
#'KSA Service Codes'
#'Emergency Medical Services (EMS)'
#'Mortuary Services'