Commit
·
cd0d86b
1
Parent(s):
022a546
update: streamlit version-still working on
Browse files- paintrek-chat-v2.ipynb +55 -22
paintrek-chat-v2.ipynb
CHANGED
@@ -103,30 +103,23 @@
|
|
103 |
"text": [
|
104 |
"Executing the chatbot graph...\n",
|
105 |
"Model: Welcome to the Paintrek world. I am a health assistant, an interactive clinical recording system. I will ask you questions about your pain and related symptoms and record your responses. I will then store this information securely. At any time, you can type `q` to quit.\n",
|
106 |
-
"Model: First,
|
107 |
-
"Model: Thank you. Now, can you describe your main
|
108 |
-
"Model: Okay. Let's assess the headache. Where is the pain located?
|
109 |
-
"Model: To continue, could you provide information on your medical history, including any existing medical conditions, surgeries, medications, and
|
110 |
-
"Model: Thank you.
|
111 |
-
"Model: Could you tell me a
|
112 |
"Model: Let's do a quick systems review. Have you experienced any recent weight changes, fever, chills, night sweats, changes in sleep patterns, or any gastrointestinal or urinary issues?\n",
|
113 |
-
"Model:
|
114 |
-
"Model: Finally, let's assess the
|
115 |
-
"Model:
|
116 |
-
"Model:
|
|
|
|
|
117 |
"Your input data:\n",
|
118 |
-
"
|
119 |
-
" symptom\n",
|
120 |
-
" pain\n",
|
121 |
-
" medical_hist\n",
|
122 |
-
" family_hist\n",
|
123 |
-
" social_hist\n",
|
124 |
-
" review_system\n",
|
125 |
-
" pain_manage\n",
|
126 |
-
" functional\n",
|
127 |
-
" plan\n",
|
128 |
"Saving the data!\n",
|
129 |
-
"plan\n"
|
130 |
]
|
131 |
}
|
132 |
],
|
@@ -158,7 +151,47 @@
|
|
158 |
{
|
159 |
"data": {
|
160 |
"text/plain": [
|
161 |
-
"'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
]
|
163 |
},
|
164 |
"execution_count": 4,
|
|
|
103 |
"text": [
|
104 |
"Executing the chatbot graph...\n",
|
105 |
"Model: Welcome to the Paintrek world. I am a health assistant, an interactive clinical recording system. I will ask you questions about your pain and related symptoms and record your responses. I will then store this information securely. At any time, you can type `q` to quit.\n",
|
106 |
+
"Model: First, let's collect some basic information. What is your full name, date of birth, gender, and contact number? And could you also provide the name and contact information for someone who can be reached in case of emergency?\n",
|
107 |
+
"Model: Thank you. Now, can you describe your main complaint or the reason for your visit today? And how long have you been experiencing this?\n",
|
108 |
+
"Model: Okay. Let's assess the headache. Where exactly is the pain located? Is it on the left, right, or both sides? And on a scale of 0 to 10, with 0 being no pain and 10 being the worst pain imaginable, what would you rate the intensity? Can you describe the characteristics of the pain – is it sharp, dull, throbbing, etc.? When did it start? Does the pain radiate anywhere else? What, if anything, seems to trigger it? Are there any other symptoms associated with the headache, such as nausea, vomiting, or visual disturbances?\n",
|
109 |
+
"Model: To continue, could you please provide information on your medical history, including any existing medical conditions, when they first appeared, any surgeries you've had and when, your current medications, and any known allergies?\n",
|
110 |
+
"Model: Thank you. Now, let's move on to your family medical history. Are there any significant medical conditions that run in your family?\n",
|
111 |
+
"Model: Could you tell me a little about your social history, including your occupation, your living situation, and whether you smoke, drink alcohol, or use drugs? Also, who is in your support system?\n",
|
112 |
"Model: Let's do a quick systems review. Have you experienced any recent weight changes, fever, chills, night sweats, changes in sleep patterns, or any gastrointestinal or urinary issues?\n",
|
113 |
+
"Model: Now, regarding pain management, what pain medications are you currently using, have you consulted any specialists for your pain, have you tried any alternative therapies, and if so, how effective have they been?\n",
|
114 |
+
"Model: Finally, let's assess the impact of your headache on your daily life. How has it affected your quality of life, your ability to perform activities, and your mood or emotional state?\n",
|
115 |
+
"Model: What are your treatment goals for this headache? What are your expectations for treatment, and are there any alternative treatments you'd like to consider?\n",
|
116 |
+
"Model: To summarize: You are Frank, born on 01/01/1986, experiencing a sharp headache on the right side of your head for two days, rated at a 2 on a scale of 0-10. The pain is triggered by cold. You have a history of sinusitis diagnosed in 2001. Your mother had lung cancer at age 45. You are a data scientist, and do not smoke or drink alcohol. You sleep well and have no other symptoms. You are currently taking ibuprofen. You have not seen a specialist for this headache nor tried alternative therapies. Your mood and quality of life are currently good, but you want your headache resolved.\n",
|
117 |
+
"\n",
|
118 |
+
"Is this information correct?\n",
|
119 |
"Your input data:\n",
|
120 |
+
"{'ID': {'name': 'Frank', 'DOB': '1986-01-01', 'gender': 'male', 'contact': '12345', 'emergency_contact': 'Zoe, 67890'}, 'symptom': {'main_symptom': 'headache', 'symptom_length': 'two days'}, 'pain': {'pain_location': 'right head', 'pain_side': 'right', 'pain_intensity': 2.0, 'pain_description': 'sharp', 'start_time': '2 days ago', 'radiation': False, 'triggers': 'cold', 'symptom': 'None'}, 'medical_hist': {'medical_condition': 'sinus', 'first_time': '2001-01-01', 'surgery_history': 'None', 'medication': 'ibprofin', 'allergy': 'None'}, 'family_hist': {'family_history': 'Mother had lung cancer at 45'}, 'social_hist': {'occupation': 'data scientist', 'smoke': False, 'alcohol': False, 'drug': False, 'support_system': 'medium stress level', 'living_condition': 'viggie'}, 'review_system': {'weight_change': 'None', 'fever': False, 'chill': False, 'night_sweats': False, 'sleep': 'well', 'gastrointestinal': 'None', 'urinary': 'None'}, 'pain_manage': {'pain_medication': 'None', 'specialist': False, 'other_therapy': 'None', 'effectiveness': False}, 'functional': {'life_quality': 'good', 'limit_activity': 'None', 'mood': 'okay'}, 'plan': {'goal': '', 'expectation': '', 'alternative_treatment': ''}}\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
"Saving the data!\n",
|
122 |
+
"{'ID': {'name': 'Frank', 'DOB': '1986-01-01', 'gender': 'male', 'contact': '12345', 'emergency_contact': 'Zoe, 67890'}, 'symptom': {'main_symptom': 'headache', 'symptom_length': 'two days'}, 'pain': {'pain_location': 'right head', 'pain_side': 'right', 'pain_intensity': 2.0, 'pain_description': 'sharp', 'start_time': '2 days ago', 'radiation': False, 'triggers': 'cold', 'symptom': 'None'}, 'medical_hist': {'medical_condition': 'sinus', 'first_time': '2001-01-01', 'surgery_history': 'None', 'medication': 'ibprofin', 'allergy': 'None'}, 'family_hist': {'family_history': 'Mother had lung cancer at 45'}, 'social_hist': {'occupation': 'data scientist', 'smoke': False, 'alcohol': False, 'drug': False, 'support_system': 'medium stress level', 'living_condition': 'viggie'}, 'review_system': {'weight_change': 'None', 'fever': False, 'chill': False, 'night_sweats': False, 'sleep': 'well', 'gastrointestinal': 'None', 'urinary': 'None'}, 'pain_manage': {'pain_medication': 'None', 'specialist': False, 'other_therapy': 'None', 'effectiveness': False}, 'functional': {'life_quality': 'good', 'limit_activity': 'None', 'mood': 'okay'}, 'plan': {'goal': '', 'expectation': '', 'alternative_treatment': ''}}\n"
|
123 |
]
|
124 |
}
|
125 |
],
|
|
|
151 |
{
|
152 |
"data": {
|
153 |
"text/plain": [
|
154 |
+
"{'ID': {'name': 'Frank',\n",
|
155 |
+
" 'DOB': '1986-01-01',\n",
|
156 |
+
" 'gender': 'male',\n",
|
157 |
+
" 'contact': '12345',\n",
|
158 |
+
" 'emergency_contact': 'Zoe, 67890'},\n",
|
159 |
+
" 'symptom': {'main_symptom': 'headache', 'symptom_length': 'two days'},\n",
|
160 |
+
" 'pain': {'pain_location': 'right head',\n",
|
161 |
+
" 'pain_side': 'right',\n",
|
162 |
+
" 'pain_intensity': 2.0,\n",
|
163 |
+
" 'pain_description': 'sharp',\n",
|
164 |
+
" 'start_time': '2 days ago',\n",
|
165 |
+
" 'radiation': False,\n",
|
166 |
+
" 'triggers': 'cold',\n",
|
167 |
+
" 'symptom': 'None'},\n",
|
168 |
+
" 'medical_hist': {'medical_condition': 'sinus',\n",
|
169 |
+
" 'first_time': '2001-01-01',\n",
|
170 |
+
" 'surgery_history': 'None',\n",
|
171 |
+
" 'medication': 'ibprofin',\n",
|
172 |
+
" 'allergy': 'None'},\n",
|
173 |
+
" 'family_hist': {'family_history': 'Mother had lung cancer at 45'},\n",
|
174 |
+
" 'social_hist': {'occupation': 'data scientist',\n",
|
175 |
+
" 'smoke': False,\n",
|
176 |
+
" 'alcohol': False,\n",
|
177 |
+
" 'drug': False,\n",
|
178 |
+
" 'support_system': 'medium stress level',\n",
|
179 |
+
" 'living_condition': 'viggie'},\n",
|
180 |
+
" 'review_system': {'weight_change': 'None',\n",
|
181 |
+
" 'fever': False,\n",
|
182 |
+
" 'chill': False,\n",
|
183 |
+
" 'night_sweats': False,\n",
|
184 |
+
" 'sleep': 'well',\n",
|
185 |
+
" 'gastrointestinal': 'None',\n",
|
186 |
+
" 'urinary': 'None'},\n",
|
187 |
+
" 'pain_manage': {'pain_medication': 'None',\n",
|
188 |
+
" 'specialist': False,\n",
|
189 |
+
" 'other_therapy': 'None',\n",
|
190 |
+
" 'effectiveness': False},\n",
|
191 |
+
" 'functional': {'life_quality': 'good',\n",
|
192 |
+
" 'limit_activity': 'None',\n",
|
193 |
+
" 'mood': 'okay'},\n",
|
194 |
+
" 'plan': {'goal': '', 'expectation': '', 'alternative_treatment': ''}}"
|
195 |
]
|
196 |
},
|
197 |
"execution_count": 4,
|