OHDSI Home | Forums | Wiki | Github

Case Adjudication with the help of LLM

I like Martijn’s plenary talk on using LLMs for case adjudication. The approach involved feeding patient-level narratives to the LLM, which then performed case-level adjudication to determine case or non-case scenarios. The adjudication performed by the LLM seemed good.

The narratives given to it were well-structured, encompassing details such as the patient’s age, gender, and other demographics, along with their presentation, assessment, treatment regimen, and the nature of the visit. The structuring process involved a critical step where an individual, either Patrick or Anna, crafted rules to filter out irrelevant conceptIds from the plethora of conceptIds a patient might have around the time of diagnosis. For instance, in a case concerning ‘Rheumatoid Arthritis,’ unrelated conceptIds like ‘ear pain,’ ‘sore throat’ were filtered out. This refined data was then handed over to the keeper for a mini feature extraction pertaining to the case under review. In essence, Patrick and Anna acted as the ‘experts,’ aiding the LLM in focusing on relevant information by eliminating the ‘noise.’

This process made me think - can we potentially automate the ‘expert’ role performed by Patrick and Anna using LLM? Can we then use it with CohortDiagnostics?

So I engineered this prompt

"Assume you are a specialist physician with expertise in the disease: Drug-Induced Liver Injury (DILI). Your task is to compile a markdown table that encompasses a comprehensive list of medical terms, including synonyms, associated with the disease. The table should have two columns: ‘Terms’ and ‘Clinical Domain’.

Instructions:
Under the ‘Terms’ column, list medical terms relevant to the disease, covering the categories below:

  • Early symptoms of the disease
  • Signs indicative of the disease
  • Defining terms associated with the disease
  • Relevant tests for diagnosing the disease
  • Treatments for managing the disease
  • Conditions that commonly co-occur with the disease
  • Drug ingredients used in the treatment of the disease
  • Visit settings where the disease is likely to be managed (e.g., inpatient, outpatient, doctor’s office).

In the ‘Clinical Domain’ column, categorize each term into one of the following: ‘Symptom’, ‘Sign’, ‘Defining Term’, ‘Test Name’, ‘Treatment Name’, ‘Co-occurring Condition’, ‘Visit Setting’.

Ensure your table is thorough and demonstrates your specialized knowledge in the disease."

it gave me

Terms Clinical Domain
Jaundice Symptom
Fatigue Symptom
Abdominal pain Symptom
Nausea Symptom
Hepatomegaly Sign
Elevated liver enzymes Sign
Hyperbilirubinemia Sign
Ascites Sign
Hepatotoxicity Defining Term
Idiosyncratic liver injury Defining Term
Liver necrosis Defining Term
Hepatocellular injury Defining Term
Liver function tests (LFTs) Test Name
Alanine aminotransferase (ALT) Test Name
Aspartate aminotransferase (AST) Test Name
Bilirubin levels Test Name
Alkaline phosphatase levels Test Name
Hepatic ultrasound Test Name
Liver biopsy Test Name
Discontinuation of offending drug Treatment Name
Corticosteroids Treatment Name
Ursodeoxycholic acid Treatment Name
Liver transplant Treatment Name
Alcoholic hepatitis Co-occurring Condition
Viral hepatitis Co-occurring Condition
Autoimmune hepatitis Co-occurring Condition
Acetaminophen Drug Ingredient
Amoxicillin-clavulanate Drug Ingredient
Isoniazid Drug Ingredient
Hospital (Inpatient) Visit Setting
Liver clinic (Outpatient) Visit Setting
Doctor’s office Visit Setting

That was nice. Now i went to CohortDiagnostics. I went to @Azza_Shoaibi work presented at ICPE 2023 presentation posted here https://data.ohdsi.org/icpe_2023_designated_medical_events/ (Cohort Diagnostics output screen shot). In the characterization diagnostics, i downloaded the spreadsheet and copied the top 50 features in the condition, procedure, observation, measurement domain for the time window 0, -1 to 30, +1 to 30 time windows.

"Based on the table created previously, and utilizing your medical expertise, categorize the following terms according to their clinical relevance to the Disease. The categories are:

Related: High confidence that the term reflects the clinical aspects of the disease.
Potentially Related: Probable clinical association with the disease.
Potentially Unrelated: Lesser likelihood of clinical association with the disease.
Unrelated: No clinical correlation with the disease.
Disqualifier: Clinical terms or conditions that, when present, significantly reduce the likelihood or rule out the presence of the disease.

Present the results in a markdown table with ‘Terms’ and ‘Relationship’ as column headers. In the ‘Relationship’ column, specify one of the four categories: ‘Related’, ‘Potentially Related’, ‘Potentially Unrelated’, or ‘Unrelated’.

Terms: ‘Inflammatory disease of liver’, ‘Laboratory - General Classification’, ‘Laboratory - Chemistry’, ‘Pharmacy - General Classification’, ‘Laboratory - Hematology’, ‘Emergency Room - General Classification’, ‘EKG/ECG - General Classification’, ‘Jaundice’, ‘Essential hypertension’, ‘Laboratory - Bacteriology and Microbiology’, ‘Medical/Surgical Supplies and Devices - Sterile’, ‘Hepatic failure’, ‘Other Imaging Services - Ultrasound’, ‘Pharmacy - IV Solutions’, ‘Radiology - Diagnostic - General Classification’, ‘Laboratory - Urology’, ‘Radiology - Diagnostic - Chest X-Ray’, ‘Medical/Surgical Supplies and Devices - General Classification’, ‘Hyperlipidemia’, ‘Drugs Identification - Drugs Requiring Detailed Coding’, ‘Laboratory - Immunologu’, ‘History of event’, ‘Acute renal failure syndrome’, ‘Ground mileage, per statute mile’, ‘CT Scan - Body Scan’, ‘Respiratory Services - General Classification’, ‘Type 2 diabetes mellitus without complication’, ‘Anemia’, ‘Patient encounter procedure’, ‘Physical Therapy - General Classification’, ‘Physical Therapy - Evaluation Or Re-Evaluation’, ‘Abdominal pain’, ‘Anesthesia - General Classification’, ‘Operating Room Services - General Classification’, ‘IV Therapy - General classification’, ‘Sepsis’, ‘Pulmonary Function - General Classification’, ‘Blood Storage and Processing - General Classification’, ‘CT Scan - Head Scan’, ‘Ambulance service, advanced life support, emergency transport, level 1 (als 1 - emergency)’, ‘Acidosis’, ‘Recovery Room - General Classification’, ‘CT Scan - General Classification’, ‘Mental Health Substance Abuse Coverage Indicator’, ‘Dyspnea’, ‘Long-term current use of drug therapy’, ‘Chest pain’, ‘Chronic obstructive lung disease’, ‘Congestive heart failure’, ‘Ascites’, ‘Type 2 diabetes mellitus’, ‘Urinary tract infectious disease’, ‘Atrial fibrillation’, ‘Cirrhosis of liver’, ‘Malaise’, ‘Blood chemistry abnormal’, ‘Clinic - General Classification’, ‘Atherosclerosis of coronary artery without angina pectoris’, ‘Gastroesophageal reflux disease without esophagitis’, ‘Benign essential hypertension’, ‘Room & Board - Semi-private Two Bed (Medical or General) - General classification’, ‘Medical/Surgical Supplies and Devices - Other Implants’, ‘Occupational Therapy - General classification’, ‘Pleural effusion’, ‘Pure hypercholesterolemia’, ‘Low back pain’, ‘Other Diagnostic Services - Peripheral Vascular Lab’, ‘Long-term current use of anticoagulant’, ‘Laboratory Pathological - General Classification’, ‘Disease of liver’, ‘Thrombocytopenic disorder’, ‘Occupational Therapy - Evaluation or Re-evaluation’, ‘Cough’, ‘Operating Room Services - Minor Surgery’, ‘Medical/Surgical Supplies and Devices - Non Sterile’, ‘Nausea and vomiting’, ‘Hypokalemia’, ‘Pharmacy - Drugs incident to Radiology’, ‘Gastro Intestinal Services - General Classification’, ‘Heart failure’, ‘Hypo-osmolality and or hyponatremia’, ‘Cirrhosis - non-alcoholic’, ‘Asthenia’, ‘Hypothyroidism’, ‘Iron deficiency anemia’, ‘Echocardiology’, ‘Chronic kidney disease stage 3’, ‘Pharmacy - Other Pharmacy’, ‘Chronic kidney disease’, ‘Treatment/Observation Room - Treatment Room’, ‘Chronic hepatitis C’, ‘Dehydration’, ‘Treatment/Observation Room - Observation Room’, ‘Single liveborn born in hospital by vaginal delivery’, ‘Mixed hyperlipidemia’, ‘Obstructive sleep apnea syndrome’, ‘Laboratory Pathological - Histology’, ‘Fever’, ‘Room & Board - Semi-private Two Bed (Medical or General) - Medical/Surgical/Gyn’, ‘Atelectasis’, ‘Electrocardiogram abnormal’, ‘Muscle weakness’, ‘Newborn - Level I’, ‘Long-term current use of insulin’, ‘Abnormal findings on diagnostic imaging of lung’, ‘Diarrhea’, ‘Edema’, ‘Obesity’, ‘Skilled Nursing - Visit Charge’, ‘Cardiology - General Classification’, ‘Altered mental status’, ‘Low blood pressure’, ‘Disorder of brain’, ‘Acute hypoxemic respiratory failure’, ‘Leukocytosis’, ‘Ambulance service, basic life support, non-emergency transport, (bls)’, ‘Cardiomegaly’, ‘Obstruction of bile duct’, ‘Respiratory failure’, ‘Disorder of biliary tract’, ‘Alcoholic cirrhosis’, ‘Pneumonia’, ‘Septic shock’, ‘Gastrointestinal hemorrhage’, ‘Liver function tests abnormal’, ‘Portal hypertension’, ‘Hypoxemia’"

and i got

Terms Relationship
Inflammatory disease of liver Related
Laboratory - General Classification Potentially Related
Laboratory - Chemistry Related
Pharmacy - General Classification Potentially Related
Laboratory - Hematology Potentially Related
Emergency Room - General Classification Potentially Unrelated
EKG/ECG - General Classification Potentially Unrelated
Jaundice Related
Essential hypertension Unrelated
Laboratory - Bacteriology and Microbiology Potentially Unrelated
Medical/Surgical Supplies and Devices - Sterile Potentially Unrelated
Hepatic failure Related
Other Imaging Services - Ultrasound Related
Pharmacy - IV Solutions Potentially Related
Radiology - Diagnostic - General Classification Potentially Related
Laboratory - Urology Potentially Unrelated
Radiology - Diagnostic - Chest X-Ray Potentially Unrelated
Medical/Surgical Supplies and Devices - General Classification Potentially Unrelated
Hyperlipidemia Unrelated
Drugs Identification - Drugs Requiring Detailed Coding Related
Laboratory - Immunology Potentially Related
History of event Potentially Related
Acute renal failure syndrome Potentially Related
Ground mileage, per statute mile Unrelated
CT Scan - Body Scan Potentially Related
Respiratory Services - General Classification Potentially Unrelated
Type 2 diabetes mellitus without complication Unrelated
Anemia Potentially Related
Patient encounter procedure Potentially Unrelated
Physical Therapy - General Classification Unrelated
Physical Therapy - Evaluation Or Re-Evaluation Unrelated
Abdominal pain Related
Anesthesia - General Classification Potentially Unrelated
Operating Room Services - General Classification Potentially Unrelated
IV Therapy - General classification Potentially Related
Sepsis Potentially Related
Pulmonary Function - General Classification Potentially Unrelated
Blood Storage and Processing - General Classification Potentially Unrelated
CT Scan - Head Scan Potentially Unrelated
Ambulance service, advanced life support, emergency transport, level 1 (als 1 - emergency) Potentially Unrelated
Acidosis Potentially Related
Recovery Room - General Classification Potentially Unrelated
CT Scan - General Classification Potentially Related
Mental Health Substance Abuse Coverage Indicator Unrelated
Dyspnea Potentially Unrelated
Long-term current use of drug therapy Related
Chest pain Potentially Unrelated
Chronic obstructive lung disease Unrelated
Congestive heart failure Unrelated
Ascites Related
Type 2 diabetes mellitus Unrelated
Urinary tract infectious disease Unrelated
Atrial fibrillation Unrelated
Cirrhosis of liver Related
Malaise Related
Blood chemistry abnormal Related
Clinic - General Classification Potentially Unrelated
Atherosclerosis of coronary artery without angina pectoris Unrelated
Gastroesophageal reflux disease without esophagitis Unrelated
Benign essential hypertension Unrelated
Room & Board - Semi-private Two Bed (Medical or General) - General classification Potentially Unrelated
Medical/Surgical Supplies and Devices - Other Implants Potentially Unrelated
Occupational Therapy - General classification Unrelated
Pleural effusion Potentially Unrelated
Pure hypercholesterolemia Unrelated
Low back pain Unrelated
Other Diagnostic Services - Peripheral Vascular Lab Potentially Unrelated
Long-term current use of anticoagulant Potentially Unrelated
Laboratory Pathological - General Classification Potentially Related
Disease of liver Related
Thrombocytopenic disorder Potentially Related
Occupational Therapy - Evaluation or Re-evaluation Unrelated
Cough Potentially Unrelated
Operating Room Services - Minor Surgery Potentially Unrelated
Medical/Surgical Supplies and Devices - Non Sterile Potentially Unrelated
Nausea and vomiting Related
Hypokalemia Potentially Related
Pharmacy - Drugs incident to Radiology Potentially Related
Gastro Intestinal Services - General Classification Potentially Unrelated
Heart failure Unrelated
Hypo-osmolality and or hyponatremia Potentially Related
Cirrhosis - non-alcoholic Related
Asthenia Related
Hypothyroidism Unrelated
Iron deficiency anemia Potentially Related
Echocardiology Potentially Unrelated
Chronic kidney disease stage 3 Unrelated
Pharmacy - Other Pharmacy Potentially Related
Chronic kidney disease Unrelated
Treatment/Observation Room - Treatment Room Potentially Unrelated

This gave me a lot of new ideas, just listing a few

  1. Create a web of knowledge of concept relationship that is based on expert opinion of the LLM and the concept prevalence + patient context/co-occurrence data?
  2. Can we use this as a service to help phenotype development and evaluation - including case adjudication
    (ok i am tired, i wish i could ask LLM to write this)
1 Like

Any one interested in this idea? @jennareps @Juan_Banda can prediction classifier help to do a quality check, @Azza_Shoaibi what do you think of the CohortDiagnostics output, @jswerdel can this be an input for PheValuator 3.0 (cage match between PheValuator and LLM)

@Gowtham_Rao : could you help me understand how the LLMs classification of the relationships could be used?

My initial motivation was to remove the expert in the loop - in this case Patrick and Anna. Their role was to help create the case narrative using keeper.

What I did was use the population level/group level characteristics (as in seen in CohortDiagnostics) for a rule a based cohort, to select a subset of conceptId’s (represented by its concept name) that was observed frequently in the data in the time window -30 to -1, 0, +1 to 30.

I then asked the LLM to classify the concept name on a scale that conveys its judgment on the relationship. Here the scale was related, potentially related, potentially unrelated, unrelated, disqualifier.

Now, we can remove the expert in the loop to make the case profile description, by providing to keeper the conceptIds that are classified by related, or some of likely related that are above a certain prevalence threshold.

@Gowtham_Rao: So the “relationship” really is a filter on whether a concept belongs to the case under validation? I would probably call it “relevance to case”.

Question: Why do you need that? If the entire process will be electronic, why do you need to have a filtered down summary version of the patient? For humans that is clear, people would drown in unnecessary information. But chatGPT?

To reduce the chance of hallucination or confabulation. We need to constrain the LLM.

Filtering achieves that constrain. Just like humans, chatGpt can also get drowned. In its case - if the number of inputs goes high, it has an exponential paths to predict and can make mistakes. As we know, onces it picks a path, it cant stop - it just keeps going down the path and completes the document i.e. confabulates.

Understood. You will have to show that the extra filtering step will prevent that, and isn’t part of the “going down the path” already. Because the relevance thing requires the same logic as answering the question “Is this a case or not?”

Yes, lot of work in this space. Next year Phenotype Phebruary has a lot of ideas :slight_smile:

We have to do that again???
:slight_smile:

This morning i decided to look at drugs.

I gave it this prompt

"By utilizing your medical expertise, categorize the following drug name terms according to their clinical relevance for the treatment of the Disease: ‘Acute Liver Injury’. The categories are:

Related: High confidence that the term reflects the clinical aspects of the disease.
Potentially Related: Probable clinical association with the disease.
Potentially Unrelated: Lesser likelihood of clinical association with the disease.
Unrelated: No clinical correlation with the disease.
Disqualifier: Clinical terms or conditions that, when present, significantly reduce the likelihood or rule out the presence of the disease.

Present the results in a markdown table with ‘Terms’ and ‘Relationship’ as column headers. In the ‘Relationship’ column, specify one of the four categories: ‘Related’, ‘Potentially Related’, ‘Potentially Unrelated’, or ‘Unrelated’.

Terms: ‘sodium chloride’, ‘ondansetron’, ‘acetaminophen’, ‘potassium chloride’, ‘glucose’, ‘pantoprazole’, ‘heparin’, ‘lactulose’, ‘morphine’, ‘albuterol’, ‘furosemide’, ‘fentanyl’, ‘calcium chloride’, ‘lidocaine’, ‘lorazepam’, ‘vancomycin’, ‘aspirin’, ‘ceftriaxone’, ‘midazolam’, ‘lactate’, ‘piperacillin’, ‘tazobactam’, ‘hydromorphone’, ‘docusate’, ‘propofol’, ‘magnesium sulfate’, ‘thiamine’, ‘enoxaparin’, ‘famotidine’, ‘folic acid’, ‘spironolactone’, ‘oxycodone’, ‘cholecalciferol’, ‘ipratropium’, ‘glucagon’, ‘naloxone’, ‘Multivitamin preparation’, ‘hydrocodone’, ‘magnesium hydroxide’, ‘metoprolol’, ‘norepinephrine’, ‘sennosides, USP’, ‘omeprazole’, ‘polyethylene glycol 3350’, ‘vitamin K1’, ‘diphenhydramine’, ‘sodium bicarbonate’, ‘insulin aspart, human’, ‘bisacodyl’, ‘epinephrine’, ‘insulin, regular, human’, ‘iohexol’, ‘simethicone’, ‘albumin human, USP’, ‘lisinopril’, ‘rifaximin’, ‘ibuprofen’, ‘aluminum hydroxide’, ‘metronidazole’, ‘nitroglycerin’, ‘cefepime’, ‘levofloxacin’, ‘phenylephrine’, ‘gabapentin’, ‘levothyroxine’, ‘promethazine’, ‘atorvastatin’, ‘insulin lispro’, ‘chlorhexidine’, ‘tramadol’, ‘calcium carbonate’, ‘ciprofloxacin’, ‘amlodipine’, ‘calcium gluconate’, ‘influenza A virus (H3N2) antigen’, ‘influenza B virus antigen’, ‘influenza A virus (H1N1) antigen’, ‘metformin’, ‘metoclopramide’, ‘diazepam’, ‘azithromycin’, ‘fluticasone’, ‘ketorolac’, ‘vitamin B12’, ‘hydralazine’, ‘octreotide’, ‘nicotine’, ‘dexamethasone’, ‘magnesium oxide’, ‘amiodarone’, ‘prednisone’, ‘methylprednisolone’, ‘atropine’, ‘ferrous sulfate’, ‘prochlorperazine’, ‘hydrocortisone’, ‘vasopressin (USP)’, ‘hydrochlorothiazide’, ‘etomidate’, ‘succinylcholine’, ‘insulin glargine’, ‘sodium phosphate, monobasic’, ‘zolpidem’, ‘sodium phosphate, dibasic’, ‘propranolol’, ‘trazodone’, ‘rocuronium’, ‘cefazolin’, ‘melatonin’, ‘alprazolam’, ‘guaifenesin’, ‘ascorbic acid’, ‘carvedilol’, ‘insulin argine’, ‘haloperidol’, ‘hydroxyzine’, ‘warfarin’, ‘Streptococcus pneumoniae type 19A capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 6B capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 3 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 4 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 2 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 12F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 5 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 11A capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 8 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 9N capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 15B capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 22F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 10A capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 23F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 18C capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 20 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 17F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 33F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 9V capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 7F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 1 capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 19F capsular polysaccharide antigen’, ‘Streptococcus pneumoniae type 14 capsular polysaccharide antigen’,"

and it gave me

Terms Relationship
acetaminophen Related
lactulose Related
N-acetylcysteine (not listed but relevant) Related
sodium chloride Potentially Related
potassium chloride Potentially Related
glucose Potentially Related
pantoprazole Potentially Related
heparin Potentially Related
furosemide Potentially Related
calcium chloride Potentially Related
aspirin Potentially Related
magnesium sulfate Potentially Related
spironolactone Potentially Related
sodium bicarbonate Potentially Related
ondansetron Potentially Unrelated
morphine Potentially Unrelated
albuterol Potentially Unrelated
fentanyl Potentially Unrelated
lidocaine Potentially Unrelated
lorazepam Potentially Unrelated
vancomycin Potentially Unrelated
ceftriaxone Potentially Unrelated
midazolam Potentially Unrelated
lactate Potentially Unrelated
piperacillin Potentially Unrelated
tazobactam Potentially Unrelated
hydromorphone Potentially Unrelated
docusate Potentially Unrelated
propofol Potentially Unrelated
thiamine Potentially Unrelated
enoxaparin Potentially Unrelated
famotidine Potentially Unrelated
folic acid Potentially Unrelated
oxycodone Potentially Unrelated
… (and so on for the rest of the terms)

Few observations:

  1. N-acetyl cysteine was not on the list I gave it. It decided to add it.
  2. On a cursory five minute review - clinically i cant find reasons to say it is wrong, except ofcourse acetaminophen. It probably got it wrong because acetaminophen has a strong relationship with liver injury (i think these we can handled using ideas like CEM tool that are from parsing drug labels. obviously a drug that has an AE of liver injury, would not be used to treat liver injury)

Why is it wrong then? Acetaminophen causes liver injury, and therefore has a strong relationship, and therefore your friendo stated it does. Sounds right to me.

Of course, billions of people are taking acetaminophen and nothing happens. So, it’s a HowOften problem. Of all the people taking acetaminophen - how likely is a relationship to liver injury the answer is “negligible”. Of all the people having a liver injury - how likely is a relationship to acetaminophen the answer is “quite a few of them”.

I think these generic “related” to “unrelated” questions GPT is very happy to take, and clearly knows something about things, but without better prompts it will not be your solution.

The prompt was ‘By utilizing your medical expertise, categorize the following drug name terms according to their clinical relevance for the treatment of the Disease:’. Based on that - i would continue to assert it got that wrong.

But, now that i think of it… it can be considered ‘relevant’ to know for treatment. Clearly, if someone says i took a lot of acetaminophen - then that would be relevant to a treatment decision of giving NAC.

I should probably re-engineer the prompt

I rewrote the same prompt with one minor change

By utilizing your medical expertise, categorize the following drug name terms according to their clinical relevance for the treatment of, as defined as curing the disease state, the Disease: ‘Acute Liver Injury’.

I got this.

Terms Relationship
sodium chloride Potentially Related
ondansetron Potentially Related
acetaminophen Related (as a cause)
potassium chloride Potentially Related
glucose Potentially Related
pantoprazole Potentially Unrelated
heparin Potentially Unrelated
lactulose Related
morphine Potentially Unrelated
albuterol Unrelated
furosemide Related
fentanyl Potentially Unrelated
calcium chloride Potentially Related

I wrote a zero-shot using gpt-3.5-turbo-instruct.

There is a lot more that could be added to this pipeline and model, but it looks promising. It’s also a unique use-case where we don’t need to look into local models or vector storage as much as we might with implementations using PHI.

1 Like

Thank you for pushing this idea forward @hspence . Thank you for sharing the detailed python implementation.

log probabilities range between negative infinity and 0. A higher log probability (closer to 0) indicates a higher confidence in that outcome.

This is also interesting

  • Difference Between Values: The absolute difference between the two logprob values can give an indication of how clear-cut the model’s decision was. A larger difference suggests higher confidence in the classification.

I don’t know of an application yet, but if the scores are close it may be telling us something. e.g. calcium carbonate is classified as unrelated, but based on the relative difference with the score for ‘unrelated’ - that maybe with the confidence range. Clinically I don’t remember why calcium carbonate maybe a treatment in a cohort liver injury (maybe its part of several other drugs given in ICU setting).

@hspence thank you for doing this for drugs. Would you be able to do the same output but for conditions in the first post?

Same code ran on the 112 in the first post. It really doesn’t like “potentially unrelated”.

112_result.xlsx (13.8 KB)

Prediction Category Frequency
Unrelated 56
Potentially Related 50
A direct cause of 4
Related 2
t