Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,26 @@
|
|
1 |
import pandas as pd
|
2 |
import plotly.express as px
|
3 |
import streamlit as st
|
|
|
4 |
|
5 |
# Create a DataFrame with CPT codes, procedures, and expected costs
|
6 |
data = {
|
7 |
-
'
|
8 |
-
'
|
9 |
-
'
|
|
|
10 |
}
|
11 |
df = pd.DataFrame(data)
|
12 |
|
13 |
-
# Create a
|
14 |
-
fig = px.
|
15 |
|
16 |
-
# Display the
|
17 |
st.plotly_chart(fig)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import pandas as pd
|
2 |
import plotly.express as px
|
3 |
import streamlit as st
|
4 |
+
import jsonlines
|
5 |
|
6 |
# Create a DataFrame with CPT codes, procedures, and expected costs
|
7 |
data = {
|
8 |
+
'Code Type': ['CPT', 'SNOMED', 'RXNORM', 'DEA', 'LOINC', 'ORI', 'ORU', 'CCD'],
|
9 |
+
'Code Value': ['99201', 'A-12345', 'R-12345', 'D-12345', 'L-12345', 'O-12345', 'U-12345', 'C-12345'],
|
10 |
+
'Code Description': ['Office/Outpatient Visit', 'Inpatient Consultation', 'Initial Hospital Care', 'Subsequent Hospital Care', 'Critical Care Services', 'Procedure 6', 'Procedure 7', 'Procedure 8'],
|
11 |
+
'Expected Cost': [100, 200, 150, 250, 300, 350, 400, 450]
|
12 |
}
|
13 |
df = pd.DataFrame(data)
|
14 |
|
15 |
+
# Create a heatmap with Plotly Express
|
16 |
+
fig = px.imshow(df.corr(), color_continuous_scale='RdBu_r')
|
17 |
|
18 |
+
# Display the heatmap in Streamlit
|
19 |
st.plotly_chart(fig)
|
20 |
+
|
21 |
+
# Save DataFrame to JSONL file
|
22 |
+
with jsonlines.open('output.jsonl', mode='w') as writer:
|
23 |
+
writer.write(df.to_dict(orient='records'))
|
24 |
+
|
25 |
+
# Display a link to download the JSONL file
|
26 |
+
st.markdown('[Download data as JSONL](output.jsonl)')
|