Spaces:
Sleeping
Sleeping
farhananis005
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -711,12 +711,12 @@ with gr.Blocks(css=css) as demo:
|
|
711 |
generate_with_audio_button = gr.Button("Generate Report", variant="primary")
|
712 |
|
713 |
# Shared output containers
|
714 |
-
|
715 |
with gr.Row():
|
716 |
with gr.Column():
|
717 |
-
|
718 |
with gr.Column():
|
719 |
-
|
720 |
|
721 |
audio_doctor_recommendations_box = gr.Textbox(label="Doctor Recommendations", interactive=False, placeholder="Recommendations", lines=5)
|
722 |
audio_transcription_box = gr.Textbox(label="Transcription Text", interactive=False, placeholder="Transcribed Text", lines=5)
|
@@ -726,14 +726,27 @@ with gr.Blocks(css=css) as demo:
|
|
726 |
fn=report_audio,
|
727 |
inputs=[audio_file, transcription_service],
|
728 |
outputs=[
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
audio_doctor_recommendations_box,
|
733 |
audio_transcription_box
|
734 |
]
|
735 |
)
|
736 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
737 |
# Tab for generating from text input
|
738 |
with gr.Tab("From Transcript"):
|
739 |
with gr.Column():
|
@@ -762,17 +775,18 @@ with gr.Blocks(css=css) as demo:
|
|
762 |
doctor_recommendations_box_text
|
763 |
]
|
764 |
)
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
|
|
776 |
|
777 |
# Page 2----------------------------------------------------------------------
|
778 |
####|
|
@@ -891,3 +905,4 @@ with gr.Blocks(css=css) as demo:
|
|
891 |
docs2_delete_button.click(delete2_docs, inputs=None, outputs=docs2_delete_output)
|
892 |
|
893 |
demo.launch(debug=True)
|
|
|
|
711 |
generate_with_audio_button = gr.Button("Generate Report", variant="primary")
|
712 |
|
713 |
# Shared output containers
|
714 |
+
patient_name_box_text = gr.Textbox(label="Patient Name", interactive=True, placeholder="Generated Patient Name", lines=1)
|
715 |
with gr.Row():
|
716 |
with gr.Column():
|
717 |
+
soap_report_box_text = gr.Textbox(label="SOAP Report", interactive=True, placeholder="Generated SOAP Report", lines=10)
|
718 |
with gr.Column():
|
719 |
+
sbar_report_box_text = gr.Textbox(label="SBAR Report", interactive=True, placeholder="Generated SBAR Report", lines=10)
|
720 |
|
721 |
audio_doctor_recommendations_box = gr.Textbox(label="Doctor Recommendations", interactive=False, placeholder="Recommendations", lines=5)
|
722 |
audio_transcription_box = gr.Textbox(label="Transcription Text", interactive=False, placeholder="Transcribed Text", lines=5)
|
|
|
726 |
fn=report_audio,
|
727 |
inputs=[audio_file, transcription_service],
|
728 |
outputs=[
|
729 |
+
patient_name_box_text,
|
730 |
+
soap_report_box_text,
|
731 |
+
sbar_report_box_text,
|
732 |
audio_doctor_recommendations_box,
|
733 |
audio_transcription_box
|
734 |
]
|
735 |
)
|
736 |
|
737 |
+
# Add Save Report Button
|
738 |
+
with gr.Row():
|
739 |
+
save_button = gr.Button("Save Report", variant="secondary")
|
740 |
+
save_message = gr.Textbox(label="Save Status", interactive=False, placeholder="Status of the save operation", lines=1)
|
741 |
+
|
742 |
+
# Click event for Save Report Button using `patient_name_box_text` as the file name
|
743 |
+
save_button.click(
|
744 |
+
fn=save_reports_main,
|
745 |
+
inputs=[patient_name_box_text, soap_report_box_text, sbar_report_box_text],
|
746 |
+
outputs=[save_message]
|
747 |
+
)
|
748 |
+
|
749 |
+
|
750 |
# Tab for generating from text input
|
751 |
with gr.Tab("From Transcript"):
|
752 |
with gr.Column():
|
|
|
775 |
doctor_recommendations_box_text
|
776 |
]
|
777 |
)
|
778 |
+
|
779 |
+
# Add Save Report Button
|
780 |
+
with gr.Row():
|
781 |
+
save_button = gr.Button("Save Report", variant="secondary")
|
782 |
+
save_message = gr.Textbox(label="Save Status", interactive=False, placeholder="Status of the save operation", lines=1)
|
783 |
+
|
784 |
+
# Click event for Save Report Button using `patient_name_box_text` as the file name
|
785 |
+
save_button.click(
|
786 |
+
fn=save_reports_main,
|
787 |
+
inputs=[patient_name_box_text, soap_report_box_text, sbar_report_box_text],
|
788 |
+
outputs=[save_message]
|
789 |
+
)
|
790 |
|
791 |
# Page 2----------------------------------------------------------------------
|
792 |
####|
|
|
|
905 |
docs2_delete_button.click(delete2_docs, inputs=None, outputs=docs2_delete_output)
|
906 |
|
907 |
demo.launch(debug=True)
|
908 |
+
|