carisackc commited on
Commit
efbc7f6
1 Parent(s): f5386b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -64,7 +64,7 @@ del df2
64
  df['HADM_ID'] = df['HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
65
  df3['HADM_ID'] = df3['HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
66
  df3['INDEX_HADM_ID'] = df3['INDEX_HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
67
- df3["CHARTDATE_HADM_ID"] = df3["CHARTDATE"].astype(str) +' - '+ df3["HADM_ID"]
68
  df3["DIAGNOSIS"] = df3["DIAGNOSIS"].str.capitalize()
69
  df3["DISCHARGE_LOCATION"] = df3["DISCHARGE_LOCATION"].str.capitalize()
70
 
@@ -89,6 +89,7 @@ patient = st.sidebar.selectbox('Select Patient ID:', patientid) #Filter Patie
89
  admissionid = df['Admission_ID'].loc[df['Patient_ID'] == patient] #Filter available Admission id for patient
90
  HospitalAdmission = st.sidebar.selectbox(' ', admissionid)
91
  pastHistoryEpDate = df3['CHARTDATE_HADM_ID'].loc[(df3['Patient_ID'] == patient) & (df3['Admission_ID']== HospitalAdmission)]
 
92
 
93
 
94
  # List of Model available
@@ -148,20 +149,21 @@ with st.container():
148
  with st.container():
149
  if btnPastHistory:
150
  with col6:
151
- st.markdown('**No. of admission past 6 months: xx**')
 
152
 
153
  with col7:
154
  #st.date_input('Select Admission Date') # To replace with a dropdown filter instead
155
  #st.selectbox('Past Episodes',pastHistoryEp)
156
- pastHistory = st.selectbox(' ', pastHistoryEpDate,on_change=None,)
157
 
158
  if btnPastHistory:
159
 
160
- st.write('Past History')
161
  historyAdmission = df3.query(
162
  "Patient_ID == @patient & CHARTDATE_HADM_ID == @pastHistory"
163
  )
164
- runtext = historyAdmission['TEXT'].values[0]
165
 
166
  else:
167
  runtext =st.text_area(inputNote, str(original_text2), height=300)
 
64
  df['HADM_ID'] = df['HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
65
  df3['HADM_ID'] = df3['HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
66
  df3['INDEX_HADM_ID'] = df3['INDEX_HADM_ID'].astype(str).apply(lambda x: x.replace('.0',''))
67
+ df3["CHARTDATE_HADM_ID"] = df3["CHARTDATE"].astype(str) +' ('+ df3["HADM_ID"] +')'
68
  df3["DIAGNOSIS"] = df3["DIAGNOSIS"].str.capitalize()
69
  df3["DISCHARGE_LOCATION"] = df3["DISCHARGE_LOCATION"].str.capitalize()
70
 
 
89
  admissionid = df['Admission_ID'].loc[df['Patient_ID'] == patient] #Filter available Admission id for patient
90
  HospitalAdmission = st.sidebar.selectbox(' ', admissionid)
91
  pastHistoryEpDate = df3['CHARTDATE_HADM_ID'].loc[(df3['Patient_ID'] == patient) & (df3['Admission_ID']== HospitalAdmission)]
92
+ countOfAdmission = len(pastHistoryEpDate)
93
 
94
 
95
  # List of Model available
 
149
  with st.container():
150
  if btnPastHistory:
151
  with col6:
152
+ st.markdown('**No. of admission past 6 months:**')
153
+ st.markdown(countOfAdmission)
154
 
155
  with col7:
156
  #st.date_input('Select Admission Date') # To replace with a dropdown filter instead
157
  #st.selectbox('Past Episodes',pastHistoryEp)
158
+ pastHistory = st.selectbox('Select Past History Admission', pastHistoryEpDate,on_change=None,)
159
 
160
  if btnPastHistory:
161
 
162
+ #st.write('Past History')
163
  historyAdmission = df3.query(
164
  "Patient_ID == @patient & CHARTDATE_HADM_ID == @pastHistory"
165
  )
166
+ runtext = historyAdmission['hospital_course_processed'].values[0]
167
 
168
  else:
169
  runtext =st.text_area(inputNote, str(original_text2), height=300)