{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyMDLjaskMEKYEiWsCQl9CYh"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"},"widgets":{"application/vnd.jupyter.widget-state+json":{"30d992ddb3a24503977ddfa7f0b60c05":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_5afd9152fab54e5da8db250c75bd08b6","IPY_MODEL_4b8c597d809d4e25b62e779df7f3c71d","IPY_MODEL_2ca0a8f6367c4944bf9b62756c287dbc"],"layout":"IPY_MODEL_5c2d8bdc8ba8497193990681714a26b8"}},"5afd9152fab54e5da8db250c75bd08b6":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_367caee4736c4fbaaab5fbcc952aba19","placeholder":"​","style":"IPY_MODEL_9f0f0fa8861b4929aa133e4ef71da775","value":"Loading weights: 100%"}},"4b8c597d809d4e25b62e779df7f3c71d":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_5779ec7a0766424db8ae122ced12f056","max":102,"min":0,"orientation":"horizontal","style":"IPY_MODEL_5300b1b2e97c42209ed6414542867724","value":102}},"2ca0a8f6367c4944bf9b62756c287dbc":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_924afe989e554603a28ea3dbf77b8d7d","placeholder":"​","style":"IPY_MODEL_b0d5293e1ff5409bb3a87ae6461fbca8","value":" 102/102 [00:01<00:00, 107.42it/s, Materializing param=qa_outputs.weight]"}},"5c2d8bdc8ba8497193990681714a26b8":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"367caee4736c4fbaaab5fbcc952aba19":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9f0f0fa8861b4929aa133e4ef71da775":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"5779ec7a0766424db8ae122ced12f056":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"5300b1b2e97c42209ed6414542867724":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"924afe989e554603a28ea3dbf77b8d7d":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"b0d5293e1ff5409bb3a87ae6461fbca8":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}}}}},"cells":[{"cell_type":"markdown","source":["Install and Import Transformers & Gradio\n"],"metadata":{"id":"qHg18TkYvg_Z"}},{"cell_type":"code","execution_count":358,"metadata":{"id":"wFTaipZ6u3-K","executionInfo":{"status":"ok","timestamp":1775609323532,"user_tz":240,"elapsed":6863,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"outputs":[],"source":["# Install and import\n","!pip install -q gradio datasets transformers\n","from datasets import load_dataset\n","from transformers import pipeline\n","import gradio as gr\n"]},{"cell_type":"markdown","source":["Load clinical note data"],"metadata":{"id":"t01ciTyuye1x"}},{"cell_type":"code","source":["# Print the columns in this dataset and a sample entry.\n","from datasets import load_dataset\n","ds = load_dataset(\"AGBonnet/augmented-clinical-notes\")\n"],"metadata":{"id":"9TAqXmpuyydg","executionInfo":{"status":"ok","timestamp":1775609324271,"user_tz":240,"elapsed":736,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":359,"outputs":[]},{"cell_type":"markdown","source":["(Optional) View the Columns in the loaded dataset"],"metadata":{"id":"i8mXndc6Hyng"}},{"cell_type":"code","source":["# print(\"Columns:\", ds['train'].column_names)\n","\n","# # Print truncated example to review contents.\n","# for k in ds['train'].column_names:\n","# print(k, \":\", str(ds['train'][0][k])[:400], \"\\n---\")"],"metadata":{"id":"IIXuf4YyHxRr","executionInfo":{"status":"ok","timestamp":1775609324345,"user_tz":240,"elapsed":48,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":360,"outputs":[]},{"cell_type":"code","source":["# Loads the JSON column and indicates whether the JSON was valid. Some records contain invalid JSON formatting.\n","def load_json_with_status(raw):\n"," import json\n"," try:\n"," parsed = json.loads(raw)\n"," return True, parsed\n"," except:\n"," return False, raw\n"],"metadata":{"id":"-GT68a4LqhkY","executionInfo":{"status":"ok","timestamp":1775609324354,"user_tz":240,"elapsed":2,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":361,"outputs":[]},{"cell_type":"markdown","source":["View samples of Clinical Notes"],"metadata":{"id":"mIBTAy9TYc0Y"}},{"cell_type":"code","source":["train = ds[\"train\"]\n","\n","# Sample up to 25 of today's patients since we never have more than that per day.\n","sampleLengthTrain = min(25, len(ds['train']))\n","print(\"length=\", sampleLengthTrain)\n","patientSample = {} # Dictionary keyed by patient ID\n","\n","for i in range(sampleLengthTrain):\n","\n"," # A JSON summary contains multiple sections describing the patient's problem and the prescribed tests.\n"," patientJsonSummaryStr = ds['train'][i]['summary']\n"," patientIdx = ds['train'][i]['idx']\n"," patientNote = ds['train'][i]['note']\n"," success, parsedJsonSummary = load_json_with_status(patientJsonSummaryStr);\n","\n"," # Only if the JSON parsing succeeded do we load this record.\n"," if success:\n"," motivation = parsedJsonSummary['visit motivation']\n"," discharge = parsedJsonSummary['discharge']\n"," treatments = parsedJsonSummary['treatments']\n"," patientSample[patientIdx] = {'note': patientNote, 'visit motivation': motivation, 'summary': parsedJsonSummary, 'discharge': discharge, 'treatments': treatments}\n"," #(DEBUG ONLY) #print(\"idx:\", ds['train'][i]['idx'], \"summary:\", repr(str(patientJsonSummaryStr)))\n","\n"," # otherwise, skip the record with invalid JSON.\n","print(\"Done. patientSample=\", len(patientSample))"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"hYGVUApvxp6q","executionInfo":{"status":"ok","timestamp":1775609324492,"user_tz":240,"elapsed":113,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}},"outputId":"77c38a59-6fad-4238-f158-c471a23b565f"},"execution_count":362,"outputs":[{"output_type":"stream","name":"stdout","text":["length= 25\n","Done. patientSample= 19\n"]}]},{"cell_type":"markdown","source":["(Optional) See the contents of the loaded dictionary."],"metadata":{"id":"TCKYUOJ5gkQe"}},{"cell_type":"code","source":["# See the dictionary values.\n","for key, value in patientSample.items():\n"," print(f\"Key: {key}\")\n"," print(f\"Value: {value}\")\n"," print(\"---\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"9QQzEnx2VbAZ","executionInfo":{"status":"ok","timestamp":1775609324738,"user_tz":240,"elapsed":211,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}},"outputId":"f10ffc0d-8f16-440c-8c9f-04b19ae4141c"},"execution_count":363,"outputs":[{"output_type":"stream","name":"stdout","text":["Key: 155216\n","Value: {'note': 'A a sixteen year-old girl, presented to our Outpatient department with the complaints of discomfort in the neck and lower back as well as restriction of body movements. She was not able to maintain an erect posture and would tend to fall on either side while standing up from a sitting position. She would keep her head turned to the right and upwards due to the sustained contraction of the neck muscles. There was a sideways bending of the back in the lumbar region. To counter the abnormal positioning of the back and neck, she would keep her limbs in a specific position to allow her body weight to be supported. Due to the restrictions with the body movements at the neck and in the lumbar region, she would require assistance in standing and walking. She would require her parents to help her with daily chores, including all activities of self-care.\\nShe had been experiencing these difficulties for the past four months since when she was introduced to olanzapine tablets for the control of her exacerbated mental illness. This was not her first experience with this drug over the past seven years since she had been diagnosed with bipolar affective disorder. Her first episode of the affective disorder was that of mania at the age of eleven which was managed with the use of olanzapine tablets in 2.5–10 mg doses per day at different times. The patient developed pain and discomfort in her neck within the second week of being put on tablet olanzapine at a dose of 5 mg per day. This was associated with a sustained and abnormal contraction of the neck muscles that would pull her head to the right in an upward direction. These features had persisted for the first three years of her illness with a varying intensity, distress, and dysfunction which would tend to correlate with the dose of olanzapine. Apart from a brief period of around three weeks when she was given tablet trihexyphenidyl 4 mg per day for rigidity in her upper limbs, she was not prescribed any other psychotropic medication. The rigidity showed good response to this medication which was subsequently', 'visit motivation': 'Discomfort in the neck and lower back, restriction of body movements, inability to maintain an erect posture, and requiring assistance in standing and walking.', 'summary': {'visit motivation': 'Discomfort in the neck and lower back, restriction of body movements, inability to maintain an erect posture, and requiring assistance in standing and walking.', 'admission': [{'reason': 'None', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': 'Sixteen years old', 'sex': 'Female', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'Diagnosed with bipolar affective disorder at the age of eleven, first episode was that of mania.', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'None', 'Type': 'None', 'time': 'None', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Discomfort in the neck and lower back, restriction of body movements, inability to maintain an erect posture', 'intensity of symptom': 'None', 'location': 'Neck and lower back', 'time': 'Past four months', 'temporalisation': 'None', 'behaviours affecting the symptom': 'Standing up from a sitting position', 'details': 'Head turned to the right and upwards due to sustained contraction of neck muscles, sideways bending of the back in the lumbar region, limbs positioned to support body weight.'}], 'medical examinations': [{'name': 'None', 'result': 'None', 'details': 'None'}], 'diagnosis tests': [{'test': 'None', 'severity': 'None', 'result': 'None', 'condition': 'None', 'time': 'None', 'details': 'None'}], 'treatments': [{'name': 'Olanzapine tablets', 'related condition': 'Bipolar affective disorder', 'dosage': '5 mg per day', 'time': 'Past four months', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'Control of exacerbated mental illness', 'reaction to treatment': 'Pain and discomfort in neck, sustained and abnormal contraction of neck muscles, requiring assistance in daily chores', 'details': 'Previously managed with olanzapine tablets in 2.5–10 mg doses per day at different times over the past seven years.'}, {'name': 'Trihexyphenidyl', 'related condition': 'Rigidity in upper limbs', 'dosage': '4 mg per day', 'time': 'Brief period of around three weeks', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'Rigidity in upper limbs', 'reaction to treatment': 'Good response', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Olanzapine tablets', 'related condition': 'Bipolar affective disorder', 'dosage': '5 mg per day', 'time': 'Past four months', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'Control of exacerbated mental illness', 'reaction to treatment': 'Pain and discomfort in neck, sustained and abnormal contraction of neck muscles, requiring assistance in daily chores', 'details': 'Previously managed with olanzapine tablets in 2.5–10 mg doses per day at different times over the past seven years.'}, {'name': 'Trihexyphenidyl', 'related condition': 'Rigidity in upper limbs', 'dosage': '4 mg per day', 'time': 'Brief period of around three weeks', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'Rigidity in upper limbs', 'reaction to treatment': 'Good response', 'details': 'None'}]}\n","---\n","Key: 133948\n","Value: {'note': 'A 36-year old female patient visited our hospital with a chief complaint of pain and restricted range of motion (ROM) in the left hip joint persisting for two months. Physical examination of the patient revealed severe gait disturbance secondary to hip pain aggravated by hip joint flexion or rotation. The patient had no lifestyle habits or specific comorbidities thought to cause femoral head AVN. An anteroposterior view of the left hip revealed sclerosis and collapse of the femoral head and dysplasia of the hip (). The magnetic resonance imaging (MRI) scan revealed an increased amount of joint fluid and bone marrow edema in the left hip, and femoral head necrosis was detected on the contralateral side; however, the patient did not complain of any pain (). The patient underwent THA after being diagnosed with idiopathic osteonecrosis of the femoral head, was discharged in good condition three weeks after the surgery without specific complications, and followed up via regular outpatient visits. The patient complained of pain and limited ROM in the contralateral hip joint and gait disturbance one year after the initial surgery. Her symptoms continued for two months and increased over the following three weeks. Repeat MRI revealed similar findings to those noted previously in the left hip (). A second THA was performed (one year after the first THA of the left hip); the patient was discharged in good condition after the surgery without specific complications and followed up via regular outpatient visits (). At the time of the second surgery, the patient was 7 kg heavier than she was at the time of the first procedure and developed a moderate moon face, signs that were initially overlooked as weight gain. Subsequently, the patient complained of intensifying feelings of helplessness and central obesity and muscle mass reduction in both the upper and lower limbs aggravated over a three-month period of outpatient follow-up after the second surgery. However, these signs were not significant enough to warrant further investigation. One year after the second surgery, the patient was referred to the Department of Cardiology in our hospital due to a progressive worsening of central', 'visit motivation': 'Pain and restricted range of motion in the left hip joint', 'summary': {'visit motivation': 'Pain and restricted range of motion in the left hip joint', 'admission': [{'reason': 'Idiopathic osteonecrosis of the femoral head', 'date': 'None', 'duration': 'Three weeks', 'care center details': 'None'}, {'reason': 'Pain and limited ROM in the contralateral hip joint and gait disturbance', 'date': 'One year after the initial surgery', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '36 years old', 'sex': 'Female', 'ethnicity': 'None', 'weight': '7 kg heavier than at the time of the first procedure', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'Intensifying feelings of helplessness', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Idiopathic osteonecrosis of the femoral head', 'Type': 'Total Hip Arthroplasty (THA)', 'time': 'After diagnosis', 'outcome': 'Discharged in good condition without specific complications', 'details': 'First THA on the left hip'}, {'reason': 'Pain and limited ROM in the contralateral hip joint', 'Type': 'Total Hip Arthroplasty (THA)', 'time': 'One year after the first THA', 'outcome': 'Discharged in good condition without specific complications', 'details': 'Second THA on the contralateral hip'}], 'symptoms': [{'name of symptom': 'Pain', 'intensity of symptom': 'Severe', 'location': 'Left hip joint', 'time': 'Persisting for two months', 'temporalisation': 'Increased over the following three weeks', 'behaviours affecting the symptom': 'Aggravated by hip joint flexion or rotation', 'details': 'Also complained of pain and limited ROM in the contralateral hip joint one year after initial surgery'}, {'name of symptom': 'Restricted range of motion', 'intensity of symptom': 'None', 'location': 'Left hip joint', 'time': 'Persisting for two months', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'None'}, {'name of symptom': 'Gait disturbance', 'intensity of symptom': 'Severe', 'location': 'None', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'Secondary to hip pain', 'details': 'Continued for two months and increased over the following three weeks'}, {'name of symptom': 'Moderate moon face', 'intensity of symptom': 'Moderate', 'location': 'Face', 'time': 'At the time of the second surgery', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Initially overlooked as weight gain'}, {'name of symptom': 'Central obesity', 'intensity of symptom': 'None', 'location': 'Central body', 'time': 'Aggravated over a three-month period of outpatient follow-up after the second surgery', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'None'}, {'name of symptom': 'Muscle mass reduction', 'intensity of symptom': 'None', 'location': 'Both the upper and lower limbs', 'time': 'Aggravated over a three-month period of outpatient follow-up after the second surgery', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'None'}], 'medical examinations': [{'name': 'Physical examination', 'result': 'Severe gait disturbance secondary to hip pain', 'details': 'Aggravated by hip joint flexion or rotation'}, {'name': 'Anteroposterior view of the left hip', 'result': 'Sclerosis and collapse of the femoral head and dysplasia of the hip', 'details': 'None'}], 'diagnosis tests': [{'test': 'Magnetic resonance imaging (MRI) scan', 'severity': 'None', 'result': 'Increased amount of joint fluid and bone marrow edema in the left hip, and femoral head necrosis on the contralateral side', 'condition': 'Idiopathic osteonecrosis of the femoral head', 'time': 'None', 'details': 'Patient did not complain of any pain on the contralateral side at the time of the first MRI'}, {'test': 'Repeat MRI', 'severity': 'None', 'result': 'Similar findings to those noted previously in the left hip', 'condition': 'None', 'time': 'One year after the initial surgery and symptoms continued for two months and increased over the following three weeks', 'details': 'None'}], 'treatments': 'None', 'discharge': {'reason': 'Good condition post-surgery', 'referral': 'Referred to the Department of Cardiology due to a progressive worsening of central', 'follow up': 'Regular outpatient visits', 'discharge summary': 'Discharged in good condition after both surgeries without specific complications'}}, 'discharge': {'reason': 'Good condition post-surgery', 'referral': 'Referred to the Department of Cardiology due to a progressive worsening of central', 'follow up': 'Regular outpatient visits', 'discharge summary': 'Discharged in good condition after both surgeries without specific complications'}, 'treatments': 'None'}\n","---\n","Key: 80176\n","Value: {'note': \"A 49-year-old male presented with a complaint of pain in the left proximal forearm after a fall. The patient had a history of left elbow arthrodesis performed for posttraumatic arthritis at the age of 18. On physical examination he was tender at the proximal ulna. He had no active flexion or extension at his elbow, which was fused at 90 degrees but achieved 40 degrees of pronation and 60 degrees of supination. His motor and sensory exam was normal at the hand. Radiographs of the forearm and the elbow revealed an elbow arthrodesis at 90 degrees with retained hardware and a minimally displaced proximal ulnar shaft fracture (). A decision was made to treat his ulnar shaft fracture closed in a cast, and he subsequently developed a hypertrophic nonunion. At his clinic visit three months after the fall, surgical options for the ulna nonunion were discussed with the patient. We proceeded with conservative treatment for an additional three months, with worsening motion through the nonunion site. He revealed that he was unhappy with the functional limitations of his elbow arthrodesis and inquired about the possibility of converting it to an arthroplasty. The risks of elbow arthroplasty were discussed with the patient at length. Increasing the functional capacity of his arm was his ultimate goal, and understanding that he faced a likely operation for the ulna nonunion, the patient wished to proceed. Due to the patient's prior surgery and history of trauma, as well as risk of infection, we chose to avoid multiple surgeries and combine the repair of nonunion and the conversion of elbow arthrodesis to arthroplasty into one procedure. The stem of the ulnar component would thus act as an intramedullary device.\\nIn the operating room the patient was placed in a supine position and a posterior incision centered over the elbow was performed. A prior muscle flap that was used for soft tissue coverage at his index procedure had to be elevated. The ulnar nerve was encased in scar tissue and required a meticulous neuroplasty. A triceps splitting approach to the elbow joint was then performed and multiple buried pins\", 'visit motivation': 'Pain in the left proximal forearm after a fall', 'summary': {'visit motivation': 'Pain in the left proximal forearm after a fall', 'admission': [{'reason': 'None', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '49', 'sex': 'male', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'History of left elbow arthrodesis performed for posttraumatic arthritis at the age of 18', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Posttraumatic arthritis', 'Type': 'Left elbow arthrodesis', 'time': 'At the age of 18', 'outcome': 'None', 'details': 'Elbow was fused at 90 degrees'}, {'reason': 'Hypertrophic nonunion of ulnar shaft fracture and functional limitations of elbow arthrodesis', 'Type': 'Repair of nonunion and conversion of elbow arthrodesis to arthroplasty', 'time': 'Three months after the fall and subsequent conservative treatment period', 'outcome': 'None', 'details': 'The stem of the ulnar component would act as an intramedullary device'}], 'symptoms': [{'name of symptom': 'Pain', 'intensity of symptom': 'None', 'location': 'Left proximal forearm', 'time': 'After a fall', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Patient was tender at the proximal ulna'}], 'medical examinations': [{'name': 'Physical examination', 'result': 'No active flexion or extension at elbow, 40 degrees of pronation, 60 degrees of supination, normal motor and sensory exam at the hand', 'details': 'Elbow was fused at 90 degrees'}], 'diagnosis tests': [{'test': 'Radiographs', 'severity': 'Minimally displaced', 'result': 'Proximal ulnar shaft fracture', 'condition': 'Proximal ulnar shaft fracture, hypertrophic nonunion', 'time': 'None', 'details': 'Elbow arthrodesis at 90 degrees with retained hardware was also noted'}], 'treatments': [{'name': 'Closed treatment in a cast', 'related condition': 'Proximal ulnar shaft fracture', 'dosage': 'None', 'time': 'Initially after the fall', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To treat the ulnar shaft fracture', 'reaction to treatment': 'Developed a hypertrophic nonunion', 'details': 'None'}, {'name': 'Conservative treatment', 'related condition': 'Ulna nonunion', 'dosage': 'None', 'time': 'Three months after the fall', 'frequency': 'None', 'duration': 'An additional three months', 'reason for taking': 'To treat the ulna nonunion', 'reaction to treatment': 'Worsening motion through the nonunion site', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Closed treatment in a cast', 'related condition': 'Proximal ulnar shaft fracture', 'dosage': 'None', 'time': 'Initially after the fall', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To treat the ulnar shaft fracture', 'reaction to treatment': 'Developed a hypertrophic nonunion', 'details': 'None'}, {'name': 'Conservative treatment', 'related condition': 'Ulna nonunion', 'dosage': 'None', 'time': 'Three months after the fall', 'frequency': 'None', 'duration': 'An additional three months', 'reason for taking': 'To treat the ulna nonunion', 'reaction to treatment': 'Worsening motion through the nonunion site', 'details': 'None'}]}\n","---\n","Key: 72232\n","Value: {'note': 'A 47-year-old male patient was referred to the rheumatology clinic because of recurrent attacks of pain in both knees over 1 year.\\nIn September 2016, the patient presented with severe pain over the medial aspect of the left knee for a two-week duration which prevented him from ambulation. The pain increased with weight-bearing physical activity. The patient reported no history of trauma before the onset of the knee pain. Examination showed severe tenderness over the medial side of the knee with mild effusion and moderate limitation of range of motion. There was no erythema or increased warmth of the knee. MRI of the left knee showed a moderate-sized focal area of marrow edema/contusion involving the medial femoral condyle in mid and anterior parts predominantly along the articular surface. The patient was prescribed diclofenac sodium 50 mg twice daily and was advised to avoid prolonged weight-bearing activities. Over the next few weeks, the pain subsided and resolved. Three months later, the patient developed spontaneous new onset of pain involving the lateral aspect of the same knee. MRI showed bone marrow edema involving the lateral femoral condyle with complete resolution of the bone marrow edema of the medial femoral condyle. He was treated conservatively with NSAIDs and physiotherapy and advised to use cane to minimize weight bearing on the diseased knee. demonstrates MRI of the left knee in September 2016 and three months later.\\nIn April 2017, the patient developed gradual pain over the medial side of the right knee with no obvious swelling. MRI of the right knee showed a moderate-sized focal area of marrow edema involving the medial tibial plateau medially and anteriorly. The patient was treated conservatively in a similar fashion to the previous episode. Four months later, the pain got more severe for which he underwent another MRI of the right knee which showed extensive marrow edema involving the medial femoral condyle with complete recovery of the medial tibial plateau bone marrow edema noted in the previous MRI (). The patient also recalled a similar pain happened in 2011 to the left knee but did not do MRI at', 'visit motivation': 'Recurrent attacks of pain in both knees over 1 year', 'summary': {'visit motivation': 'Recurrent attacks of pain in both knees over 1 year', 'admission': [{'reason': 'None', 'date': 'None', 'duration': 'None', 'care center details': 'Rheumatology clinic'}], 'patient information': {'age': '47', 'sex': 'Male', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'None', 'Type': 'None', 'time': 'None', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Pain', 'intensity of symptom': 'Severe', 'location': 'Medial aspect of the left knee, lateral aspect of the left knee, medial side of the right knee', 'time': 'Over 1 year', 'temporalisation': 'Recurrent attacks', 'behaviours affecting the symptom': 'Increased with weight-bearing physical activity', 'details': 'Prevented ambulation, no history of trauma, mild effusion, moderate limitation of range of motion, no erythema or increased warmth'}], 'medical examinations': [{'name': 'Examination', 'result': 'Severe tenderness over the medial side of the knee with mild effusion and moderate limitation of range of motion', 'details': 'No erythema or increased warmth of the knee'}], 'diagnosis tests': [{'test': 'MRI', 'severity': 'Moderate-sized', 'result': 'Focal area of marrow edema/contusion involving the medial femoral condyle, bone marrow edema involving the lateral femoral condyle, extensive marrow edema involving the medial femoral condyle', 'condition': 'Bone marrow edema', 'time': 'September 2016, three months later, April 2017, four months later', 'details': 'Involvement of medial femoral condyle in mid and anterior parts predominantly along the articular surface, complete resolution of the bone marrow edema of the medial femoral condyle, involvement of the medial tibial plateau medially and anteriorly, complete recovery of the medial tibial plateau bone marrow edema'}], 'treatments': [{'name': 'Diclofenac sodium', 'related condition': 'Bone marrow edema', 'dosage': '50 mg', 'time': 'September 2016', 'frequency': 'Twice daily', 'duration': 'None', 'reason for taking': 'To treat knee pain', 'reaction to treatment': 'Pain subsided and resolved', 'details': 'Advised to avoid prolonged weight-bearing activities'}, {'name': 'NSAIDs and physiotherapy', 'related condition': 'Bone marrow edema', 'dosage': 'None', 'time': 'Three months after September 2016', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for new onset of pain involving the lateral aspect of the left knee', 'reaction to treatment': 'None', 'details': 'Advised to use cane to minimize weight bearing on the diseased knee'}, {'name': 'Conservative treatment', 'related condition': 'Bone marrow edema', 'dosage': 'None', 'time': 'April 2017', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for gradual pain over the medial side of the right knee', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Diclofenac sodium', 'related condition': 'Bone marrow edema', 'dosage': '50 mg', 'time': 'September 2016', 'frequency': 'Twice daily', 'duration': 'None', 'reason for taking': 'To treat knee pain', 'reaction to treatment': 'Pain subsided and resolved', 'details': 'Advised to avoid prolonged weight-bearing activities'}, {'name': 'NSAIDs and physiotherapy', 'related condition': 'Bone marrow edema', 'dosage': 'None', 'time': 'Three months after September 2016', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for new onset of pain involving the lateral aspect of the left knee', 'reaction to treatment': 'None', 'details': 'Advised to use cane to minimize weight bearing on the diseased knee'}, {'name': 'Conservative treatment', 'related condition': 'Bone marrow edema', 'dosage': 'None', 'time': 'April 2017', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for gradual pain over the medial side of the right knee', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 31864\n","Value: {'note': 'A 24-year-old Yemeni female presented to the endocrinology clinic in April 2017 because of inability to walk and a long history of osteomalacia. She was unable to walk for the last 4 years with severe weakness and bone pain. She reported that for the last 2 years she was so weak that she could not turn over in bed and this was associated with pain all over her body. Her condition started as a baby as she did not walk till she was 2.5 years old. Then when she started school she stated she could walk but could never run, the family was poor and never sought medical help for her condition. She got married at a young age of 15 and became pregnant soon after that. During her pregnancy she had difficulty in walking and had pain in her legs, she needed assistance to rise from the sitting position and she was told she would need a cesarean section because she had a contracted pelvis, but she went into labor before she was able to have a cesarean section and she delivered vaginally and developed a fracture of the pubic rami during delivery.\\nHer condition over the following years worsened and she was having more difficulty in walking and needed assistance in climbing stairs. She went to several orthopedic surgeons and she was diagnosed as osteomalacia and given calcium and vitamin D without any improvement, till she became totally bedridden. At one time she was also given calcitriol in small doses and for short periods of time 0.25 mg daily. She eventually stopped all treatments when she did not see any improvement in her condition. She was also seen by a neurologist and was found to have a normal nerve conduction study and was told there was no evidence of neurological disease.\\nShe has no family history of a similar condition in her parents or siblings or other relatives.\\nAt her initial presentation, physical examination of the patient showed that she was 144 cm tall and weighed 49 kg, she was much shorter than the rest of her family. She', 'visit motivation': 'Inability to walk and a long history of osteomalacia', 'summary': {'visit motivation': 'Inability to walk and a long history of osteomalacia', 'admission': [{'reason': 'None', 'date': 'None', 'duration': 'None', 'care center details': 'Endocrinology clinic'}], 'patient information': {'age': '24 years', 'sex': 'Female', 'ethnicity': 'Yemeni', 'weight': '49 kg', 'height': '144 cm', 'family medical history': 'No family history of a similar condition', 'recent travels': 'None', 'socio economic context': 'Family was poor and never sought medical help for her condition', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Inability to walk since babyhood, did not walk till 2.5 years old, could walk but never run, difficulty walking and pain during pregnancy, developed a fracture of the pubic rami during vaginal delivery', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'Got married at the age of 15 and became pregnant soon after', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Contracted pelvis', 'Type': 'Cesarean section was planned but not performed', 'time': 'None', 'outcome': 'Delivered vaginally and developed a fracture of the pubic rami', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Inability to walk', 'intensity of symptom': 'Severe', 'location': 'Legs', 'time': 'Last 4 years', 'temporalisation': 'Chronic and worsening', 'behaviours affecting the symptom': 'Weakness to the point of being unable to turn over in bed', 'details': 'Associated with severe weakness and bone pain'}], 'medical examinations': [{'name': 'Nerve conduction study', 'result': 'Normal', 'details': 'No evidence of neurological disease'}], 'diagnosis tests': [{'test': 'None', 'severity': 'None', 'result': 'None', 'condition': 'Osteomalacia', 'time': 'None', 'details': 'Diagnosed by several orthopedic surgeons'}], 'treatments': [{'name': 'Calcium and vitamin D', 'related condition': 'Osteomalacia', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To treat osteomalacia', 'reaction to treatment': 'No improvement', 'details': 'Became totally bedridden'}, {'name': 'Calcitriol', 'related condition': 'Osteomalacia', 'dosage': '0.25 mg daily', 'time': 'None', 'frequency': 'Small doses', 'duration': 'Short periods of time', 'reason for taking': 'To treat osteomalacia', 'reaction to treatment': 'No improvement, eventually stopped all treatments', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Calcium and vitamin D', 'related condition': 'Osteomalacia', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To treat osteomalacia', 'reaction to treatment': 'No improvement', 'details': 'Became totally bedridden'}, {'name': 'Calcitriol', 'related condition': 'Osteomalacia', 'dosage': '0.25 mg daily', 'time': 'None', 'frequency': 'Small doses', 'duration': 'Short periods of time', 'reason for taking': 'To treat osteomalacia', 'reaction to treatment': 'No improvement, eventually stopped all treatments', 'details': 'None'}]}\n","---\n","Key: 149866\n","Value: {'note': 'A 16 years old female patient presented to us with inability to walk on both lower limbs since last 3 months. Earlier the patient was able to walk with a limp and would sway to either side while walking. Three months back patient experienced sudden onset pain in her right groin region while walking and the patient was not able to bear weight on her right lower limb. Then patient was walking with support, bearing weight on her left lower limb. In about a week, patient experienced similar pain in her left groin and was not able to bear weight on either lower limb since then and was left bed ridden. Clinical findings were consistent with coxa vara deformity of bilateral hips with a possibility of bilateral non-union of pathological fracture of femur neck. There was no evidence of any endocrine disturbance, or altered pigmentation or precocious puberty.\\nOn imaging it was concluded that the patient suffered from polyostotic fibrous dysplasia with bilateral Shepherd’s crook deformity of the proximal femur with bilateral non – union of pathological fracture of neck femur (). Imaging of the other bones showed evidence of the fibrous dysplastic lesions in the shaft of left tibia ( and ). Magnetic resonance scanning of the bilateral hip region showed the features consistent with fibrous dysplasia of the proximal femur shaft along with sub - capital fracture of femur neck without evidence of avascular necrosis of the femur head (). All the blood and serum biochemical investigations of the patient like the hemoglobin, total and differential white cell counts, erythrocyte sedimentation rate, C – reactive protein, calcium, phosphorus, alkaline phosphatase levels and all the hormonal studies were within normal limits. It was decided to do both correction of the deformity to realign the head, neck and shaft; and to achieve valgus at the neck - shaft region and a horizontal configuration neck fracture increasing the chances of union of pathological fracture of neck femur, in one stage, each side at a time.\\nOn the right side, first oblique osteotomy was done from just distal to the greater trochanter', 'visit motivation': 'Inability to walk on both lower limbs', 'summary': {'visit motivation': 'Inability to walk on both lower limbs', 'admission': [{'reason': 'Sudden onset pain in right groin region while walking, inability to bear weight on right lower limb, and later similar pain in left groin with inability to bear weight on either lower limb', 'date': 'None', 'duration': '3 months', 'care center details': 'None'}], 'patient information': {'age': '16 years old', 'sex': 'Female', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Coxa vara deformity of bilateral hips, bilateral non-union of pathological fracture of femur neck', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Correction of deformity to realign the head, neck, and shaft of the femur; to achieve valgus at the neck-shaft region and a horizontal configuration neck fracture to increase the chances of union of pathological fracture of neck femur', 'Type': 'Oblique osteotomy', 'time': 'None', 'outcome': 'None', 'details': 'Performed on the right side, first oblique osteotomy was done from just distal to the greater trochanter'}], 'symptoms': [{'name of symptom': 'Inability to walk', 'intensity of symptom': 'None', 'location': 'Both lower limbs', 'time': 'Last 3 months', 'temporalisation': 'Initially able to walk with a limp, then sudden onset of pain leading to inability to bear weight', 'behaviours affecting the symptom': 'Walking', 'details': 'Patient experienced sudden onset pain in right groin region while walking, leading to inability to bear weight on right lower limb, followed by similar pain in left groin'}], 'medical examinations': [{'name': 'Clinical findings', 'result': 'Coxa vara deformity of bilateral hips, possibility of bilateral non-union of pathological fracture of femur neck', 'details': 'No evidence of endocrine disturbance, altered pigmentation, or precocious puberty'}], 'diagnosis tests': [{'test': 'Imaging', 'severity': 'None', 'result': 'Polyostotic fibrous dysplasia with bilateral Shepherd’s crook deformity of the proximal femur, bilateral non-union of pathological fracture of neck femur', 'condition': 'Polyostotic fibrous dysplasia', 'time': 'None', 'details': 'Imaging of other bones showed fibrous dysplastic lesions in the shaft of left tibia'}, {'test': 'Magnetic resonance scanning', 'severity': 'None', 'result': 'Features consistent with fibrous dysplasia of the proximal femur shaft along with sub-capital fracture of femur neck without evidence of avascular necrosis of the femur head', 'condition': 'Fibrous dysplasia of the proximal femur shaft, sub-capital fracture of femur neck', 'time': 'None', 'details': 'None'}, {'test': 'Blood and serum biochemical investigations', 'severity': 'None', 'result': 'Normal', 'condition': 'None', 'time': 'None', 'details': 'Hemoglobin, total and differential white cell counts, erythrocyte sedimentation rate, C-reactive protein, calcium, phosphorus, alkaline phosphatase levels and all hormonal studies were within normal limits'}], 'treatments': [{'name': 'Surgical correction of deformity', 'related condition': 'Coxa vara deformity, non-union of pathological fracture of neck femur', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To realign the head, neck, and shaft of the femur; to achieve valgus at the neck-shaft region and a horizontal configuration neck fracture to increase the chances of union', 'reaction to treatment': 'None', 'details': 'One stage, each side at a time'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Surgical correction of deformity', 'related condition': 'Coxa vara deformity, non-union of pathological fracture of neck femur', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To realign the head, neck, and shaft of the femur; to achieve valgus at the neck-shaft region and a horizontal configuration neck fracture to increase the chances of union', 'reaction to treatment': 'None', 'details': 'One stage, each side at a time'}]}\n","---\n","Key: 87064\n","Value: {'note': \"We present a case of a seventy-three-year-old Saudi man who has started visiting the primary health care center in our institution twenty-five years ago. He has been concerned with having a cancer that would give him only few days to live. At the beginning, the patient was evaluated medically through detailed history and documentation of his symptoms and then a management plan was created accordingly to exclude cancer. Full history, physical examinations, and radiological and pathological investigations were ordered and the results were all negative for cancer. The physician explained the results of the investigations to the patient but he refused them and continued to insist that he had cancer regardless of the results. The patient was then referred to Psychiatry Department to be evaluated but he could not realize that his symptoms might be of a nonorganic cause, either psychological or mental.\\nThe patient continued to visit the general hospital, emergency department, and the primary health care in the institution and was still occupied with the idea of cancer presence. Although the patient was seen by many physicians, the patient was always not satisfied with their conclusions. Eventually a physician reported the case to the department of medical eligibility addressing the issue of continuous primary health care center visits with very variable symptoms, nonconclusive diagnosis, and an unconvinced patient. The department of medical eligibility in the hospital administration took a decision to temporarily limit the patient's file to the psychiatry department to drive the patient to visit the psychiatrist to be evaluated psychologically in order to make his file eligible again. The patient was unhappy at the beginning but he had to visit the psychiatrist. So, an appointment with the psychiatrist was booked and a full psychological and social evaluation was performed by taking a thorough history from the patient. This revealed that the patient fit the criteria of the illness anxiety disorder in which he had a minimum of six months of a persistent belief of having a serious disease which he specifically named. Moreover, this persistent occupation with this belief was disabling and limiting him from having\", 'visit motivation': 'Concerned with having a cancer that would give him only a few days to live', 'summary': {'visit motivation': 'Concerned with having a cancer that would give him only a few days to live', 'admission': [{'reason': 'To exclude cancer', 'date': 'Twenty-five years ago', 'duration': 'None', 'care center details': 'Primary health care center at the institution'}], 'patient information': {'age': 'Seventy-three years old', 'sex': 'Male', 'ethnicity': 'Saudi', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'Patient could not realize that his symptoms might be of a nonorganic cause, either psychological or mental', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [], 'symptoms': [], 'medical examinations': [{'name': 'Full history, physical examinations, radiological and pathological investigations', 'result': 'All negative for cancer', 'details': 'The patient was medically evaluated through detailed history and documentation of his symptoms'}], 'diagnosis tests': [], 'treatments': [], 'discharge': {'reason': \"The department of medical eligibility took a decision to temporarily limit the patient's file to the psychiatry department\", 'referral': 'Referred to Psychiatry Department for evaluation', 'follow up': 'An appointment with the psychiatrist was booked for a full psychological and social evaluation', 'discharge summary': 'None'}}, 'discharge': {'reason': \"The department of medical eligibility took a decision to temporarily limit the patient's file to the psychiatry department\", 'referral': 'Referred to Psychiatry Department for evaluation', 'follow up': 'An appointment with the psychiatrist was booked for a full psychological and social evaluation', 'discharge summary': 'None'}, 'treatments': []}\n","---\n","Key: 123006\n","Value: {'note': 'A 23-year-old female patient was admitted to a plastic surgery clinic because of an esthetic problem caused by swelling on the scalp, which started 1 year previously and gradually worsened in the most recent 6 months. She underwent surgery under local anesthesia without guidance using an imaging method. Bleeding started at the beginning of the operation, and the procedure was terminated. Five months after the first operation, she suffered from increased swelling of the lesion. She was seen by another physician, and cerebral magnetic resonance imaging (MRI) was performed []. The physician felt that it was a simple skin lesion that could be completely removed under local anesthesia. She underwent a second surgery and experienced severe hemorrhaging. Later, she was referred to our clinic. Her physical examination revealed a painful mass lesion measuring 5 cm × 4 cm × 4 cm in the left parietal region at the vertex level. She did not have any complaints except for her esthetic problem. The results of her neurological examination were normal. A vascular malformation at the scalp was considered, and a cerebral MR angiography was performed and revealed a vascular mass lesion, which was located in the left parietal region and supplied by the branches of the left external carotid artery for which venous drainage could not be clearly identified []. Therefore, we performed a conventional cerebral angiography and detected AVM in the left parietal region that was supplied via the branches of the left temporalis superficial artery, left meningeal media artery, and right temporalis superficialis artery []. The lesion did not have an intracranial component and had no direct drainage vein into the dural sinuses. The patient was surgically treated under general anesthesia in the supine position, and her head was elevated at a 30° angle. The skin flap was removed with a horseshoe incision considering the vascularization of the scalp. The vascular lesion in the soft tissue was dissected, and the malformation was revealed. Initially, the supplying arteries of the lesion were closed. Later, the lesion was completely removed along with its nidus. The bone underlying the lesion had become', 'visit motivation': 'esthetic problem caused by swelling on the scalp', 'summary': {'visit motivation': 'esthetic problem caused by swelling on the scalp', 'admission': [{'reason': 'esthetic problem caused by swelling on the scalp', 'date': 'None', 'duration': 'None', 'care center details': 'plastic surgery clinic'}], 'patient information': {'age': '23', 'sex': 'female', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'esthetic problem caused by swelling on the scalp', 'Type': 'surgery under local anesthesia', 'time': '1 year after the swelling started', 'outcome': 'terminated due to bleeding', 'details': 'surgery without guidance using an imaging method'}, {'reason': 'increased swelling of the lesion', 'Type': 'second surgery under local anesthesia', 'time': 'Five months after the first operation', 'outcome': 'severe hemorrhaging', 'details': 'physician felt it was a simple skin lesion that could be completely removed'}, {'reason': 'vascular malformation at the scalp', 'Type': 'surgical treatment under general anesthesia', 'time': 'None', 'outcome': 'complete removal of the lesion along with its nidus', 'details': 'head elevated at a 30° angle, skin flap removed with a horseshoe incision, supplying arteries of the lesion were closed'}], 'symptoms': [{'name of symptom': 'swelling on the scalp', 'intensity of symptom': 'gradually worsened', 'location': 'scalp', 'time': 'started 1 year previously', 'temporalisation': 'worsened in the most recent 6 months', 'behaviours affecting the symptom': 'None', 'details': 'increased swelling of the lesion five months after the first operation'}], 'medical examinations': [{'name': 'physical examination', 'result': 'painful mass lesion measuring 5 cm × 4 cm × 4 cm in the left parietal region at the vertex level', 'details': 'no complaints except for esthetic problem, normal neurological examination'}], 'diagnosis tests': [{'test': 'cerebral magnetic resonance imaging (MRI)', 'severity': 'None', 'result': 'None', 'condition': 'simple skin lesion', 'time': 'None', 'details': 'performed by another physician'}, {'test': 'cerebral MR angiography', 'severity': 'None', 'result': 'vascular mass lesion in the left parietal region', 'condition': 'vascular malformation at the scalp', 'time': 'None', 'details': 'supplied by the branches of the left external carotid artery, venous drainage could not be clearly identified'}, {'test': 'conventional cerebral angiography', 'severity': 'None', 'result': 'AVM in the left parietal region', 'condition': 'AVM', 'time': 'None', 'details': 'supplied via the branches of the left temporalis superficial artery, left meningeal media artery, and right temporalis superficialis artery; no intracranial component; no direct drainage vein into the dural sinuses'}], 'treatments': [{'name': 'surgical treatment', 'related condition': 'vascular malformation at the scalp', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'to remove the vascular lesion and malformation', 'reaction to treatment': 'None', 'details': 'performed under general anesthesia, head elevated at a 30° angle, skin flap removed with a horseshoe incision, supplying arteries of the lesion were closed, lesion completely removed along with its nidus'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'surgical treatment', 'related condition': 'vascular malformation at the scalp', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'to remove the vascular lesion and malformation', 'reaction to treatment': 'None', 'details': 'performed under general anesthesia, head elevated at a 30° angle, skin flap removed with a horseshoe incision, supplying arteries of the lesion were closed, lesion completely removed along with its nidus'}]}\n","---\n","Key: 42234\n","Value: {'note': 'The patient was a healthy 13-year-old female, who suddenly felt abdominal pain. She was taken to another hospital by ambulance, and the enhanced abdominal computed tomography (CT) revealed a 5 cm diameter cystic tumor in the pancreatic tail with fluid collection around it (). The CT results indicated her acute abdominal pain was due to the hemoperitoneum caused by rupture of the pancreatic tumor. Because she had no history of blunt abdominal trauma, the tumor was considered to have ruptured spontaneously. The pancreatic tumor was diagnosed as a SPT of the pancreas from the finding on the CT combined with her age and gender. Since the bleeding stopped by conservative therapy, she was referred to our hospital for surgical treatment at three months after the rupture of the tumor. At that time, she had no abdominal symptoms and the tumor was not palpable. The CT at our hospital showed the cystic tumor was 4 cm in diameter, which protruded from pancreatic tail and was distant from the main pancreatic duct, and the fluid around the tumor had disappeared (). From these findings, an elective laparoscopic enucleation of the tumor was proposed. Since there seemed to be no peritoneal dissemination from the result of laparoscopic exploration, laparoscopic enucleation was performed by using five trocars under pneumoperitoneum. The pancreatic parenchyma was divided with the laparoscopic coagulating shears (). Duration of operation was 126 minutes and with little blood loss. Because the content of amylase in the fluid from the drain placed at the cut surface of the pancreas was 9710 IU/L on postoperative day 3, the postoperative pancreatic fistula was confirmed according to the international definition []. However, because the volume of the fluid from drain was very small, the drain was removed on postoperative day 4. Except for the pancreatic fistula of grade A [], the postoperative course was uneventful and the patient was discharged on postoperative day 7. Pathologically, the tumor was diagnosed as SPT of the pancreas. The negative surgical margin and the rupture of the capsule of tumor were verified by microscopic examination (). She survived', 'visit motivation': 'Sudden abdominal pain', 'summary': {'visit motivation': 'Sudden abdominal pain', 'admission': [{'reason': 'Acute abdominal pain due to hemoperitoneum caused by rupture of pancreatic tumor', 'date': 'Three months after the rupture of the tumor', 'duration': 'None', 'care center details': 'Referred to hospital for surgical treatment'}], 'patient information': {'age': '13', 'sex': 'Female', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Healthy', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Ruptured pancreatic tumor', 'Type': 'Laparoscopic enucleation of the pancreatic tumor', 'time': 'None', 'outcome': 'Successful with a postoperative pancreatic fistula of grade A', 'details': 'Performed using five trocars under pneumoperitoneum, duration of operation was 126 minutes with little blood loss'}], 'symptoms': [{'name of symptom': 'Abdominal pain', 'intensity of symptom': 'Acute', 'location': 'Abdomen', 'time': 'Sudden onset', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'No abdominal symptoms at the time of surgery'}], 'medical examinations': [{'name': 'Physical examination', 'result': 'Tumor not palpable', 'details': 'At the time of surgery'}], 'diagnosis tests': [{'test': 'Enhanced abdominal computed tomography (CT)', 'severity': 'None', 'result': '5 cm diameter cystic tumor in the pancreatic tail with fluid collection around it', 'condition': 'SPT of the pancreas', 'time': 'At initial hospital visit and follow-up at our hospital', 'details': 'CT at our hospital showed the cystic tumor was 4 cm in diameter, protruded from pancreatic tail, distant from the main pancreatic duct, and the fluid around the tumor had disappeared'}], 'treatments': [{'name': 'Conservative therapy', 'related condition': 'Hemoperitoneum caused by rupture of pancreatic tumor', 'dosage': 'None', 'time': 'Prior to surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To stop bleeding', 'reaction to treatment': 'Bleeding stopped', 'details': 'None'}], 'discharge': {'reason': 'Uncomplicated recovery post-surgery', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'Patient was discharged on postoperative day 7 with a postoperative pancreatic fistula of grade A'}}, 'discharge': {'reason': 'Uncomplicated recovery post-surgery', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'Patient was discharged on postoperative day 7 with a postoperative pancreatic fistula of grade A'}, 'treatments': [{'name': 'Conservative therapy', 'related condition': 'Hemoperitoneum caused by rupture of pancreatic tumor', 'dosage': 'None', 'time': 'Prior to surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To stop bleeding', 'reaction to treatment': 'Bleeding stopped', 'details': 'None'}]}\n","---\n","Key: 92105\n","Value: {'note': \"A 60-year-old Kashmiri female presented to our department after having sustained a fracture of femur in the supracondylar region. After initial management, the fracture was fixed with a dynamic condylar screw assembly. After an uneventful postoperative period, the patient was discharged with advice to undergo supervised physiotherapy. 3 months into the postoperative period, the patient reported to our emergency department with pain in the thigh. X rays revealed a fracture above the dynamic condylar screw at the plate bone interface. The patient was admitted and revision surgery with a longer barrel plate performed. The patient followed up for a period of 4 months and was bearing weight when she again had pain in the peri implant area. Radiographs revealed a fracture of the femur at the new peri implant region. The patient's femoral neck radiograph revealed an osteoporosis grading of 3 according to Singh's classification []. Keeping in view the potential morbidity associated with the repeat plating we planned a method that would be less invasive and less destructive to the local fracture environment. The proposed surgery was explained to the patient and her attendants. The ethical board permission was sought and obtained. The patient was taken to the operating room and placed on a fracture table. The screws in the plate were removed percutaneously under image intensifier control to ensure the patency of intramedullary canal leaving the plate insitu to avoid reexposure of the bone surface. The fracture was reduced and fixed with a reamed antegrade intramedullary nail. Anticipating the difficulties in distal locking with an insitu plate an external locking device comprising of a distal full ring and a proximal Italian arch connected by two threaded rods were used. No blood transfusion, bone grafting were used and the mean operating time was 40 minutes. The patient was ambulated on the first post operative day and discharged from the hospital on the same day after advising range of motion exercises of the knee. The patient was advised to compress the fracture at a rate of 1 mm per day in divided increments. The follow up was done\", 'visit motivation': 'Pain in the thigh', 'summary': {'visit motivation': 'Pain in the thigh', 'admission': [{'reason': 'Fracture above the dynamic condylar screw at the plate bone interface', 'date': 'None', 'duration': 'None', 'care center details': 'None'}, {'reason': 'Fracture of the femur at the new peri implant region', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '60', 'sex': 'Female', 'ethnicity': 'Kashmiri', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Fracture of femur in the supracondylar region', 'Type': 'Fixation with a dynamic condylar screw assembly', 'time': 'None', 'outcome': 'Uneventful postoperative period', 'details': 'None'}, {'reason': 'Fracture above the dynamic condylar screw at the plate bone interface', 'Type': 'Revision surgery with a longer barrel plate', 'time': 'None', 'outcome': 'None', 'details': 'None'}, {'reason': 'Fracture of the femur at the new peri implant region', 'Type': 'Reamed antegrade intramedullary nailing with external locking device', 'time': 'None', 'outcome': 'Patient was ambulated on the first postoperative day', 'details': 'Screws in the plate were removed percutaneously under image intensifier control, leaving the plate insitu'}], 'symptoms': [{'name of symptom': 'Pain', 'intensity of symptom': 'None', 'location': 'Thigh', 'time': '3 months into the postoperative period', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Patient reported to emergency department with pain in the thigh'}, {'name of symptom': 'Pain', 'intensity of symptom': 'None', 'location': 'Peri implant area', 'time': '4 months follow up', 'temporalisation': 'None', 'behaviours affecting the symptom': 'Weight bearing', 'details': 'Patient again had pain in the peri implant area'}], 'medical examinations': [{'name': 'X-ray', 'result': 'Fracture above the dynamic condylar screw at the plate bone interface', 'details': 'None'}, {'name': 'Radiographs', 'result': 'Fracture of the femur at the new peri implant region', 'details': 'None'}, {'name': 'Femoral neck radiograph', 'result': \"Osteoporosis grading of 3 according to Singh's classification\", 'details': 'None'}], 'diagnosis tests': [{'test': 'X-ray', 'severity': 'None', 'result': 'Fracture above the dynamic condylar screw at the plate bone interface', 'condition': 'Fracture', 'time': 'None', 'details': 'None'}, {'test': 'Radiographs', 'severity': 'None', 'result': 'Fracture of the femur at the new peri implant region', 'condition': 'Fracture', 'time': 'None', 'details': 'None'}, {'test': 'Femoral neck radiograph', 'severity': 'Grade 3', 'result': 'Osteoporosis', 'condition': 'Osteoporosis', 'time': 'None', 'details': \"According to Singh's classification\"}], 'treatments': [{'name': 'Supervised physiotherapy', 'related condition': 'Postoperative care for femur fracture', 'dosage': 'None', 'time': 'After initial surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To aid in recovery post-surgery', 'reaction to treatment': 'None', 'details': 'Patient was discharged with advice to undergo supervised physiotherapy'}, {'name': 'Range of motion exercises of the knee', 'related condition': 'Postoperative care after reamed antegrade intramedullary nailing', 'dosage': 'None', 'time': 'After the last surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To aid in recovery post-surgery', 'reaction to treatment': 'None', 'details': 'Patient was advised to perform after being discharged from the hospital'}, {'name': 'Compression of the fracture', 'related condition': 'Postoperative care after reamed antegrade intramedullary nailing', 'dosage': '1 mm per day in divided increments', 'time': 'After the last surgery', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'To aid in fracture healing', 'reaction to treatment': 'None', 'details': 'Patient was advised to compress the fracture at a rate of 1 mm per day in divided increments'}], 'discharge': {'reason': 'Successful postoperative recovery', 'referral': 'None', 'follow up': 'The follow up was done', 'discharge summary': 'Patient was ambulated on the first postoperative day and discharged from the hospital on the same day'}}, 'discharge': {'reason': 'Successful postoperative recovery', 'referral': 'None', 'follow up': 'The follow up was done', 'discharge summary': 'Patient was ambulated on the first postoperative day and discharged from the hospital on the same day'}, 'treatments': [{'name': 'Supervised physiotherapy', 'related condition': 'Postoperative care for femur fracture', 'dosage': 'None', 'time': 'After initial surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To aid in recovery post-surgery', 'reaction to treatment': 'None', 'details': 'Patient was discharged with advice to undergo supervised physiotherapy'}, {'name': 'Range of motion exercises of the knee', 'related condition': 'Postoperative care after reamed antegrade intramedullary nailing', 'dosage': 'None', 'time': 'After the last surgery', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To aid in recovery post-surgery', 'reaction to treatment': 'None', 'details': 'Patient was advised to perform after being discharged from the hospital'}, {'name': 'Compression of the fracture', 'related condition': 'Postoperative care after reamed antegrade intramedullary nailing', 'dosage': '1 mm per day in divided increments', 'time': 'After the last surgery', 'frequency': 'Daily', 'duration': 'None', 'reason for taking': 'To aid in fracture healing', 'reaction to treatment': 'None', 'details': 'Patient was advised to compress the fracture at a rate of 1 mm per day in divided increments'}]}\n","---\n","Key: 89665\n","Value: {'note': 'A 47 year old gentleman presented to his general practitioner with acute onset lower back pain. The pain had commenced during coitus and radiated down the right leg. The initial diagnosis was of acute disc prolapse and he was referred for an urgent neurosurgical opinion. The neurosurgeon concurred that the pain may well have been of neurological origin and arranged an MRI scan. This was reported as showing no evidence of spinal cord pathology. The patient was reassured with the results of the MRI findings and was advised the pain was probably musculoskeletal in origin and should settle. Over the subsequent 6 weeks, the pain persisted and indeed increased in severity. The patient noted claudication-type pain in his right leg after approximately 100 metres. As the pain had not resolved after 6 weeks he revisited his general practitioner. During the subsequent examination the pulses in his right leg were noted to be absent and he was referred for an urgent vascular surgical opinion.\\nThe patient was seen the following day in the vascular clinic where a history of severe acute claudication-type pain was noted in the right leg. There was a past medical history of marked hypertension and hyperlipidaemia, for which he took relevant medications, but none of angina, myocardial infarct or valvular heart disease. On clinical examination the heart rate was 68 beats per minute regular. The blood pressure in the right arm 130/70 mmHg was lower than that of the left arm 160/80. Cardiac examination was normal. There was no clinical evidence of an abdominal aortic aneurysm. Examination of the limbs revealed that the right lower limb pulses were all absent whilst those of the left leg were present and of good volume. An urgent abdominal ultrasound scan was arranged which demonstrated dissection of the intra-abdominal aorta and a subsequent CT scan (Figures , , ) confirmed that the dissection was a Type A dissection extending from the aortic valve down to the aortic bifurcation. A dissection flap was identified in the ascending aorta and also in the postero-inferior aspect of the descending aorta. Both lumens', 'visit motivation': 'Acute onset lower back pain during coitus, radiating down the right leg', 'summary': {'visit motivation': 'Acute onset lower back pain during coitus, radiating down the right leg', 'admission': [{'reason': 'Acute disc prolapse initially suspected, later vascular surgical opinion for absent right leg pulses and claudication', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '47', 'sex': 'Male', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Hypertension, Hyperlipidaemia', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'None', 'Type': 'None', 'time': 'None', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Lower back pain, Claudication-type pain', 'intensity of symptom': 'Increased severity over 6 weeks', 'location': 'Lower back, right leg', 'time': 'Acute onset, persisted over 6 weeks', 'temporalisation': 'Pain noted after walking approximately 100 metres', 'behaviours affecting the symptom': 'Coitus, walking', 'details': 'Radiated down the right leg'}], 'medical examinations': [{'name': 'Clinical examination', 'result': 'Absent right leg pulses, blood pressure discrepancy between arms, normal cardiac examination', 'details': 'Right lower limb pulses absent, left leg pulses present and of good volume'}], 'diagnosis tests': [{'test': 'MRI scan', 'severity': 'None', 'result': 'No evidence of spinal cord pathology', 'condition': 'Initially suspected acute disc prolapse', 'time': 'None', 'details': 'Reassured pain was musculoskeletal in origin'}, {'test': 'Abdominal ultrasound scan', 'severity': 'None', 'result': 'Demonstrated dissection of the intra-abdominal aorta', 'condition': 'None', 'time': 'None', 'details': 'None'}, {'test': 'CT scan', 'severity': 'None', 'result': 'Confirmed Type A dissection from the aortic valve down to the aortic bifurcation', 'condition': 'Aortic dissection', 'time': 'None', 'details': 'Dissection flap identified in the ascending aorta and in the postero-inferior aspect of the descending aorta'}], 'treatments': [{'name': 'None', 'related condition': 'None', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'None', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'Urgent vascular surgical opinion', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'Urgent vascular surgical opinion', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'None', 'related condition': 'None', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'None', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 149815\n","Value: {'note': 'A 68 year old male patient was admitted 48 hours after he suffered a severe hip injury when falling from a bridge. The initial Rx-ray at admission displayed a femoral neck fracture with dislocation of the femoral head into the pelvis (). The patient also presented macroscopic and laboratory confirmed hematuria. A CT scan was not available at that time, but because of the hematuria we suspected an anterior dislocation of the femoral head. A Foley catheter was introduced into the urinary balder and antibiotics were administrated. Surgery was performed next day in lateral approach of the hip with anterior capsulotomy. The femoral head was not found into the hip but in the pelvis and could not be extracted but only touched by finger through a laceration between the anterior acetabular rim and the decollated labrum, creating a dislocation space similar to the anterior dislocation or the shoulder. However a 50 mm Austin Moore prosthesis was implanted and after the surgery the patient had the femoral head replaced and the fractured femoral head retained as o loose fragment into the pelvis (). The patient was prepared for the next surgery and two days later the urologist extracted the femoral head by a new abdominal approach Gibson with retroperitoneal dissection of the common iliac vessels. The head was placed on the iliopsoas muscle and under the iliac common vessels, and during the procedure no visible injury of the ureter, balder or iliac vessels was found. Soon after removing the abdominal wound drainage the patient experienced pain in the hip, lost mobility and swelling occurred at the hip wound. Several punctures of the hip extracted a large amount of clear liquid which was investigated and was found to have density and elements like urine. A drainage tube was reinserted into the hip wound and the patient underwent repeated urological evaluation by urography and endoscopic techniques. A fistula injury of the ipsilateral ureter was found and an internal drainage of the ureter was introduced and left in situ for three months. The Moore prosthesis was extracted, the hip was debrided and', 'visit motivation': 'Severe hip injury', 'summary': {'visit motivation': 'Severe hip injury', 'admission': [{'reason': 'Suffered a severe hip injury when falling from a bridge', 'date': '48 hours after the incident', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '68', 'sex': 'male', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Femoral neck fracture with dislocation of the femoral head into the pelvis', 'Type': 'Hip surgery with lateral approach and anterior capsulotomy', 'time': 'Next day after admission', 'outcome': 'Femoral head replaced, fractured femoral head retained as a loose fragment in the pelvis', 'details': 'Austin Moore prosthesis implanted; femoral head could not be extracted, only touched through a laceration'}, {'reason': 'Extraction of the femoral head retained in the pelvis', 'Type': 'Abdominal approach Gibson with retroperitoneal dissection', 'time': 'Two days after the first surgery', 'outcome': 'Femoral head extracted, no visible injury to ureter, bladder, or iliac vessels', 'details': 'Femoral head placed on the iliopsoas muscle and under the iliac common vessels'}, {'reason': 'Fistula injury of the ipsilateral ureter', 'Type': 'Urological evaluation and surgery', 'time': 'None', 'outcome': 'Internal drainage of the ureter introduced and left in situ for three months', 'details': 'Moore prosthesis extracted, hip debrided and'}], 'symptoms': [{'name of symptom': 'Hematuria', 'intensity of symptom': 'Macroscopic and laboratory confirmed', 'location': 'None', 'time': 'At admission', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Suspected anterior dislocation of the femoral head due to hematuria'}, {'name of symptom': 'Pain in the hip, lost mobility, swelling at the hip wound', 'intensity of symptom': 'None', 'location': 'Hip', 'time': 'Soon after removing the abdominal wound drainage', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Several punctures of the hip extracted a large amount of clear liquid with density and elements like urine'}], 'medical examinations': [{'name': 'Rx-ray', 'result': 'Femoral neck fracture with dislocation of the femoral head into the pelvis', 'details': 'Initial Rx-ray at admission'}, {'name': 'CT scan', 'result': 'None', 'details': 'Not available at the time of initial assessment'}, {'name': 'Urography and endoscopic techniques', 'result': 'Fistula injury of the ipsilateral ureter', 'details': 'None'}], 'diagnosis tests': [{'test': 'Laboratory test', 'severity': 'None', 'result': 'Confirmed hematuria', 'condition': 'Hematuria', 'time': 'At admission', 'details': 'None'}], 'treatments': [{'name': 'Antibiotics', 'related condition': 'None', 'dosage': 'None', 'time': 'After admission', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Due to the introduction of a Foley catheter into the urinary bladder', 'reaction to treatment': 'None', 'details': 'None'}, {'name': 'Internal drainage of the ureter', 'related condition': 'Fistula injury of the ipsilateral ureter', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'Three months', 'reason for taking': 'To treat the fistula injury', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Antibiotics', 'related condition': 'None', 'dosage': 'None', 'time': 'After admission', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Due to the introduction of a Foley catheter into the urinary bladder', 'reaction to treatment': 'None', 'details': 'None'}, {'name': 'Internal drainage of the ureter', 'related condition': 'Fistula injury of the ipsilateral ureter', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'Three months', 'reason for taking': 'To treat the fistula injury', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 91779\n","Value: {'note': 'A 49 years old female presented with history of recurrent palpitations for last 10 years. During last year, she had 5 episodes of palpitations which required hospitalizations. The tachyardia was repeatedly terminated by intravenous adenosine and verapamil. She was nondiabetic and nonhypertensive. General physical and cardiovascular examination were normal. Her baseline electrocardiogram (ECG) showed left bundle branch block with normal PR interval. The electrocardiogram of tachycardia revealed similar morphology, with the heart rate of 210 beats/min. (). Her transthoracic echocardiogram (TTE) did not show any evidence of structural heart disease. An electrophysiological study was planned with a presumptive diagnosis of AVNRT. Catheter manipulation to obtain His bundle electrogram led to complete heart block because of trauma to right bundle that required temporary right ventricular pacing. No tachycardia could be induced during complete heart block and there was no evidence of accessory pathway. Complete heart block persisted for 3 hours during which she required temporary ventricular pacing support. Patient was discharged after 48 hours with a plan to restudy on recurrence. Within 15 days, she had 3 episode of tachycardia all terminated with intravenous adenosine. After the recurrence of episodes, she was taken up for a restudy with a plan of avoiding His bundle / Right bundle injury and as a part of the same plan to avoid His recording coronary sinus catheter was put from the right internal jugular vein. Three 7 F sheaths were put into right femoral vein and one 6F sheath was put into right internal jugular vein. One catheter was put into high right atrium and another into right ventricular apex carefully avoiding trauma to His bundle. From the internal jugular vein, since the catheter did not follow a normal course, angiogram was done that showed absent right superior vena cava and whole of the jugular system draining into hugely dilated coronary sinus which was missed on transthoracic echocardiogram (). At that point of time, when we found this venous anomaly the risk of ablation was again discussed with the family and the patient, explaining them the risk of development of complete heart block', 'visit motivation': 'History of recurrent palpitations for last 10 years', 'summary': {'visit motivation': 'History of recurrent palpitations for last 10 years', 'admission': [{'reason': 'Episodes of palpitations requiring hospitalization', 'date': 'None', 'duration': '48 hours', 'care center details': 'None'}], 'patient information': {'age': '49 years old', 'sex': 'Female', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Nondiabetic and nonhypertensive', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'None', 'Type': 'None', 'time': 'None', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Palpitations', 'intensity of symptom': 'None', 'location': 'None', 'time': 'Last 10 years', 'temporalisation': '5 episodes in the last year', 'behaviours affecting the symptom': 'None', 'details': 'Tachycardia with heart rate of 210 beats/min'}], 'medical examinations': [{'name': 'General physical and cardiovascular examination', 'result': 'Normal', 'details': 'None'}, {'name': 'Baseline electrocardiogram (ECG)', 'result': 'Left bundle branch block with normal PR interval', 'details': 'None'}, {'name': 'Electrocardiogram of tachycardia', 'result': 'Similar morphology to baseline ECG', 'details': 'Heart rate of 210 beats/min'}, {'name': 'Transthoracic echocardiogram (TTE)', 'result': 'No evidence of structural heart disease', 'details': 'Missed hugely dilated coronary sinus'}], 'diagnosis tests': [{'test': 'Electrophysiological study', 'severity': 'None', 'result': 'Complete heart block due to trauma to right bundle', 'condition': 'AVNRT', 'time': 'None', 'details': 'Required temporary right ventricular pacing'}], 'treatments': [{'name': 'Intravenous adenosine and verapamil', 'related condition': 'Tachycardia', 'dosage': 'None', 'time': 'None', 'frequency': 'As needed for episodes of tachycardia', 'duration': 'None', 'reason for taking': 'To terminate tachycardia', 'reaction to treatment': 'Tachycardia was repeatedly terminated', 'details': 'None'}, {'name': 'Temporary right ventricular pacing', 'related condition': 'Complete heart block', 'dosage': 'None', 'time': 'During complete heart block', 'frequency': 'None', 'duration': '3 hours', 'reason for taking': 'Due to trauma to right bundle', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'Stable condition after temporary pacing', 'referral': 'None', 'follow up': 'Plan to restudy on recurrence', 'discharge summary': 'Discharged after 48 hours with a plan to restudy on recurrence'}}, 'discharge': {'reason': 'Stable condition after temporary pacing', 'referral': 'None', 'follow up': 'Plan to restudy on recurrence', 'discharge summary': 'Discharged after 48 hours with a plan to restudy on recurrence'}, 'treatments': [{'name': 'Intravenous adenosine and verapamil', 'related condition': 'Tachycardia', 'dosage': 'None', 'time': 'None', 'frequency': 'As needed for episodes of tachycardia', 'duration': 'None', 'reason for taking': 'To terminate tachycardia', 'reaction to treatment': 'Tachycardia was repeatedly terminated', 'details': 'None'}, {'name': 'Temporary right ventricular pacing', 'related condition': 'Complete heart block', 'dosage': 'None', 'time': 'During complete heart block', 'frequency': 'None', 'duration': '3 hours', 'reason for taking': 'Due to trauma to right bundle', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 146172\n","Value: {'note': 'An 82-year-old female with 60 kg body weight and 156 cm height who was otherwise healthy underwent a right total knee arthroplasty for osteoarthrosis under epidural anesthesia at a hospital nearby. The insertion of the epidural catheter and operation were finished without any problems and the removal of the epidural catheter was attempted as usual two days after the operation. The epidural catheter broke during its removal. The physician felt resistance when he tried to pull out the catheter and then the catheter was broken 13 cm from the tip. X-rays and a computed tomography scan were subsequently taken (). Although the catheter fragment retaining within the patient was long, a wait-and-see approach was initially employed because there was no neurological deficit. The effusion from the drain hole stopped two days later. No neurological deficit or fever developed after the first evaluation of the images. However, the migration of the catheter was found by imaging studies four weeks after the occurrence of the catheter breakage (). After detailed discussions with the patient and her family it was decided that a surgical removal of the retained catheter should be performed. Then, the patient was referred to our hospital.\\nThere was no neurological deficit at the time of admission. A laminectomy was performed at L2-3 seven weeks after the catheter had broken. The patient was placed in the prone position under general anesthesia and then the spinal level that needed to be treated and the retained catheter were identified by using an image intensifier. We exposed the spinal process at L2-3 and the L2 spinal process was split by an air drill. The catheter was confirmed to be present between the L2 and L3 spinous processes and the edge of the catheter was found to be broken (). The catheter went entered the epidural space through the flavum.\\nAfter removal of the bilateral flavum in an usual manner the catheter was found to be coiled up at the surface of the dura mater and was covered by a thin reactive film (). The catheter was heading to the nerve root', 'visit motivation': 'Complications following a right total knee arthroplasty', 'summary': {'visit motivation': 'Complications following a right total knee arthroplasty', 'admission': [{'reason': 'Surgical removal of a retained epidural catheter fragment', 'date': 'None', 'duration': 'None', 'care center details': 'The patient was referred to our hospital for the surgical procedure.'}], 'patient information': {'age': '82', 'sex': 'Female', 'ethnicity': 'None', 'weight': '60 kg', 'height': '156 cm', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Otherwise healthy', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Osteoarthrosis', 'Type': 'Right total knee arthroplasty', 'time': 'None', 'outcome': 'Successful without any problems during the operation', 'details': 'Epidural anesthesia was used; the epidural catheter broke during its removal two days after the operation.'}, {'reason': 'Removal of a retained epidural catheter fragment', 'Type': 'Laminectomy at L2-3', 'time': 'Seven weeks after the catheter had broken', 'outcome': 'None', 'details': 'The patient was placed in the prone position under general anesthesia; the spinal level and retained catheter were identified using an image intensifier; the catheter was confirmed to be present between the L2 and L3 spinous processes and was removed.'}], 'symptoms': [{'name of symptom': 'Neurological deficit', 'intensity of symptom': 'None', 'location': 'None', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'No neurological deficit was present initially or at the time of admission to our hospital.'}], 'medical examinations': [{'name': 'X-rays and a computed tomography scan', 'result': 'Catheter fragment retained within the patient', 'details': 'Imaging studies found the migration of the catheter four weeks after the breakage.'}], 'diagnosis tests': [{'test': 'Imaging studies', 'severity': 'None', 'result': 'Migration of the catheter', 'condition': 'Retained epidural catheter fragment', 'time': 'Four weeks after the occurrence of the catheter breakage', 'details': 'A wait-and-see approach was initially employed because there was no neurological deficit.'}], 'treatments': [{'name': 'Surgical removal', 'related condition': 'Retained epidural catheter fragment', 'dosage': 'None', 'time': 'Seven weeks after the catheter had broken', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'The migration of the catheter and after detailed discussions with the patient and her family', 'reaction to treatment': 'None', 'details': 'The catheter was coiled up at the surface of the dura mater and was covered by a thin reactive film.'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Surgical removal', 'related condition': 'Retained epidural catheter fragment', 'dosage': 'None', 'time': 'Seven weeks after the catheter had broken', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'The migration of the catheter and after detailed discussions with the patient and her family', 'reaction to treatment': 'None', 'details': 'The catheter was coiled up at the surface of the dura mater and was covered by a thin reactive film.'}]}\n","---\n","Key: 89642\n","Value: {'note': 'A 78 year old Caucasian male presented to our casualty 6 weeks following admission elsewhere with a history of swelling of the right leg and a pulmonary embolus. He had undergone VQ scanning with a proven diagnosis of pulmonary embolus and was therefore anticoagulated with heparin and warfarin.\\nOn admission he had swelling of the right knee and lower thigh with loss of sensation on the dorsolateral aspect of the right foot. Clinical examination revealed a large mass in the right popliteal fossa. The initial diagnosis was that of deep venous thrombosis and imaging was undertaken and the patient referred for a vascular opinion.\\nOn vascular review, the patient had a pulsatile mass comparable with a popliteal artery aneurysm of 12 cms diameter on the right and 6 cms on the left. His foot was warm and well perfused and his INR was 2.6. He underwent a duplex scan of the lower limb arteries which revealed ectatic iliacs and an abdominal aorta of 3.4 cms in diameter. A further CT arteriogram (fig , ) confirmed that in fact the swelling on the right side was indeed a pseudo aneurysm following rupture with peripheral calcification.\\nThe dilemma was therefore a patient with an established pulmonary embolus and a friable clot in the iliac veins, anticoagulation and the treatment of the ruptured aneurysm. Due to lack of expertise we elected to continue with full anticoagulation rather than place an inferior vena caval filter. Operative exploration was performed through a medial approach under full anticoagulation and the right popliteal artery was found to contain a large volume of blood pointing laterally. The popliteal aneurysm was excluded. Duplex examination of the upper and lower limb veins revealed that the veins were of small diameter therefore revascularization of the leg was established by an inlay 8 mm PTFE graft. Due to continuous oozing, the aneurysm sac was packed and the end of the pack brought out laterally. The pack was removed at 48 hours under sedation. The patient made an uneventful recovery. Six weeks later he underwent repair of the left popliteal aneurysm.', 'visit motivation': 'Swelling of the right leg and a history of pulmonary embolus', 'summary': {'visit motivation': 'Swelling of the right leg and a history of pulmonary embolus', 'admission': [{'reason': 'Swelling of the right leg and a pulmonary embolus', 'date': 'None', 'duration': '6 weeks following admission elsewhere', 'care center details': 'None'}], 'patient information': {'age': '78', 'sex': 'male', 'ethnicity': 'Caucasian', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'None', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Ruptured right popliteal artery aneurysm', 'Type': 'Operative exploration and inlay 8 mm PTFE graft', 'time': 'None', 'outcome': 'Unremarkable recovery', 'details': 'Operative exploration was performed under full anticoagulation; the aneurysm sac was packed and the pack was removed at 48 hours under sedation.'}, {'reason': 'Left popliteal aneurysm', 'Type': 'Repair of left popliteal aneurysm', 'time': 'Six weeks after the first surgery', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Swelling', 'intensity of symptom': 'None', 'location': 'Right knee and lower thigh', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Loss of sensation on the dorsolateral aspect of the right foot'}], 'medical examinations': [{'name': 'Clinical examination', 'result': 'Large mass in the right popliteal fossa', 'details': 'None'}, {'name': 'Vascular review', 'result': 'Pulsatile mass in the right popliteal fossa, popliteal artery aneurysm of 12 cms diameter on the right and 6 cms on the left', 'details': 'Foot was warm and well perfused'}, {'name': 'Duplex scan of the lower limb arteries', 'result': 'Ectatic iliacs and an abdominal aorta of 3.4 cms in diameter', 'details': 'None'}, {'name': 'Duplex examination of the upper and lower limb veins', 'result': 'Veins were of small diameter', 'details': 'None'}], 'diagnosis tests': [{'test': 'VQ scanning', 'severity': 'None', 'result': 'Proven diagnosis of pulmonary embolus', 'condition': 'Pulmonary embolus', 'time': 'None', 'details': 'None'}, {'test': 'CT arteriogram', 'severity': 'None', 'result': 'Confirmed pseudo aneurysm following rupture with peripheral calcification', 'condition': 'Pseudo aneurysm', 'time': 'None', 'details': 'None'}], 'treatments': [{'name': 'Anticoagulation', 'related condition': 'Pulmonary embolus and deep venous thrombosis', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To manage pulmonary embolus and prevent clotting complications', 'reaction to treatment': 'None', 'details': 'Patient was anticoagulated with heparin and warfarin; INR was 2.6'}], 'discharge': {'reason': 'Unremarkable recovery', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'The patient made an uneventful recovery and underwent repair of the left popliteal aneurysm six weeks later.'}}, 'discharge': {'reason': 'Unremarkable recovery', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'The patient made an uneventful recovery and underwent repair of the left popliteal aneurysm six weeks later.'}, 'treatments': [{'name': 'Anticoagulation', 'related condition': 'Pulmonary embolus and deep venous thrombosis', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'To manage pulmonary embolus and prevent clotting complications', 'reaction to treatment': 'None', 'details': 'Patient was anticoagulated with heparin and warfarin; INR was 2.6'}]}\n","---\n","Key: 129465\n","Value: {'note': 'Our patient is a 73-year-old Caucasian female with medical history of hypertension and type 2 diabetes. She had been treated for invasive ductal breast cancer 7 years ago with lumpectomy of the left breast and axillary lymph node dissection. Radiation therapy and seven cycles of adjuvant chemotherapy were administered to her postoperatively, and Anastrozole was prescribed to her for 5 years. She underwent regular annual follow-up for 5 years with chest and abdominal computed tomography (CT) scanning with no signs of recurrence or metastatic disease. Seven years after the initial treatment for breast cancer, abdominal CT revealed a solid hepatic lesion at segments VI and VII measuring 7 cm in diameter as well as a 1 cm calcified lesion at the tail of the pancreas (, left). Tumor markers AFP, CA 15–3, CA 19–9, and CEA were all within normal limits and the patient did not have any symptoms or signs of abdominal mass apart from mild tenderness on palpation of the right subcostal region. Moreover, biochemical markers of liver and pancreatic function were normal.\\nSubsequently the patient went through oncologic consultation, and both lesions were considered to be resectable, although controversy arose whether they were metastatic or second primary malignancies. CT-guided percutaneous biopsies or laparoscopic biopsies were proposed as minimal invasive methods of diagnosis. The patient rejected both of them due to the risk for possible complications and cancer spillage and decided to undergo laparotomy, open rapid biopsy, and excision of the lesions in one procedure. After accessing the peritoneal cavity through an extended right subcostal incision, we performed hepatic mobilization and exposure of the right hepatic lobe. A solid mass was recognized at hepatic segments VI and VII and rapid biopsy was taken which showed primary HCC. Moreover, after entering the lesser sac, a second rapid biopsy was taken from the lesion at the pancreatic tail which showed chronic fibrosis without elements of malignancy (). We decided to perform resection of hepatic segments VI and VII since intraoperative hepatic ultrasound also confirmed that the mass was resectable with safe oncologic margins. Hepatic segmentectomy was achieved', 'visit motivation': 'Annual follow-up for breast cancer treatment', 'summary': {'visit motivation': 'Annual follow-up for breast cancer treatment', 'admission': [{'reason': 'Abdominal CT revealed a solid hepatic lesion and a calcified lesion at the tail of the pancreas', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '73', 'sex': 'Female', 'ethnicity': 'Caucasian', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Hypertension, type 2 diabetes, invasive ductal breast cancer treated 7 years ago', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Treatment for invasive ductal breast cancer', 'Type': 'Lumpectomy of the left breast and axillary lymph node dissection', 'time': '7 years ago', 'outcome': 'None', 'details': 'Radiation therapy and seven cycles of adjuvant chemotherapy postoperatively, Anastrozole prescribed for 5 years'}, {'reason': 'Solid hepatic lesion and calcified lesion at the tail of the pancreas', 'Type': 'Laparotomy, open rapid biopsy, and excision of the lesions', 'time': 'None', 'outcome': 'Rapid biopsy showed primary HCC for the hepatic lesion and chronic fibrosis without elements of malignancy for the pancreatic lesion', 'details': 'Resection of hepatic segments VI and VII'}], 'symptoms': [{'name of symptom': 'Mild tenderness', 'intensity of symptom': 'Mild', 'location': 'Right subcostal region', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'No symptoms or signs of abdominal mass apart from mild tenderness on palpation'}], 'medical examinations': [{'name': 'Physical examination', 'result': 'Mild tenderness on palpation of the right subcostal region', 'details': 'None'}], 'diagnosis tests': [{'test': 'Abdominal computed tomography (CT) scanning', 'severity': 'None', 'result': 'Solid hepatic lesion at segments VI and VII measuring 7 cm in diameter and a 1 cm calcified lesion at the tail of the pancreas', 'condition': 'Hepatic lesion and pancreatic lesion', 'time': 'Seven years after initial breast cancer treatment', 'details': 'No signs of recurrence or metastatic disease from previous breast cancer'}, {'test': 'Tumor markers (AFP, CA 15–3, CA 19–9, and CEA)', 'severity': 'None', 'result': 'All within normal limits', 'condition': 'None', 'time': 'None', 'details': 'None'}, {'test': 'Biochemical markers of liver and pancreatic function', 'severity': 'None', 'result': 'Normal', 'condition': 'None', 'time': 'None', 'details': 'None'}, {'test': 'Intraoperative hepatic ultrasound', 'severity': 'None', 'result': 'Confirmed that the hepatic mass was resectable with safe oncologic margins', 'condition': 'Hepatic lesion', 'time': 'During surgery', 'details': 'None'}], 'treatments': [{'name': 'Radiation therapy and adjuvant chemotherapy', 'related condition': 'Invasive ductal breast cancer', 'dosage': 'None', 'time': 'Postoperative period 7 years ago', 'frequency': 'Seven cycles of chemotherapy', 'duration': 'None', 'reason for taking': 'Adjuvant treatment post-lumpectomy', 'reaction to treatment': 'None', 'details': 'None'}, {'name': 'Anastrozole', 'related condition': 'Invasive ductal breast cancer', 'dosage': 'None', 'time': 'Prescribed for 5 years', 'frequency': 'None', 'duration': '5 years', 'reason for taking': 'Adjuvant hormonal therapy', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Radiation therapy and adjuvant chemotherapy', 'related condition': 'Invasive ductal breast cancer', 'dosage': 'None', 'time': 'Postoperative period 7 years ago', 'frequency': 'Seven cycles of chemotherapy', 'duration': 'None', 'reason for taking': 'Adjuvant treatment post-lumpectomy', 'reaction to treatment': 'None', 'details': 'None'}, {'name': 'Anastrozole', 'related condition': 'Invasive ductal breast cancer', 'dosage': 'None', 'time': 'Prescribed for 5 years', 'frequency': 'None', 'duration': '5 years', 'reason for taking': 'Adjuvant hormonal therapy', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 80892\n","Value: {'note': 'A 50-year-old right-handed Latino man presented with worsening of previously stable chronic motor symptoms. He had initially developed sudden weakness and difficulty using his right upper extremity at the age of 16 years. He eventually had to learn to write using his left hand because of the severity of his weakness. His symptoms progressed over several years, eventually developing into severe symmetrical upper extremity weakness and atrophy in his distal muscles. His lower extremities were spared. Our patient stated he was diagnosed with a type of muscular dystrophy in the US when he was 25 years old. After receiving this diagnosis, he subsequently had a muscle biopsy in Mexico that reportedly confirmed his diagnosis. He had no family members with muscular dystrophy or any other neuromuscular conditions. His symptoms reached their plateau at this time. Because of the stability of his symptoms and his understanding of the disease course, our patient did not seek any further medical care for over 20 years. Upon returning to the US, he was seen by a primary care physician and referred for neurological examination to establish care as well as evaluate the worsening of previously stable chronic symptoms.\\nOn presentation, our patient reported a few months of clinical deterioration, particularly recent left upper arm intermittent mild pressure pain. Our patient grew concerned when he noticed increased difficulty performing fine motor tasks with his left hand. In addition, he was experiencing recurrent intermittent episodes of dysphagia while eating solid foods. Our patient denied ever having any previous bulbar symptoms prior to his recent clinical deterioration.\\nA clinical examination demonstrated that our patient was thin with significant bilateral upper extremity muscle atrophy and associated weakness. He had severe asymmetric focal segmental atrophy of his bilateral forearm flexor and extensor muscle groups, with preserved and prominent bilateral brachioradialis muscles (Figure ). He had corresponding severe weakness in his upper extremities as measured using the Medical Research Council Scale, with 4-/5 to 5/5 proximal strength and as low as 1/5 strength in his distal muscles. He had bilateral radial deviation during wrist extension. Although his', 'visit motivation': 'Worsening of previously stable chronic motor symptoms and recent clinical deterioration', 'summary': {'visit motivation': 'Worsening of previously stable chronic motor symptoms and recent clinical deterioration', 'admission': [{'reason': 'None', 'date': 'None', 'duration': 'None', 'care center details': 'None'}], 'patient information': {'age': '50 years', 'sex': 'Male', 'ethnicity': 'Latino', 'weight': 'None', 'height': 'None', 'family medical history': 'No family members with muscular dystrophy or any other neuromuscular conditions', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Diagnosed with a type of muscular dystrophy at the age of 25, confirmed by muscle biopsy in Mexico', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'None', 'Type': 'None', 'time': 'None', 'outcome': 'None', 'details': 'None'}], 'symptoms': [{'name of symptom': 'Weakness and difficulty using right upper extremity', 'intensity of symptom': 'Severe', 'location': 'Right upper extremity', 'time': 'Initially at the age of 16 years', 'temporalisation': 'Progressed over several years', 'behaviours affecting the symptom': 'None', 'details': 'Had to learn to write using left hand due to severity'}, {'name of symptom': 'Severe symmetrical upper extremity weakness and atrophy', 'intensity of symptom': 'Severe', 'location': 'Distal muscles of the upper extremities', 'time': 'Over several years', 'temporalisation': 'Progressive', 'behaviours affecting the symptom': 'None', 'details': 'Lower extremities were spared'}, {'name of symptom': 'Left upper arm intermittent mild pressure pain', 'intensity of symptom': 'Mild', 'location': 'Left upper arm', 'time': 'Recent', 'temporalisation': 'Intermittent', 'behaviours affecting the symptom': 'None', 'details': 'Increased difficulty performing fine motor tasks with left hand'}, {'name of symptom': 'Dysphagia', 'intensity of symptom': 'None', 'location': 'None', 'time': 'Recent', 'temporalisation': 'Intermittent episodes while eating solid foods', 'behaviours affecting the symptom': 'None', 'details': 'No previous bulbar symptoms prior to recent clinical deterioration'}], 'medical examinations': [{'name': 'Clinical examination', 'result': 'Significant bilateral upper extremity muscle atrophy and associated weakness, severe asymmetric focal segmental atrophy of bilateral forearm flexor and extensor muscle groups, preserved and prominent bilateral brachioradialis muscles, severe weakness in upper extremities, 4-/5 to 5/5 proximal strength, as low as 1/5 strength in distal muscles, bilateral radial deviation during wrist extension', 'details': 'None'}], 'diagnosis tests': [{'test': 'Muscle biopsy', 'severity': 'None', 'result': 'Confirmed diagnosis of muscular dystrophy', 'condition': 'Muscular dystrophy', 'time': 'Performed in Mexico after initial diagnosis at age 25', 'details': 'None'}], 'treatments': [{'name': 'None', 'related condition': 'None', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'None', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'Referred for neurological examination to establish care and evaluate worsening symptoms', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'Referred for neurological examination to establish care and evaluate worsening symptoms', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'None', 'related condition': 'None', 'dosage': 'None', 'time': 'None', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'None', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n","Key: 80727\n","Value: {'note': 'A 74 year-old Caucasian woman with complete heart block had dual chamber pacemaker implanted in 1990. Her initial system included a Medtronic 4504 passive fixation atrial lead and a Medtronic 4004 passive fixation ventricular lead. She subsequently underwent replacement of her pulse generator in 1998 and insertion of a new Medtronic 5568 active fixation atrial lead and a Medtronic 4068 ventricular leads in August 2003 due to lead failure. She underwent a subsequent generator change in June 2011. The original atrial and ventricular leads were abandoned when the new leads were added in 2003. All procedures had been undertaken at a referring institution and she had not had any prior open-heart surgical procedures. The patient presented at her home hospital with a swollen and erythematous pacemaker pocket in February 2014. Blood cultures did not grow any bacterial or fungal organisms. A trans-esophageal echocardiogram was performed to assess for vegetations on the leads. No vegetations were identified, but there was suspicion that one her atrial lead was extravascular. She underwent chest computerized tomographic imaging and this study revealed that one of her right atrial lead tips was approximately 2 cm within the pericardial space (Figure ). The patient was treated with vancomycin and ceftriaxone based on a diagnosis of suspected pacemaker pocket infection. She underwent pacemaker pocket exploration and debridement, but extraction was not undertaken due to the increased risks involved with the lead being extra-vascular. No organism was identified from samples of fluid cultured during that initial debridement procedure. Despite that debridement procedure and prolonged antibiotics there was clinical recurrence of the infection and the patient was subsequently transferred to our center for complex lead extraction.\\nTo minimize the risk of vascular disruption and tamponade given the chronic right atrial lead perforation, a combined transvenous and open surgical extraction approach was undertaken. Using a dedicated hybrid operating theatre with cardiopulmonary bypass support if necessary, midline sternotomy was performed. Dense adhesions were found within the pericardial space consistent with likely prior pericarditis. Given the location of the RA lead, care was taken to leave the right atrial dissection', 'visit motivation': 'Swollen and erythematous pacemaker pocket', 'summary': {'visit motivation': 'Swollen and erythematous pacemaker pocket', 'admission': [{'reason': 'Suspected pacemaker pocket infection and complex lead extraction', 'date': 'February 2014', 'duration': 'None', 'care center details': 'Home hospital initially, then transferred to another center for complex lead extraction'}], 'patient information': {'age': '74', 'sex': 'Woman', 'ethnicity': 'Caucasian', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Complete heart block, had dual chamber pacemaker implanted, lead failure, no prior open-heart surgical procedures', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Pacemaker implantation and subsequent interventions due to lead failure and generator changes', 'Type': 'Dual chamber pacemaker implantation, pulse generator replacement, lead replacement, pacemaker pocket exploration and debridement, combined transvenous and open surgical extraction', 'time': 'Implantation in 1990, replacements in 1998 and 2003, generator change in 2011, exploration and debridement in February 2014, extraction at the time of transfer to another center', 'outcome': 'Initial surgeries successful, extraction complicated due to extravascular lead', 'details': 'Original atrial and ventricular leads abandoned in 2003, dense adhesions found during extraction consistent with likely prior pericarditis'}], 'symptoms': [{'name of symptom': 'Swollen and erythematous pacemaker pocket', 'intensity of symptom': 'None', 'location': 'Pacemaker pocket', 'time': 'Presented in February 2014', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Clinical recurrence of the infection despite debridement procedure and prolonged antibiotics'}], 'medical examinations': [{'name': 'Trans-esophageal echocardiogram', 'result': 'No vegetations identified, suspicion of extravascular atrial lead', 'details': 'None'}, {'name': 'Chest computerized tomographic imaging', 'result': 'Right atrial lead tip approximately 2 cm within the pericardial space', 'details': 'None'}], 'diagnosis tests': [{'test': 'Blood cultures', 'severity': 'None', 'result': 'No bacterial or fungal organisms grown', 'condition': 'Suspected pacemaker pocket infection', 'time': 'None', 'details': 'None'}], 'treatments': [{'name': 'Vancomycin and ceftriaxone', 'related condition': 'Suspected pacemaker pocket infection', 'dosage': 'None', 'time': 'Started in February 2014', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment of suspected pacemaker pocket infection', 'reaction to treatment': 'Clinical recurrence of the infection despite treatment', 'details': 'Prolonged antibiotics'}], 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'None', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Vancomycin and ceftriaxone', 'related condition': 'Suspected pacemaker pocket infection', 'dosage': 'None', 'time': 'Started in February 2014', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment of suspected pacemaker pocket infection', 'reaction to treatment': 'Clinical recurrence of the infection despite treatment', 'details': 'Prolonged antibiotics'}]}\n","---\n","Key: 49286\n","Value: {'note': \"We report the case of a 59-year-old man with hypertension and dyslipidemia, both of which were being treated by his primary physician. The patient suffered a traumatic lumbar fracture in 2013 owing to a fall and underwent surgery. Computed tomography (CT) scans performed at the time were focused on the lumbar spine, so other organs were barely included in the image range and no contrast medium was used. However, when carefully observed retrospectively, the CT scan showed a partial inward deviation of the intimal calcification of the abdominal aorta, suggesting a localized dissection of the abdominal aorta (). However, there was no mention of localized aortic dissection, because the dissection was fairly localized and did not show any abnormal findings, such as aneurysm formation. In addition, the adventitia causing the aortic dissection was also calcified. The findings suggested a chronic aortic dissection that occurred even before the trauma, rather than an acute aortic dissection that occurred at the time of the trauma.\\nIn March 2020, the patient was admitted to the emergency department of a nearby general hospital for vomiting. He had no abdominal pain and was subsequently diagnosed with acute gastroenteritis and prescribed oral medication. On physical examination, palpation of the abdomen revealed a pulsating mass, and the patient subsequently consulted his family doctor. After abdominal ultrasound examination, the patient's doctor diagnosed him with an AAA. He subsequently referred the patient to another hospital for a contrast CT scan and a full workup of the AAA. After the enhanced CT scan, the patient was referred to our hospital, where we determined that urgent treatment was necessary owing to the irregular nature of the aneurysm.\\nAlthough he did not have any findings suggestive of an infectious disease such as fever or pain, we first considered the possibility of an infectious aortic aneurysm because it was an irregular aneurysm. Upon examination, a pulsating abdominal mass was found, but without tenderness at the site. We conducted a screening test to locate the source of infection. Furthermore, a blood culture was performed, and the results were negative. An oral examination\", 'visit motivation': 'Vomiting', 'summary': {'visit motivation': 'Vomiting', 'admission': [{'reason': 'Diagnosed with acute gastroenteritis and discovery of a pulsating mass in the abdomen', 'date': 'March 2020', 'duration': 'None', 'care center details': 'Emergency department of a nearby general hospital'}], 'patient information': {'age': '59', 'sex': 'Male', 'ethnicity': 'None', 'weight': 'None', 'height': 'None', 'family medical history': 'None', 'recent travels': 'None', 'socio economic context': 'None', 'occupation': 'None'}, 'patient medical history': {'physiological context': 'Hypertension, dyslipidemia, traumatic lumbar fracture in 2013, chronic aortic dissection', 'psychological context': 'None', 'vaccination history': 'None', 'allergies': 'None', 'exercise frequency': 'None', 'nutrition': 'None', 'sexual history': 'None', 'alcohol consumption': 'None', 'drug usage': 'None', 'smoking status': 'None'}, 'surgeries': [{'reason': 'Traumatic lumbar fracture', 'Type': 'Surgery on lumbar spine', 'time': '2013', 'outcome': 'None', 'details': 'Surgery was performed due to a fall'}], 'symptoms': [{'name of symptom': 'Vomiting', 'intensity of symptom': 'None', 'location': 'None', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'No abdominal pain was associated with the vomiting'}, {'name of symptom': 'Pulsating abdominal mass', 'intensity of symptom': 'None', 'location': 'Abdomen', 'time': 'None', 'temporalisation': 'None', 'behaviours affecting the symptom': 'None', 'details': 'Mass was not tender on palpation'}], 'medical examinations': [{'name': 'Physical examination', 'result': 'Pulsating abdominal mass', 'details': 'Palpation of the abdomen revealed a pulsating mass'}, {'name': 'Abdominal ultrasound examination', 'result': 'Diagnosis of an abdominal aortic aneurysm (AAA)', 'details': \"Conducted by the patient's family doctor\"}], 'diagnosis tests': [{'test': 'Computed tomography (CT) scan', 'severity': 'None', 'result': 'Localized dissection of the abdominal aorta, chronic aortic dissection', 'condition': 'Chronic aortic dissection', 'time': '2013', 'details': 'CT scans were focused on the lumbar spine, no contrast medium was used'}, {'test': 'Contrast CT scan', 'severity': 'None', 'result': 'Irregular aneurysm', 'condition': 'Abdominal aortic aneurysm (AAA)', 'time': 'After March 2020', 'details': 'Patient was referred to another hospital for a full workup of the AAA'}, {'test': 'Blood culture', 'severity': 'None', 'result': 'Negative', 'condition': 'Infectious aortic aneurysm', 'time': 'None', 'details': 'To rule out infectious aortic aneurysm'}], 'treatments': [{'name': 'Oral medication', 'related condition': 'Acute gastroenteritis', 'dosage': 'None', 'time': 'March 2020', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for symptoms of acute gastroenteritis', 'reaction to treatment': 'None', 'details': 'None'}], 'discharge': {'reason': 'None', 'referral': 'Referred to another hospital for a contrast CT scan and a full workup of the AAA, then to the reporting hospital for urgent treatment of the aneurysm', 'follow up': 'None', 'discharge summary': 'None'}}, 'discharge': {'reason': 'None', 'referral': 'Referred to another hospital for a contrast CT scan and a full workup of the AAA, then to the reporting hospital for urgent treatment of the aneurysm', 'follow up': 'None', 'discharge summary': 'None'}, 'treatments': [{'name': 'Oral medication', 'related condition': 'Acute gastroenteritis', 'dosage': 'None', 'time': 'March 2020', 'frequency': 'None', 'duration': 'None', 'reason for taking': 'Treatment for symptoms of acute gastroenteritis', 'reaction to treatment': 'None', 'details': 'None'}]}\n","---\n"]}]},{"cell_type":"markdown","source":["Create functions to use from the UI to show content in dropdowns and textboxes."],"metadata":{"id":"qzf80LjEgtoG"}},{"cell_type":"code","source":["def get_motivation_from_patient_id(patientId):\n"," return patientSample.get(patientId)['visit motivation']\n","\n","def get_note_from_patient_id(patientId):\n"," return patientSample.get(patientId)['note']\n","\n","def get_treatment_plan_from_patient_id(patientId):\n"," print(patientSample.get(patientId))\n"," summary = patientSample.get(patientId)['summary']\n"," return (\"Treatments: \" + str(summary.get('treatments', 'N/A')) +\n"," \" Discharge notes: \" + str(summary.get('discharge', 'N/A')))\n"],"metadata":{"id":"eAbmn96Sjarq","executionInfo":{"status":"ok","timestamp":1775609324744,"user_tz":240,"elapsed":3,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":364,"outputs":[]},{"cell_type":"markdown","source":["Assist medical staff by summarizing treatment plan from their notes."],"metadata":{"id":"4fMC8V_lg498"}},{"cell_type":"code","source":["def json_section_to_text(json_obj):\n"," parts = []\n","\n"," # Simple mapping that includes only non-empty fields.\n"," if json_obj.get(\"visit motivation\"):\n"," motiviation = \"Visit motivation: \" + json_obj[\"visit motivation\"]\n"," parts.append(motiviation)\n"," print(motiviation)\n"," if json_obj.get(\"patient information\"):\n"," patientInfo = \"Patient information: \" + json_obj[\"patient information\"]\n"," parts.append(patientInfo)\n"," print(patientInfo)\n","\n"," return \"\\n\\n\".join(parts)"],"metadata":{"id":"LMtTAnyog-7W","executionInfo":{"status":"ok","timestamp":1775609324747,"user_tz":240,"elapsed":1,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":365,"outputs":[]},{"cell_type":"markdown","source":["Create a question answering pipeline to answer questions about the patient's treatment plan."],"metadata":{"id":"vlPrZzh4hUKF"}},{"cell_type":"code","source":["from transformers import pipeline, AutoTokenizer\n","generator = pipeline(\"question-answering\", model=\"distilbert-base-uncased-distilled-squad\")\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":49,"referenced_widgets":["30d992ddb3a24503977ddfa7f0b60c05","5afd9152fab54e5da8db250c75bd08b6","4b8c597d809d4e25b62e779df7f3c71d","2ca0a8f6367c4944bf9b62756c287dbc","5c2d8bdc8ba8497193990681714a26b8","367caee4736c4fbaaab5fbcc952aba19","9f0f0fa8861b4929aa133e4ef71da775","5779ec7a0766424db8ae122ced12f056","5300b1b2e97c42209ed6414542867724","924afe989e554603a28ea3dbf77b8d7d","b0d5293e1ff5409bb3a87ae6461fbca8"]},"executionInfo":{"status":"ok","timestamp":1775609329507,"user_tz":240,"elapsed":4758,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}},"outputId":"77c50d99-8946-4b2a-b3e6-7683e62766a3","id":"d7DL_KBD6nw2"},"execution_count":366,"outputs":[{"output_type":"display_data","data":{"text/plain":["Loading weights: 0%| | 0/102 [00:00"],"text/html":["
"]},"metadata":{}},{"output_type":"execute_result","data":{"text/plain":[]},"metadata":{},"execution_count":369}]},{"cell_type":"code","source":[],"metadata":{"id":"m_MPLEYWUhED","executionInfo":{"status":"ok","timestamp":1775609333572,"user_tz":240,"elapsed":53,"user":{"displayName":"Donnie G","userId":"08794454185807289257"}}},"execution_count":369,"outputs":[]}]}