awacke1 commited on
Commit
671e0d4
·
1 Parent(s): 585de43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -6
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
- 'CPT Code': ['99201', '99232', '99233', '99234', '99235'],
8
- 'Procedure': ['Office/Outpatient Visit', 'Inpatient Consultation', 'Initial Hospital Care', 'Subsequent Hospital Care', 'Critical Care Services'],
9
- 'Expected Cost': [100, 200, 150, 250, 300]
 
10
  }
11
  df = pd.DataFrame(data)
12
 
13
- # Create a histogram with Plotly Express
14
- fig = px.histogram(df, x='Procedure', y='Expected Cost')
15
 
16
- # Display the histogram in Streamlit
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)')