Spaces:
Sleeping
Sleeping
Update app.py
Browse files121 unmodified lines1221231241251261271281291301311321331341351361374 unmodified lines142143144145146147148293 unmodified lines442443444445446447448449450451452453454455456457458459460461462463121 unmodified linesField(name="dialogue_name", type="input_col", title=""),]),Field(type="container", title="### Session-/Patient-Specific Properties", children=[Field(name="to_moderate", type="likert_radio",title="Explicit mention of clinical diagnosis?", other_params={'labels': mentioned_y_n}, mandatory=True),Field(name="priority_level", type="likert_radio",title="Level of priority", other_params={'labels': priority_labels}, mandatory=True),]),Field(type="container", title="### Rupture Markers", children=[Field(type="expander", title="**Overview of rupture markers** *(expand)*", children=[Field(name="rupture_marker_overview", type="input_col", title=""),]),Field(name="rupture_markers", type="rupture_markers",title="Select rupture markers noted in the session, include line numbers where rupture is found.", mandatory=False),4 unmodified lines# Field(name="rupture_marker_other", type="text", title="*If Other, please specify:*", mandatory=False),]),Field(type="container", title="### True-To-Patient-Prompt Features", children=[Field(name="helpful", type="y_n_radio",title="Did the patient remain true to the provided patient prompt?", mandatory=True,following_mandatory_values=[1]),293 unmodified linesst.session_state.following_mandatory = Falsematch f.type:case 'input_col':value = st.session_state.data.iloc[index][f.name]if value and value is not np.nan:st.write(f.title)if f.name == 'image_name':display_image(os.path.join(input_repo_path, 'images', value))elif f.name == 'dialogue_name':#display_dialogue(os.path.join(input_repo_path, 'dialogues', value))render_dialogue(os.path.join(input_repo_path, 'dialogues', value), width_chars=115, height_px=520, show_border=False)elif f.name == 'rupture_marker_overview':display_dialogue(os.path.join(input_repo_path, 'rupture_marker_overview.md'))elif f.name == 'patient':st.markdown(f"## Patient: {value}")else:st.write(value)case 'markdown':st.markdown(f.title)case 'expander' | 'container':with (st.expander(f.title) if f.type == 'expander' else st.container(border=True)):if f.type == 'container':121 unmodified lines1221231241251261271281291301311321331341351361374 unmodified lines142143144145146147148293 unmodified lines442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471121 unmodified linesField(name="dialogue_name", type="input_col", title=""),]),Field(type="container", title="#### Session-/Patient-Specific Properties", children=[Field(name="to_moderate", type="likert_radio",title="Explicit mention of clinical diagnosis?", other_params={'labels': mentioned_y_n}, mandatory=True),Field(name="priority_level", type="likert_radio",title="Level of priority", other_params={'labels': priority_labels}, mandatory=True),]),Field(type="container", title="#### Rupture Markers", children=[Field(type="expander", title="**Overview of rupture markers** *(expand)*", children=[Field(type="markdown", title="", other_params={"path": "rupture_marker_overview.md"}),]),Field(name="rupture_markers", type="rupture_markers",title="Select rupture markers noted in the session, include line numbers where rupture is found.", mandatory=False),4 unmodified lines# Field(name="rupture_marker_other", type="text", title="*If Other, please specify:*", mandatory=False),]),Field(type="container", title="#### True-To-Patient-Prompt Features", children=[Field(name="helpful", type="y_n_radio",title="Did the patient remain true to the provided patient prompt?", mandatory=True,following_mandatory_values=[1]),293 unmodified linesst.session_state.following_mandatory = Falsematch f.type:case 'input_col':#if f.name and f.name in st.session_state.data.columns:# value = st.session_state.data.iloc[index][f.name]#else:# value = Nonevalue = st.session_state.data.iloc[index][f.name]if value and value is not np.nan:st.write(f.title)if f.name == 'image_name':display_image(os.path.join(input_repo_path, 'images', value))elif f.name == 'dialogue_name':render_dialogue(os.path.join(input_repo_path, 'dialogues', value), width_chars=115, height_px=520, show_border=False)#elif f.name == 'rupture_marker_overview':# display_dialogue(os.path.join(input_repo_path, 'rupture_marker_overview.md'))elif f.name == 'patient':st.markdown(f"## Patient: {value}")else:st.write(value)case 'markdown':path = f.other_params.get("path") if f.other_params else Noneif path:content = load_text(os.path.join(input_repo_path, path))st.markdown(content, unsafe_allow_html=True)else:st.markdown(f.title)case 'expander' | 'container':with (st.expander(f.title) if f.type == 'expander' else st.container(border=True)):if f.type == 'container':
app.py+16-8