AbeerTrial commited on
Commit
2256fc3
1 Parent(s): 3e8b652

Upload folder using huggingface_hub

Browse files
Docs/Charlos (2).txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 5. Conversation Between Patient and Doctor about Indigestion
2
+
3
+ Doctor name: John
4
+ Patient Name: Charlos
5
+
6
+ Patient: Good Morning Doctor.
7
+
8
+ Doctor: Morning. What is wrong with you?
9
+
10
+ Patient: I am suffering from indigestion since last few days.
11
+
12
+ Doctor: Have you noticed any other symptoms?
13
+
14
+ Patient: I have also headache. I couldn’t sleep at night.
15
+
16
+ Doctor: I think this is happening because of anxiety and bad eating habit.
17
+
18
+ Patient: Yes, Doctor. I have a lot of work pressure and due to my field work, I eat a lot of junk food.
19
+
20
+ Doctor: I will suggest you to take a break from your work and eat healthy foods like fruits, vegetables etc. Besides, I am also prescribing some medicines, take them 2 times a day.
21
+
22
+ Patient: Thank you Doctor.
23
+
24
+ Doctor: Welcome. Take care.
Docs/Charlos.txt CHANGED
@@ -7,3 +7,27 @@ Assessment: Charlos presents with symptoms of major depressive disorder, which i
7
  Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
8
  2. Refer Charlos to a mental health professional for further assessment and treatment
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
8
  2. Refer Charlos to a mental health professional for further assessment and treatment
9
 
10
+ Subjective: Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
11
+ Objective: Charlos appears to be listless, distracted, and minimally communicative. His speech is normal in rate, volume, and articulation and is coherent and spontaneous. His language skills are intact. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
12
+ Assessment: Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
13
+ Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
14
+ 2. Refer Charlos to a mental health professional for further assessment and treatment
15
+
16
+ Subjective: Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
17
+ Objective: Charlos appears to be listless, distracted, and minimally communicative. His speech is normal in rate, volume, and articulation and is coherent and spontaneous. His language skills are intact. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
18
+ Assessment: Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
19
+ Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
20
+ 2. Refer Charlos to a mental health professional for further assessment and treatment
21
+
22
+ Subjective: Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
23
+ Objective: Charlos appears to be listless, distracted, and minimally communicative. His speech is normal in rate, volume, and articulation and is coherent and spontaneous. His language skills are intact. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
24
+ Assessment: Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
25
+ Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
26
+ 2. Refer Charlos to a mental health professional for further assessment and treatment
27
+
28
+ Subjective: Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
29
+ Objective: Charlos appears to be listless, distracted, and minimally communicative. His speech is normal in rate, volume, and articulation and is coherent and spontaneous. His language skills are intact. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
30
+ Assessment: Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
31
+ Plan: 1. Meet with Charlos again in 2 days, Friday, 20th May
32
+ 2. Refer Charlos to a mental health professional for further assessment and treatment
33
+
Docs/General.txt CHANGED
@@ -706,3 +706,334 @@ Jerry Tylor is a 56-year-old male who presented to the emergency department with
706
  General:
707
  Jerry Tylor is a 56-year-old male who presented to the emergency department with sudden onset of severe chest pain.
708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  General:
707
  Jerry Tylor is a 56-year-old male who presented to the emergency department with sudden onset of severe chest pain.
708
 
709
+ General:
710
+ James is an individual who is suffering from major depressive disorder and is exhibiting symptoms such as feeling down, struggling to concentrate, fatigue, difficulty sleeping, hopelessness, and thoughts of self-harm. He appears to be in a depressed mood, has poor eye contact, and an apathetic attitude.
711
+
712
+ General:
713
+ James is an individual who is exhibiting symptoms of major depressive disorder. He has reported feeling down, fatigued, and having difficulty sleeping, as well as having thoughts of self-harm. He appears to be in a depressed mood, with slow speech and slumped body posture.
714
+
715
+ General:
716
+ Subjective
717
+ Pamela reports that she has been feeling down and has been struggling to concentrate. She states that she has been feeling overwhelmed and has been having difficulty sleeping. She reports that she has been feeling more irritable than usual and has been having difficulty connecting with her friends.
718
+
719
+ Objective
720
+ Pamela appears to be in a low mood and her speech is slow and monotone. She has poor eye contact and her body language is closed off.
721
+
722
+ Assessment
723
+ Pamela is exhibiting signs of depression and is in need of further assessment and treatment.
724
+
725
+ Plan
726
+ 1. Refer Pamela to a mental health professional for further assessment and treatment.
727
+
728
+ 2. Encourage Pamela to practice self-care activities such as exercise, healthy eating, and relaxation techniques.
729
+
730
+ 3. Follow up with Pamela in two weeks to assess her progress.
731
+
732
+ General:
733
+ Subjective
734
+ Pamela reports that she has been feeling down and has been struggling to concentrate. She states that she has been feeling overwhelmed and has been having difficulty sleeping. She reports that she has been feeling more irritable than usual and has been having difficulty connecting with her friends.
735
+
736
+ Objective
737
+ Pamela appears to be in a low mood and her speech is slow and monotone. She has poor eye contact and her body language is closed off.
738
+
739
+ Assessment
740
+ Pamela is exhibiting signs of depression and is in need of further assessment and treatment.
741
+
742
+ Plan
743
+ 1. Refer Pamela to a mental health professional for further assessment and treatment.
744
+
745
+ 2. Encourage Pamela to practice self-care activities such as exercise, healthy eating, and relaxation techniques.
746
+
747
+ 3. Follow up with Pamela in two weeks to assess her progress.
748
+
749
+ General:
750
+ James' SOAP report would depend on the information gathered during his appointment. If James is a patient of the social worker, the report would include subjective information about his condition, objective observations made by the social worker, an assessment of his condition, and a plan for treatment.
751
+
752
+ General:
753
+ لا شكرا، لا أحب الحبس.
754
+
755
+ General:
756
+ لا شكرا، لا أحب الحبس.
757
+
758
+ General:
759
+ لا شكرا، لا أحب الحبس.
760
+
761
+ General:
762
+ لا شكرا، لا أحب الحبس.
763
+
764
+ General:
765
+ Pamela's latest symptoms include chest pain that began one week ago with an abrupt onset of dull, aching pain in the left para-sternal area that radiated up to her neck. She has had two additional episodes of similar pain since the initial episode, one while walking her dog and one that awoke her from sleep. She has no associated symptoms during these episodes, including dizziness or palpitations. She becomes short of breath during the episodes but describes no other exertional dyspnea, orthopnea, or paroxysmal nocturnal dyspnea.
766
+
767
+ General:
768
+ Pamela reports that she has been feeling down and has been struggling to concentrate. She states that she has been feeling overwhelmed and has been having difficulty sleeping. She reports that she has been feeling more irritable than usual and has been having difficulty connecting with her friends. Pamela appears to be in a low mood and her speech is slow and monotone. She has poor eye contact and her body language is closed off.
769
+
770
+ General:
771
+ John's report is that he has been feeling down, fatigued, and hopeless, and has been having difficulty concentrating and sleeping, as well as thoughts of self-harm. He appears to be in a depressed mood, with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. His assessment is that he is suffering from major depressive disorder, and his symptoms are severe and interfere with his day-to-day functioning. The plan is to meet with him again in two days, have him follow his safety plan if necessary, make his family aware of his current state of mind, and refer him to a mental health professional for further assessment and treatment.
772
+
773
+ General:
774
+ Subjective
775
+ Mrs. Jones states that Julia is "doing okay." Mrs. Jones said her daughter seems to be engaging with other children in her class. Mrs. Jones said Julia is still struggling to get to sleep and that "she may need to recommence the magnesium." Despite this, Mrs. Jones states she is "not too concerned about Julia's depressive symptomatology.
776
+
777
+ Objective
778
+ Mrs. Jones thinks Julia's condition has improved.
779
+
780
+ Assessment
781
+ Julia will require ongoing treatment.
782
+
783
+ Plan
784
+ Plan to meet with Julia and Mrs. Jones next week to review mx. To continue to meet with Julia.
785
+
786
+ General:
787
+ Jerry Tylor does not have a SOAP report in this context.
788
+
789
+ General:
790
+ Subjective
791
+ Jerry Tailor is a 25-year-old male who has been experiencing symptoms of depression for the past two months. He reports feeling sad and hopeless most of the time, and has difficulty sleeping and concentrating. He has also been experiencing low energy levels and has lost interest in activities he used to enjoy. He has been having thoughts of suicide but has no plan or intent to act on them.
792
+
793
+ Objective
794
+ Jerry appears to be in a depressed mood. He has a flat affect and his speech is slow and monotone. He has poor eye contact and his body posture is slumped. He is fully orientated and his language skills are intact. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
795
+
796
+ Assessment
797
+ Jerry is exhibiting signs of major depressive disorder. His symptoms are interfering with his day-to-day functioning and require ongoing treatment and support.
798
+
799
+ Plan
800
+ 1. Meet with Jerry again in 2 days, Friday, 20th May
801
+ 2. Jerry to follow his safety plan if required
802
+ 3. Jerry to make his family aware of his current state of mind
803
+ 4. Refer Jerry to a mental health professional for further assessment and treatment
804
+
805
+ General:
806
+ Subjective
807
+ Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
808
+
809
+ Objective
810
+ Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
811
+
812
+ Assessment
813
+ Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
814
+
815
+ Plan
816
+ 1. Refer Jerry to a mental health professional for further evaluation and treatment.
817
+
818
+ 2. Provide Jerry with resources and support to help him cope with his depression.
819
+
820
+ 3. Monitor Jerry's progress and provide ongoing support.
821
+
822
+ General:
823
+ Subjective
824
+ Jerry Taylor reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling fatigued and has been having difficulty sleeping. He reports that he has been feeling hopeless and has been having thoughts of self-harm.
825
+
826
+ Objective
827
+ Jerry Taylor appears to be in a depressed mood. His speech is normal in rate, volume, and articulation. His language skills are intact. He has poor eye contact and his body posture portrays a depressed mood. He has no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. His associations are intact, and his thinking is logical. He appears to have good insight. His thought process seems to be intact, and he is fully orientated.
828
+
829
+ Assessment
830
+ Jerry Taylor presents with signs of severe depression. His behavior in this session was cooperative and attentive.
831
+
832
+ Plan
833
+ Jerry Taylor requires ongoing treatment and support. He should meet with a mental health professional again in two days. He should follow his safety plan if required. He should make his family aware of his current state of mind.
834
+
835
+ General:
836
+ Subjective
837
+ Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
838
+
839
+ Objective
840
+ Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
841
+
842
+ Assessment
843
+ Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
844
+
845
+ Plan
846
+ 1. Refer Jerry to a mental health professional for further evaluation and treatment.
847
+
848
+ 2. Provide Jerry with resources and support to help him cope with his depression.
849
+
850
+ 3. Monitor Jerry's progress and provide ongoing support.
851
+
852
+ General:
853
+ Jerry Taylor is a 25-year-old male who is reporting feeling down and out for the past few weeks. He is experiencing difficulty sleeping, irritability, anxiety, difficulty concentrating, fatigue, and thoughts of suicide.
854
+
855
+ General:
856
+ Jerry Taylor is a 25-year-old male who is reporting feeling down and out for the past few weeks. He is experiencing difficulty sleeping, irritability, anxiety, difficulty concentrating, fatigue, and thoughts of suicide.
857
+
858
+ General:
859
+ James is an individual who is exhibiting symptoms of major depressive disorder. He has reported feeling down, fatigued, hopeless, and having thoughts of self-harm. He appears to be in a depressed mood, with slow speech, slumped body posture, and poor eye contact.
860
+
861
+ General:
862
+ Jerry Taylor is a 25-year-old male who is reporting feeling down and out for the past few weeks. He is experiencing difficulty sleeping, irritability, anxiety, difficulty concentrating, fatigue, and thoughts of suicide. He appears to be in a depressed mood, with slow speech, slumped body posture, and poor eye contact. He is oriented to person, place, and time and denies any hallucinations, delusions, or other psychotic-related symptomatology. He has good insight and his thought process seems to be intact.
863
+
864
+ General:
865
+ Patient Name: John
866
+ Doctor Name: Jackson
867
+
868
+ General:
869
+ Pamela is a 56-year-old female who presented to the Emergency Department with chest pain. She reported that the pain began one week ago with an abrupt onset of dull, aching pain in the left para-sternal area that radiated up to her neck. She has had two additional episodes of similar pain since the initial episode, one while walking her dog and one that awoke her from sleep. She has not attempted any specific measures to relieve her pain other than rest. She has no associated symptoms during these episodes, including dizziness or palpitations. She becomes short of breath during the episodes but describes no other exertional dyspnea, orthopnea, or paroxysmal nocturnal dyspnea.
870
+
871
+ General:
872
+ Subjective
873
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
874
+
875
+ Objective
876
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
877
+
878
+ Assessment
879
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
880
+
881
+ Plan
882
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
883
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
884
+ 3. Enc
885
+
886
+ General:
887
+ James is an individual who is exhibiting symptoms of major depressive disorder, such as feeling down, struggling to concentrate, fatigue, difficulty sleeping, hopelessness, and thoughts of self-harm. He appears to be in a depressed mood, with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. He is fully orientated and his language skills are intact.
888
+
889
+ General:
890
+ Pamela is a 56-year-old female who presented to the Emergency Department with chest pain. She reported that the pain began one week ago with an abrupt onset of dull, aching pain in the left para-sternal area that radiated up to her neck. She has had two additional episodes of similar pain since the initial episode, one while walking her dog and one that awoke her from sleep. She has not attempted any specific measures to relieve her pain other than rest. She has no associated symptoms during these episodes, including dizziness or palpitations. She becomes short of breath during the episodes but describes no other exertional dyspnea, orthopnea, or paroxysmal nocturnal dyspnea.
891
+
892
+ General:
893
+ Charlos is a patient of Doctor John's who is exhibiting symptoms of major depressive disorder.
894
+
895
+ General:
896
+ James is an individual who is exhibiting symptoms of major depressive disorder. He has reported feeling down, fatigued, and having difficulty sleeping, as well as having thoughts of self-harm. He appears to be in a depressed mood, with slow speech and slumped body posture.
897
+
898
+ General:
899
+ Subjective
900
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
901
+
902
+ Objective
903
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
904
+
905
+ Assessment
906
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
907
+
908
+ Plan
909
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
910
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
911
+ 3. Enc
912
+
913
+ General:
914
+ Subjective
915
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
916
+
917
+ Objective
918
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
919
+
920
+ Assessment
921
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
922
+
923
+ Plan
924
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
925
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
926
+ 3. Enc
927
+
928
+ General:
929
+ Subjective
930
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
931
+
932
+ Objective
933
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
934
+
935
+ Assessment
936
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
937
+
938
+ Plan
939
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
940
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
941
+ 3. Enc
942
+
943
+ General:
944
+ Answer: The patient's name is John and the doctor's name is Jackson.
945
+
946
+ General:
947
+ Doctor: I see. I recommend that you stop drinking alcohol and using weed. These substances can weaken your immune system and make it harder for your body to fight off illnesses. In addition, I suggest that you take the medicines I prescribed and follow the instructions I gave you for taking a tepid bath.
948
+
949
+ General:
950
+ Doctor: Nothing serious. You’ve caught cold. Take these medicines. You’ll be ok. Have your bath only in tepid water for some days.
951
+
952
+ Patient: Thank you, doctor.
953
+
954
+ No, this patient has not died twice before and come back to life just yesterday. The context information does not mention anything about the patient having died twice before and coming back to life just yesterday.
955
+
956
+ General:
957
+ Doctor: Nothing serious. You’ve caught cold. Take these medicines. You’ll be ok. Have your bath only in tepid water for some days.
958
+
959
+ Patient: Thank you, doctor.
960
+
961
+ SOAP Note: Patient John presented with a high temperature of 103°C, chest pain, and a slight headache. The patient reported having done field work in a village last week and feeling sick afterwards. Doctor Jackson diagnosed the patient with a cold and prescribed medications and advised to take baths in tepid water for a few days.
962
+
963
+ General:
964
+ Subjective
965
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
966
+
967
+ Objective
968
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
969
+
970
+ Assessment
971
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
972
+
973
+ Plan
974
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
975
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
976
+ 3. Enc
977
+
978
+ General:
979
+ Subjective
980
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
981
+
982
+ Objective
983
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
984
+
985
+ Assessment
986
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
987
+
988
+ Plan
989
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
990
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
991
+ 3. Enc
992
+
993
+ General:
994
+ Subjective
995
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
996
+
997
+ Objective
998
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
999
+
1000
+ Assessment
1001
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
1002
+
1003
+ Plan
1004
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
1005
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
1006
+ 3. Enc
1007
+
1008
+ General:
1009
+ Subjective
1010
+ Charlos reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling more irritable than usual and has been having difficulty sleeping. He reports that he has been feeling more anxious than usual and has been having difficulty focusing on tasks.
1011
+
1012
+ Objective
1013
+ Charlos appears to be in a low mood. He has poor eye contact and his body language is indicative of a depressed mood. His speech is slow and his thoughts are disorganized. There are signs of severe depression, including body posture, eye contact, and attitude. The slowness of physical movement helps reveal depressive symptomatology. There are no apparent signs of hallucinations, delusions, or any other indicators of psychotic processes. Associations are intact, and thinking is logical. He appears to have good insight. The thought process seems to be intact, and Charlos is fully orientated.
1014
+
1015
+ Assessment
1016
+ Charlos presents with symptoms of major depressive disorder, which interfere with his day-to-day functioning and require ongoing treatment and support.
1017
+
1018
+ Plan
1019
+ 1. Meet with Charlos again in 2 days, Friday, 20th May
1020
+ 2. Refer Charlos to a mental health professional for further assessment and treatment.
1021
+ 3. Enc
1022
+
1023
+ General:
1024
+ James is an individual who is exhibiting symptoms of major depressive disorder. He has reported feeling down, fatigued, and having difficulty concentrating, sleeping, and having thoughts of self-harm. He appears to be in a depressed mood, with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. He is fully orientated and his language skills are intact.
1025
+
1026
+ General:
1027
+ Given the context information provided, it is likely that the 27-year-old gentleman is suffering from acute appendicitis. The symptoms he is experiencing, such as pain in the right iliac fossa, nausea, and rebound tenderness, are all indicative of appendicitis. In order to confirm the diagnosis, a full blood count, CRP, and abdominal ultrasound should be ordered. If the diagnosis is confirmed, the patient should be referred to a surgeon for an appendectomy.
1028
+
1029
+ General:
1030
+ James is an individual who is exhibiting symptoms of major depressive disorder. He has reported feeling down, fatigued, and having difficulty concentrating, sleeping, and having thoughts of self-harm. He appears to be in a depressed mood, with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. He is fully orientated and his language skills are intact.
1031
+
1032
+ General:
1033
+ This statement does not make sense given the context information provided.
1034
+
1035
+ General:
1036
+ For the preparation of Jerry Tylor's treatment, it is important to assess his medical history, including any medications he is taking, his current symptoms, and any other relevant information. It is also important to assess his mental health, including his current mood, speech, and body language. Additionally, it is important to discuss his treatment goals and any potential risks or benefits associated with the treatment.
1037
+
1038
+ General: No problem. Take care.
1039
+
Docs/James.txt CHANGED
@@ -13,3 +13,22 @@ Plan: Prescribe ibuprofen to be taken daily. If symptoms persist, return in two
13
 
14
  Regarding travel by plane, James can travel by plane as long as he takes the prescribed ibuprofen daily and follows up with his doctor if symptoms persist.
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  Regarding travel by plane, James can travel by plane as long as he takes the prescribed ibuprofen daily and follows up with his doctor if symptoms persist.
15
 
16
+ Subjective: James reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling fatigued and has been having difficulty sleeping. He reports that he has been feeling hopeless and has been having thoughts of self-harm.
17
+ Objective: James appears to be in a depressed mood. His speech is slow and his body posture is slumped. He has poor eye contact and his attitude is apathetic. He is fully orientated and his language skills are intact.
18
+ Assessment: James appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
19
+ Plan: 1. Meet with James again in 2 days, Friday, 20th May
20
+ 2. James to follow his safety plan if required
21
+ 3. James to make his family aware of his current state of mind
22
+ 4. Referral to a mental health professional for further assessment and treatment
23
+ 5. Monitor James' progress and adjust treatment plan as needed.
24
+
25
+ Subjective: James reports feeling down, struggling to concentrate, fatigued, difficulty sleeping, hopeless, and having thoughts of self-harm.
26
+ Objective: James appears to be in a depressed mood with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. He is fully orientated and his language skills are intact.
27
+ Assessment: James appears to be suffering from major depressive disorder with severe symptoms that interfere with his day-to-day functioning.
28
+ Plan: 1. Meet with James again in 2 days, Friday, 20th May. 2. James to follow his safety plan if required. 3. James to make his family aware of his current state of mind. 4. Referral to a mental health professional for further assessment and treatment.
29
+
30
+ Subjective: James reports feeling down, struggling to concentrate, fatigued, difficulty sleeping, hopeless, and having thoughts of self-harm.
31
+ Objective: James appears to be in a depressed mood with slow speech, slumped body posture, poor eye contact, and an apathetic attitude. He is fully orientated and his language skills are intact.
32
+ Assessment: James appears to be suffering from major depressive disorder with severe symptoms that interfere with his day-to-day functioning.
33
+ Plan: 1. Meet with James again in 2 days, Friday, 20th May; 2. James to follow his safety plan if required; 3. James to make his family aware of his current state of mind; 4. Referral to a mental health professional for further assessment and treatment.
34
+
Docs/Jerry.txt ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Subjective: Jerry Tylor is a 56-year-old male who presented to the emergency department with sudden onset of severe chest pain. He has a history of hypertension and type 2 diabetes, and is taking metformin 1000 mg twice daily and lisinopril 20 mg once daily.
2
+ Objective: Jerry appears to be in pain and is exhibiting signs of distress. His vital signs are as follows: blood pressure of 140/90 mmHg, heart rate of 90 bpm, respiratory rate of 18 breaths per minute, and oxygen saturation of 98%.
3
+ Assessment: Jerry is exhibiting signs of chest pain and is in need of further assessment and treatment.
4
+ Plan: 1. Administer oxygen and monitor vital signs.
5
+
6
+ 2. Obtain an electrocardiogram (ECG) and chest X-ray.
7
+
8
+ 3. Administer pain medication as needed.
9
+
10
+ 4. Refer Jerry to a cardiologist for further assessment and treatment.
11
+
12
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
13
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
14
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
15
+ Plan: Refer Jerry to a mental health professional for further evaluation and treatment. Provide Jerry with resources and support to help him cope with his depression. Monitor Jerry's progress and provide ongoing support.
16
+
17
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
18
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
19
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
20
+ Plan: Refer Jerry to a mental health professional for further evaluation and treatment. Provide Jerry with resources and support to help him cope with his depression. Monitor Jerry's progress and provide ongoing support.
21
+
22
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
23
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
24
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
25
+ Plan: 1. Refer Jerry to a mental health professional for further evaluation and treatment. 2. Provide Jerry with resources and support to help him cope with his depression. 3. Monitor Jerry's progress and provide ongoing support.
26
+
27
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
28
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
29
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
30
+ Plan: A comprehensive treatment plan should be developed to address Jerry's symptoms. This should include psychotherapy, medication management, and lifestyle modifications. Referrals to other mental health professionals and support groups should also be considered.
31
+
32
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
33
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
34
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
35
+ Plan: A comprehensive treatment plan should be developed to address Jerry's symptoms. This should include psychotherapy, medication management, and lifestyle modifications. Referrals to other mental health professionals and support groups should also be considered.
36
+
Docs/Nothing.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Subjective: Patient John reported a high temperature of 103�C last night, chest pain, and a slight headache. He also reported that he had gone to a village to do some field work on potable water and felt sick there.
2
+ Objective: Patient was observed to be seated and was asked to lie down on the bed for a chest examination.
3
+ Assessment: Patient has caught a cold.
4
+ Plan: Patient is to take prescribed medications and have baths in tepid water for a few days.
5
+
Docs/Taylor.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ General:
2
+ Answer:
3
+ Jerry Taylor is a 25-year-old male who is reporting feeling down and out for the past few weeks. He is experiencing difficulty sleeping, irritability, anxiety, difficulty concentrating, fatigue, and thoughts of suicide. He appears to be in a depressed mood, with slow speech, slumped body posture, and poor eye contact.
4
+
5
+ SOAP Note:
6
+ Subjective: Jerry Taylor is a 25-year-old male who reports feeling "down and out" for the past few weeks. He states that he has been having difficulty sleeping, and that he has been feeling more irritable and anxious than usual. He reports that he has been having difficulty concentrating and that he has been feeling more fatigued than usual. He also reports feeling hopeless and helpless, and that he has been having thoughts of suicide.
7
+
8
+ Objective: Jerry appears to be in a depressed mood. He has poor eye contact and his speech is slow and monotone. He is oriented to person, place, and time. He denies any hallucinations, delusions, or other psychotic-related symptomatology.
9
+
10
+ Assessment: Jerry appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
11
+
12
+ Plan
13
+
Docs/Tylor.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Subjective: Jerry reported sudden onset of severe chest pain.
2
+ Objective: Vital signs: Blood pressure: 140/90 mmHg, Pulse: 80 bpm, Respiratory rate: 16 breaths/min, Oxygen saturation: 98% on room air.
3
+ Assessment: Jerry is likely experiencing a cardiac event and is in need of further assessment and treatment.
4
+ Plan: 1. Administer oxygen via nasal cannula at 2L/min.
5
+
6
+ 2. Obtain an electrocardiogram (ECG) and order laboratory tests.
7
+
8
+ 3. Administer aspirin 325 mg orally.
9
+
10
+ 4. Refer Jerry to a cardiologist for further assessment and treatment.
11
+
Docs/is.txt CHANGED
@@ -16,3 +16,10 @@ Objective: James is an alert and oriented male in no acute distress. His vital s
16
  Assessment: Migraines
17
  Plan: Prescribe ibuprofen to be taken daily. If symptoms persist, return in two weeks for sumatriptan.
18
 
 
 
 
 
 
 
 
 
16
  Assessment: Migraines
17
  Plan: Prescribe ibuprofen to be taken daily. If symptoms persist, return in two weeks for sumatriptan.
18
 
19
+ Subjective: James reports that he has been feeling down and has been struggling to concentrate. He states that he has been feeling fatigued and has been having difficulty sleeping. He reports that he has been feeling hopeless and has been having thoughts of self-harm.
20
+ Objective: James appears to be in a depressed mood. His speech is slow and his body posture is slumped. He has poor eye contact and his attitude is apathetic. He is fully orientated and his language skills are intact.
21
+ Assessment: James appears to be suffering from major depressive disorder. His symptoms are severe and interfere with his day-to-day functioning.
22
+ Plan: 1. Meet with James again in 2 days, Friday, 20th May
23
+ 2. James to follow his safety plan if required
24
+ 3. James to make
25
+
GPTresponses/None.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Subjective: James presents with a chief complaint of migraines that have been occurring for approximately two to three months. He reports experiencing migraines several times a week, typically starting around 9 am and worsening until around noon. James mentions that his migraines are noticeably worse when he consumes sugary foods or drinks. He also notes occasional visual disturbances, described as sparkles that partially obstruct his vision. James states that his migraines are impacting his work.
2
+ Objective: Physical examination is unremarkable. No abnormal findings or signs of distress are observed.
3
+ Assessment: Based on the patient's history and symptoms, a diagnosis of migraines is determined. The correlation between sugar intake and worsening of migraines suggests a possible trigger for these headaches.
4
+ Plan: 1. Initiate treatment with non-steroidal anti-inflammatory drug (NSAID): Recommend daily intake of ibuprofen.
5
+ 2. Advise James to track his headache frequency and severity, as well as any potential triggers, in a headache diary.
6
+ 3. Schedule a follow-up appointment in two weeks to assess the effectiveness of the ibuprofen. If there is no improvement, consider prescribing sumatriptan.
7
+ 4. Provide education on lifestyle modifications to help manage migraines, such as avoiding trigger foods (specifically those high in sugar), practicing stress-reduction techniques, maintaining a consistent sleep schedule, and staying well-hydrated.
8
+ 5. Encourage James to seek medical attention promptly if his symptoms worsen or if additional concerns arise.
9
+
10
+ Note:
11
+ This is a tentative treatment plan based on the information provided. Further examination and discussion may be necessary for a more conclusive diagnosis and development of a comprehensive treatment strategy.
12
+ General:
13
+
app.py CHANGED
@@ -13,7 +13,7 @@ import tempfile
13
  import os
14
  import boto3
15
  from gradio import Interface, components as gr
16
- from gradio import Interface
17
  import io
18
  from scipy.io import wavfile
19
  from google.cloud import speech
@@ -45,7 +45,8 @@ def construct_index(directory_path):
45
 
46
  return index
47
 
48
- def transcribe_audio(audio, service="Google"):
 
49
  sampling_rate, audio_data = audio # unpack the tuple
50
 
51
  if audio_data.ndim > 1:
@@ -62,38 +63,32 @@ def transcribe_audio(audio, service="Google"):
62
  r = sr.Recognizer()
63
  with sr.AudioFile(fp.name) as source:
64
  audio_data = r.record(source)
65
- if service == "Google":
66
- try:
67
- text = r.recognize_google(audio_data)
68
- except sr.RequestError as e:
69
- print(f"Could not request results from Google Speech Recognition service; {e}")
70
- except sr.UnknownValueError:
71
- print("Google Speech Recognition could not understand audio")
72
- text = sent_tokenize(text)
73
- elif service == "Whisper":
74
- try:
75
- with open(fp.name, "rb") as audio_file:
76
- transcript = openai.Audio.transcribe("whisper-1", audio_file)
77
-
78
- print(transcript)
79
-
80
- conversation = [{"role": "user", "content": transcript["text"]}]
81
-
82
- response = openai.ChatCompletion.create(
83
- model="gpt-3.5-turbo",
84
- messages=conversation
85
- )
86
-
87
- print(response)
88
- text = transcript["text"]
89
-
90
- except Exception as e:
91
- print("Error with Whisper Service:", str(e))
92
- text = sent_tokenize(text)
93
  finally:
94
  os.unlink(fp.name)
95
 
96
  return text
 
 
 
97
  def get_gpt_response(input_text):
98
  try:
99
  # Check that input_text is not empty
@@ -101,7 +96,7 @@ def get_gpt_response(input_text):
101
  return "No input provided.", "", "", "", ""
102
 
103
  conversation = [
104
- {"role": "system", "content": "You are an experienced medical consultant who provides a SOAP note based on the conversation provided."},
105
  {"role": "user", "content": input_text}
106
  ]
107
  response = openai.ChatCompletion.create(
@@ -132,32 +127,36 @@ def get_gpt_response(input_text):
132
 
133
 
134
 
135
- def chatbot(input_text, input_voice, transcription_service, patient_name=None):
136
- # Check if patient_name is in index
 
137
  index = GPTSimpleVectorIndex.load_from_disk('index.json')
138
  if patient_name: # Only do the check if patient_name is not None and not an empty string
139
- patient_names = [doc['name'] for doc in index.documents] # Assuming each document is a dictionary with a 'name' field
140
  if patient_name and patient_name not in patient_names:
141
- return "Patient not found in index.", "", "", "", "", "", "", "", "", "", "", input_text # Fill the rest of the outputs with empty strings
142
  if input_voice is not None:
143
- input_text = transcribe_audio(input_voice, transcription_service)
144
 
145
  # Get a response from GPT-3.5-turbo
146
  gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, gpt_general = get_gpt_response(input_text)
147
-
 
 
 
148
  index = GPTSimpleVectorIndex.load_from_disk('index.json')
149
  response_index = index.query(input_text, response_mode="compact")
150
 
151
  soap_response = response_index.response
152
 
153
  patient_name = soap_response.split(' ')[1] if 'Subjective:' in soap_response else 'General'
154
- patient_file_path = os.path.join('/home/user/app/Docs', f"{patient_name}.txt")
155
 
156
- if all(keyword in soap_response for keyword in ["Subjective:", "Objective:", "Assessment:", "Plan:"]):
157
- s_index = soap_response.find('Subjective:')
158
- o_index = soap_response.find('Objective:')
159
- a_index = soap_response.find('Assessment:')
160
- p_index = soap_response.find('Plan:')
161
 
162
  subjective = soap_response[s_index:o_index].replace('Subjective:', '').strip()
163
  objective = soap_response[o_index:a_index].replace('Objective:', '').strip()
@@ -167,42 +166,39 @@ def chatbot(input_text, input_voice, transcription_service, patient_name=None):
167
  with open(patient_file_path, "a") as f:
168
  f.write(f"Subjective: {subjective}\nObjective: {objective}\nAssessment: {assessment}\nPlan: {plan}\n\n")
169
 
170
- output = [subjective, objective, assessment, plan, ""]
171
  else:
172
  with open(patient_file_path, "a" , encoding='utf-8') as f:
173
  f.write(f"General: {soap_response}\n\n")
174
 
175
- output = ["", "", "", "", soap_response]
176
 
177
- return *output, gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, gpt_general, input_text # return the transcribed text and the GPT response
178
- #return *output, gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, output[4] + gpt_general, input_text(this to merge the general (none SOAP) from Index and GPT)
179
 
180
- from gradio import Interface
181
- from gradio.inputs import Textbox, Audio, Radio
182
- from gradio.outputs import Textbox
 
 
183
 
184
  interface = Interface(
185
  fn=chatbot,
186
  inputs=[
187
  Textbox(label="Enter your text"),
188
  Audio(source="microphone", type="numpy", label="Speak Something"),
189
- Radio(["Google", "Whisper"], label="Choose a transcription service")
190
  ],
191
  outputs=[
192
- Textbox(label="Subjective"),
193
- Textbox(label="Objective"),
194
- Textbox(label="Assessment"),
195
- Textbox(label="Plan"),
196
- Textbox(label="General"),
197
- Textbox(label="GPT Subjective"),
198
- Textbox(label="GPT Objective"),
199
- Textbox(label="GPT Assessment"),
200
- Textbox(label="GPT Plan"),
201
- Textbox(label="GPT General"),
202
- Textbox(label="Transcribed Text"), # window for the transcribed text
203
- ],
204
-
205
  )
206
- index = construct_index('/home/user/app/Docs')
 
 
207
  interface.launch()
208
 
 
 
 
13
  import os
14
  import boto3
15
  from gradio import Interface, components as gr
16
+ from gradio import Interface, Textbox, Audio, Radio
17
  import io
18
  from scipy.io import wavfile
19
  from google.cloud import speech
 
45
 
46
  return index
47
 
48
+
49
+ def transcribe_audio(audio):
50
  sampling_rate, audio_data = audio # unpack the tuple
51
 
52
  if audio_data.ndim > 1:
 
63
  r = sr.Recognizer()
64
  with sr.AudioFile(fp.name) as source:
65
  audio_data = r.record(source)
66
+ try:
67
+ with open(fp.name, "rb") as audio_file:
68
+ transcript = openai.Audio.transcribe("whisper-1", audio_file)
69
+
70
+ print(transcript)
71
+
72
+ conversation = [{"role": "user", "content": transcript["text"]}]
73
+
74
+ response = openai.ChatCompletion.create(
75
+ model="gpt-3.5-turbo",
76
+ messages=conversation
77
+ )
78
+
79
+ print(response)
80
+ text = transcript["text"]
81
+
82
+ except Exception as e:
83
+ print("Error with Whisper Service:", str(e))
84
+ text = sent_tokenize(text)
 
 
 
 
 
 
 
 
 
85
  finally:
86
  os.unlink(fp.name)
87
 
88
  return text
89
+
90
+
91
+
92
  def get_gpt_response(input_text):
93
  try:
94
  # Check that input_text is not empty
 
96
  return "No input provided.", "", "", "", ""
97
 
98
  conversation = [
99
+ {"role": "system", "content": "You are an experienced medical consultant, provides a SOAP note based on the input provided."},
100
  {"role": "user", "content": input_text}
101
  ]
102
  response = openai.ChatCompletion.create(
 
127
 
128
 
129
 
130
+ def chatbot(input_text, input_voice, patient_name=None):
131
+
132
+ # Check if patient_name is in index
133
  index = GPTSimpleVectorIndex.load_from_disk('index.json')
134
  if patient_name: # Only do the check if patient_name is not None and not an empty string
135
+ patient_names = [doc['name'] for doc in index.documents] # Assuming each document is a dictionary with a 'name' field
136
  if patient_name and patient_name not in patient_names:
137
+ return "", "", "", "", "", "", "", "", "", "Patient not found in index.", "" # Fill the rest of the outputs with empty strings
138
  if input_voice is not None:
139
+ input_text = transcribe_audio(input_voice)
140
 
141
  # Get a response from GPT-3.5-turbo
142
  gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, gpt_general = get_gpt_response(input_text)
143
+ # Save GPT response to a file
144
+ gpt_file_path = os.path.join('C:\\SOAPWriterV01\\GPTresponses', f"{patient_name}.txt")
145
+ with open(gpt_file_path, "a") as f:
146
+ f.write(f"Subjective: {gpt_subjective}\nObjective: {gpt_objective}\nAssessment: {gpt_assessment}\nPlan: {gpt_plan}\nGeneral: {gpt_general}\n\n")
147
  index = GPTSimpleVectorIndex.load_from_disk('index.json')
148
  response_index = index.query(input_text, response_mode="compact")
149
 
150
  soap_response = response_index.response
151
 
152
  patient_name = soap_response.split(' ')[1] if 'Subjective:' in soap_response else 'General'
153
+ patient_file_path = os.path.join('C:\\SOAPWriterV01\\Docs', f"{patient_name}.txt")
154
 
155
+ if all(keyword.lower() in soap_response.lower() for keyword in ["subjective:", "objective:", "assessment:", "plan:"]):
156
+ s_index = soap_response.lower().find('subjective:')
157
+ o_index = soap_response.lower().find('objective:')
158
+ a_index = soap_response.lower().find('assessment:')
159
+ p_index = soap_response.lower().find('plan:')
160
 
161
  subjective = soap_response[s_index:o_index].replace('Subjective:', '').strip()
162
  objective = soap_response[o_index:a_index].replace('Objective:', '').strip()
 
166
  with open(patient_file_path, "a") as f:
167
  f.write(f"Subjective: {subjective}\nObjective: {objective}\nAssessment: {assessment}\nPlan: {plan}\n\n")
168
 
169
+ output = [f"Subjective: {subjective}\nObjective: {objective}\nAssessment: {assessment}\nPlan: {plan}", ""]
170
  else:
171
  with open(patient_file_path, "a" , encoding='utf-8') as f:
172
  f.write(f"General: {soap_response}\n\n")
173
 
174
+ output = ["", soap_response]
175
 
176
+ return *output, f"Subjective: {gpt_subjective}\nObjective: {gpt_objective}\nAssessment: {gpt_assessment}\nPlan: {gpt_plan}", gpt_general, input_text # return the transcribed text and the GPT response
 
177
 
178
+
179
+
180
+ from gradio import Interface, Textbox, Audio, Radio
181
+
182
+ from gradio import Interface, Textbox, Audio, Radio
183
 
184
  interface = Interface(
185
  fn=chatbot,
186
  inputs=[
187
  Textbox(label="Enter your text"),
188
  Audio(source="microphone", type="numpy", label="Speak Something"),
 
189
  ],
190
  outputs=[
191
+ Textbox(label="SOAP Output"),
192
+ Textbox(label="General Output"),
193
+ Textbox(label="GPT SOAP Output"),
194
+ Textbox(label="GPT General Output"),
195
+ Textbox(label="Transcribed Text")
196
+ ],
 
 
 
 
 
 
 
197
  )
198
+
199
+
200
+ index = construct_index('C:\\\\SOAPWriterV01\\Docs')
201
  interface.launch()
202
 
203
+
204
+
flagged/Speak Something/60c826079cfd74a9d305db51ff29bb6079c053a3/tmpjh9v20b8.wav ADDED
Binary file (964 kB). View file
 
flagged/log.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Enter your text,Speak Something,Choose a transcription service,SOAP Output,General Output,GPT SOAP Output,GPT General Output,Transcribed Text,flag,username,timestamp
2
+ ,C:\SOAPWriter\flagged\Speak Something\60c826079cfd74a9d305db51ff29bb6079c053a3\tmpjh9v20b8.wav,,,,,,,,,2023-08-02 15:33:03.620364
index.json CHANGED
The diff for this file is too large to render. See raw diff
 
requirements.txt CHANGED
@@ -10,18 +10,7 @@ SpeechRecognition
10
  scipy
11
  transformers
12
  boto3
13
- google-cloud-speech
14
  tiktoken
15
  docx2txt
16
  PyPDF2
17
  requests
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
 
10
  scipy
11
  transformers
12
  boto3
 
13
  tiktoken
14
  docx2txt
15
  PyPDF2
16
  requests