farhananis005 commited on
Commit
4a46c94
·
verified ·
1 Parent(s): 45e2cbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -17
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
- audio_patient_name_box = gr.Textbox(label="Patient Name", interactive=True, placeholder="Generated Patient Name", lines=1)
715
  with gr.Row():
716
  with gr.Column():
717
- audio_soap_report_box = gr.Textbox(label="SOAP Report", interactive=True, placeholder="Generated SOAP Report", lines=10)
718
  with gr.Column():
719
- audio_sbar_report_box = 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,14 +726,27 @@ with gr.Blocks(css=css) as demo:
726
  fn=report_audio,
727
  inputs=[audio_file, transcription_service],
728
  outputs=[
729
- audio_patient_name_box,
730
- audio_soap_report_box,
731
- audio_sbar_report_box,
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
- # Add Save Report Button
766
- with gr.Row():
767
- save_button = gr.Button("Save Report", variant="secondary")
768
- save_message = gr.Textbox(label="Save Status", interactive=False, placeholder="Status of the save operation", lines=1)
769
-
770
- # Click event for Save Report Button using `patient_name_box_text` as the file name
771
- save_button.click(
772
- fn=save_reports_main,
773
- inputs=[patient_name_box_text, soap_report_box_text, sbar_report_box_text],
774
- outputs=[save_message]
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
+