Skip to main content
Glama
EHRSQL_benchmark.csv93.8 kB
Query,Chat Conversation,Model Answer ,Golden Truth,Golden Truth SQL Query,Correct/Incorrect,Incorrect Note "Throughout this year, what are the top five most common drugs prescribed during the same hospital encounter to female patients aged 50s after being diagnosed with epilepsy, unspecified, not intractable, without status epilepticus?",https://claude.ai/share/351f6bd9-8500-497a-a799-871e408823d6,"Top 5 Most Common Drugs: Levetiracetam (3 prescriptions) Dose: 750 mg IV This is an antiepileptic drug, which is directly relevant to the epilepsy diagnosis Bag (3 prescriptions) IV fluid bags (various volumes) Standard supportive care for hospitalized patients Insulin (2 prescriptions) Diabetes management medication Likely for comorbid diabetes mellitus Bisacodyl (2 prescriptions) Laxative medication Often used to manage constipation in hospitalized patients Acetaminophen (2 prescriptions) Pain reliever and fever reducer Standard analgesic/antipyretic medication",0.9% sodium chloride; acetaminophen; acetaminophen iv; aspirin; atorvastatin; bag; bisacodyl; ferrous sulfate (liquid); glucagon; glucose gel; heparin; insulin; lactated ringers; lansoprazole oral disintegrating tab; levetiracetam; metoprolol succinate xl; midazolam; omeprazole; polyethylene glycol; quetiapine fumarate; scopolamine patch; sertraline; sodium chloride 0.9%,"SELECT T3.drug FROM ( SELECT T2.drug, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'epilepsy, unspecified, not intractable, without status epilepticus' ) AND datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') ) AS T1 JOIN ( SELECT admissions.subject_id, prescriptions.drug, prescriptions.starttime, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.subject_id IN ( SELECT patients.subject_id FROM patients WHERE patients.gender = 'f' ) AND admissions.age BETWEEN 50 AND 59 AND datetime(prescriptions.starttime,'start of year') = datetime(current_time,'start of year','-0 year') ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.starttime AND T1.hadm_id = T2.hadm_id GROUP BY T2.drug ) AS T3 WHERE T3.C1 <= 5",1, Pull up the IDs of patients who were diagnosed with cataract extraction status.,https://claude.ai/share/92ddc13e-ec52-4d10-9cd8-0db23e6ded60,10025612,10025612,SELECT DISTINCT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN ( SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'cataract extraction status' ) ),1, What is the difference between platelet count last measured on the first hospital visit compared to the first value measured on the first hospital visit for patient 10009628?,https://claude.ai/share/01a231aa-6ee4-47fd-bdc6-35e370a4244f,14.0 k/ul,14,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10009628 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count' ) ORDER BY labevents.charttime DESC LIMIT 1 ) - ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10009628 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count' ) ORDER BY labevents.charttime ASC LIMIT 1 ),1, How many days have passed since patient 10039831's last stay in careunit discharge lounge in this hospital visit?,https://claude.ai/share/f80873da-b0d0-4a95-af73-eeea45979f60,Time elapsed since discharge: 4 hours and 22 minutes (0.18 days),828,"SELECT 1 * ( strftime('%J',current_time) - strftime('%J', transfers.intime) ) FROM transfers WHERE transfers.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10039831 AND admissions.dischtime IS NULL ) AND transfers.careunit = 'discharge lounge' ORDER BY transfers.intime DESC LIMIT 1",0,"The provided answer calculated the time difference between the patient’s discharge from the discharge lounge and a fixed current time using the exit time from the careunit (2100-12-31 19:36:43), whereas the gold query used the entry time into the discharge lounge (2100-12-31 04:06:40) for the same calculation. This discrepancy in the reference timestamp led to a significantly lower value (0.18 days vs. 0.828 days). The question only asked how many days had passed since the patient’s last stay in the discharge lounge, which can reasonably be interpreted as starting from either entry or exit time, making the phrasing ambiguous. Therefore, the primary issue is ambiguity in the question or gold query, as the gold query assumes that the start of the stay (intime) should be the reference point without this being clearly stated." Count the number of days since patient 10021487's first diagnosis of acute respiratory failure following trauma and surgery on this hospital visit.,https://claude.ai/share/d85fbdc8-fbc1-479d-828b-7e75c46b74cf,24.98 days,24.983,"SELECT 1 * ( strftime('%J',current_time) - strftime('%J', diagnoses_icd.charttime) ) FROM diagnoses_icd WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'acute respiratory failure following trauma and surgery' ) AND diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021487 AND admissions.dischtime IS NULL ) ORDER BY diagnoses_icd.charttime ASC LIMIT 1",1, "What are the five commonly taken specimens for patients who received extirpation of matter from left lower lung lobe, via natural or artificial opening endoscopic previously during the same month since 2100?",https://claude.ai/share/73e11864-5956-4fe5-ac0d-68db9652237a,"Perfect! Based on the analysis of the MIMIC-IV database, here are the five most commonly taken specimens for patients who received extirpation of matter from left lower lung lobe via natural or artificial opening endoscopic previously during the same month since 2100: Blood culture - 84 specimens taken Sputum - 48 specimens taken Urine - 33 specimens taken Peritoneal fluid - 33 specimens taken Bronchoalveolar lavage - 18 specimens taken",blood culture; bronchoalveolar lavage; fluid received in blood culture bottles; peritoneal fluid; sputum,"SELECT T3.spec_type_desc FROM ( SELECT T2.spec_type_desc, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'extirpation of matter from left lower lung lobe, via natural or artificial opening endoscopic' ) AND strftime('%Y',procedures_icd.charttime) >= '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE strftime('%Y',microbiologyevents.charttime) >= '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T1.charttime,'start of month') = datetime(T2.charttime,'start of month') GROUP BY T2.spec_type_desc ) AS T3 WHERE T3.C1 <= 5",1, Retrieve the marital status of patient 10006580 on the last hospital stay.,https://claude.ai/share/f2b20cf1-e066-47cc-b4cd-7818eb8dfc01,Marital Status: Married,married,SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 10006580 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1,1, "What was the drug that patient 10004720 prescribed with during the same day after receiving introduction of nutritional substance into upper gi, via natural or artificial opening since 03/2100?",https://claude.ai/share/45d06ba7-64e3-4c6b-9bc0-945aa075ff33,"On the same day (2100-12-06), this patient was prescribed two drugs: Docusate sodium - 100mg administered via PO/NG route (multiple prescriptions) Lactated Ringers - 1000ml administered intravenously",docusate sodium; docusate sodium; docusate sodium; lactated ringers,"SELECT T2.drug FROM ( SELECT procedures_icd.charttime, procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'introduction of nutritional substance into upper gi, via natural or artificial opening' ) AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10004720 ) AND strftime('%Y-%m',procedures_icd.charttime) >= '2100-03' ) AS T1 JOIN ( SELECT prescriptions.drug, prescriptions.starttime, prescriptions.hadm_id FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10004720 ) AND strftime('%Y-%m',prescriptions.starttime) >= '2100-03' ) AS T2 ON T1.hadm_id = T2.hadm_id WHERE T1.charttime < T2.starttime AND datetime(T1.charttime,'start of day') = datetime(T2.starttime,'start of day')",1, How frequently was the simple excision of other lymphatic structure procedure done throughout this year?,https://claude.ai/share/3e2123dd-4948-4437-84b6-fcc8d3c573db,Overall Frequency: 1 procedure performed in the entire year 2100,1,"SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'simple excision of other lymphatic structure' ) AND datetime(procedures_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year')",1, How much does patient 10038999 change in mesothelial cells last measured on the last hospital visit compared to the second to last value measured on the last hospital visit?,https://claude.ai/share/94e2b225-4c61-4bce-8991-b47577974ddc,-5.00%,-5,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038999 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mesothelial cells' ) ORDER BY labevents.charttime DESC LIMIT 1 ) - ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038999 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mesothelial cells' ) ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 1 ),1, What was the total output for patient 10001217 since 12/02/2100?,https://claude.ai/share/485234b5-f917-416d-a1ae-603f0a2d9a24,"Total Output: 2,845 mL",2845,"SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10001217 ) ) AND strftime('%Y-%m-%d',outputevents.charttime) >= '2100-12-02'",1, Has there been any organism detected during the last rapid respiratory viral screen & culture microbiology test for patient 10007818 since 02/2100?,https://claude.ai/share/ce6b21c0-0047-45e5-aa00-252e566e3369,Answer: No organisms were detected in the most recent rapid respiratory viral screen & culture microbiology test for patient 10007818 since February 2100,0,"SELECT COUNT(*)>0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10007818 ) AND microbiologyevents.spec_type_desc = 'rapid respiratory viral screen & culture' AND microbiologyevents.org_name IS NOT NULL AND strftime('%Y-%m',microbiologyevents.charttime) >= '2100-02' ORDER BY microbiologyevents.charttime DESC LIMIT 1",1, Please list the top five most frequent specimens tested.,https://claude.ai/share/3a14a5b9-7ec3-4e0b-b346-5e4044d7a4de,"Based on my analysis of the MIMIC-IV database, here are the top five most frequently tested specimens: Blood culture - 222 tests Urine - 214 tests Sputum - 210 tests MRSA screen - 70 tests Stool - 43 tests",blood culture; mrsa screen; sputum; stool; urine,"SELECT T1.spec_type_desc FROM ( SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc ) AS T1 WHERE T1.C1 <= 5",1, "Can you tell me the last care unit patient 10003046 was in during their last hospital visit, according to the transfer record?",https://claude.ai/share/9a2b51f2-7eba-43d4-b88e-5c4712547e1e,"the last care unit they were in was ""med/surg"" (Medical/Surgical unit).",med/surg,SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10003046 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND transfers.careunit IS NOT NULL ORDER BY transfers.intime DESC LIMIT 1,1, What is the length of the first hospital stay in days for patient 10016742?,https://claude.ai/share/8faf0b71-8a4d-42e9-9289-8af104b33313,The length of the first hospital stay for patient 10016742 is 4.96 days (approximately 5 days).,4.963,"SELECT strftime('%J',admissions.dischtime) - strftime('%J',admissions.admittime) FROM admissions WHERE admissions.subject_id = 10016742 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1",1, Which condition was diagnosed for patient 10006580 on the last on the last hospital visit?,https://claude.ai/share/8e439506-b058-4373-a38a-2a75172a71e9,"Gout, unspecified (ICD-9: 2749)","gout, unspecified",SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd_code IN ( SELECT diagnoses_icd.icd_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10006580 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) ORDER BY diagnoses_icd.charttime DESC LIMIT 1 ),1, "For patients who had hemodialysis, what were the most frequent four microbiology tests carried out during the same hospital visit?",https://claude.ai/share/9703d3a8-4d86-4360-960c-53f9dbd6410a,"Results Blood culture, routine - 9 tests (60% of all microbiology tests) Specimen type: Blood culture MRSA screen - 3 tests (20% of all microbiology tests) Specimen type: MRSA screen Urine culture - 1 test (6.7% of all microbiology tests) Specimen type: Urine Respiratory culture - 1 test (6.7% of all microbiology tests) Specimen type: Sputum","blood culture, routine; gram stain; respiratory culture; urine culture","SELECT T3.test_name FROM ( SELECT T2.test_name, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'hemodialysis' ) ) AS T1 JOIN ( SELECT admissions.subject_id, microbiologyevents.test_name, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND T1.hadm_id = T2.hadm_id GROUP BY T2.test_name ) AS T3 WHERE T3.C1 <= 4",0,"The provided answer differed from the gold reference primarily due to a mistake in data interpretation and query execution. While it correctly identified microbiology tests conducted during the same hospital stay as the hemodialysis procedure, it inaccurately reported the most frequent tests. Specifically, it included ""MRSA screen"" as a top test, which does not appear in the gold reference, and omitted ""gram stain,"" which is present in the gold list. This indicates a likely oversight in filtering or ranking the test frequencies. Additionally, the small sample size (only 3 admissions and 15 tests) may have skewed the frequency count, leading to results that are not representative of broader trends captured in the gold query. No ambiguity was present in the question or the reference query, as both clearly specified the context (same hospital visit) and the target (hemodialysis patients and their microbiology tests)." How many current patients are 30s?,https://claude.ai/share/0a5c36bb-d049-4b5b-a24c-b55438b58985,there are 0 current patients in their 30s.,0,SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 30 AND 39,1, Has patient 10005866 had any type of diagnosis in this year?,https://claude.ai/share/8d916ea9-f0c6-4a50-a0cf-272afab17362,"Yes, patient 10005866 has had multiple diagnoses in the year 2100. The patient had 8 different diagnoses recorded on June 17, 2100",1,"SELECT COUNT(*)>0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10005866 ) AND datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year')",1, Calculate the number of times that patient 10004235 had lr input on 12/24/last year.,https://claude.ai/share/0fcd1255-7394-4f48-a9d2-5d0e4574aa93,Answer: 0 Patient 10004235 had 0 LR (Lactated Ringer's) inputs on December 24th of last year (2099-12-24).,0,"SELECT COUNT(*) FROM inputevents WHERE inputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10004235 ) ) AND inputevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lr' AND d_items.linksto = 'inputevents' ) AND datetime(inputevents.starttime,'start of year') = datetime(current_time,'start of year','-1 year') AND strftime('%m-%d',inputevents.starttime) = '12-24'",1, How many medications were prescribed to patient 10022017 since 2100?,https://claude.ai/share/409dd682-5d40-438e-80f8-4e57ac8865bf,Patient 10022017 has been prescribed 57 medications since 2100.,57,"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10022017 ) AND strftime('%Y',prescriptions.starttime) >= '2100'",1, What diagnosis did patient 10003400 receive the last time since 2100?,https://claude.ai/share/4c87d250-adae-4395-a0f4-3fa844064d11,"Primary diagnoses for patient 10003400's most recent admission: Multiple myeloma, without mention of having achieved remission (ICD-9: 20300) Atrial fibrillation (ICD-9: 42731) Microscopic hematuria (ICD-9: 59972) Unspecified essential hypertension (ICD-9: 4019) Obesity, unspecified (ICD-9: 27800) Long-term (current) use of anticoagulants (ICD-9: v5861) Anticoagulants causing adverse effects in therapeutic use (ICD-9: e9342) Other nonspecific findings on examination of urine (ICD-9: 7919)",long-term (current) use of anticoagulants,"SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd_code IN ( SELECT diagnoses_icd.icd_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10003400 ) AND strftime('%Y',diagnoses_icd.charttime) >= '2100' ORDER BY diagnoses_icd.charttime DESC LIMIT 1 )",1, How much of a difference is there in patient 10006580's white blood cells second measured on the first hospital visit compared to the first value measured on the first hospital visit?,https://claude.ai/share/0a963358-7d2f-4b0e-b9a2-191d725e8fd7,"The difference between the second and first measurements is: 7.8 - 9.9 = -2.1 k/ul",-2.1,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10006580 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells' ) ORDER BY labevents.charttime ASC LIMIT 1 OFFSET 1 ) - ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10006580 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells' ) ORDER BY labevents.charttime ASC LIMIT 1 ),1, "What were the top three most frequent microbiology tests that patients were given after being diagnosed with acquired absence of organ, genital organs during the same hospital encounter since 2100?",https://claude.ai/share/fadb0ddd-68c8-4b21-883c-c1c07dacf92e,MRSA Screen - This was the sole microbiology test conducted for the single patient with this diagnosis.,mrsa screen,"SELECT T3.test_name FROM ( SELECT T2.test_name, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'acquired absence of organ, genital organs' ) AND strftime('%Y',diagnoses_icd.charttime) >= '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, microbiologyevents.test_name, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE strftime('%Y',microbiologyevents.charttime) >= '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND T1.hadm_id = T2.hadm_id GROUP BY T2.test_name ) AS T3 WHERE T3.C1 <= 3",1, How much did patient 10038999 weigh at their first measurement on the first hospital encounter?,https://claude.ai/share/007040f6-9230-41b7-82b7-82d97eca7662,"Based on my analysis of the MIMIC-IV database, patient 10038999's first weight measurement during their first hospital encounter was 98.8 kg.",98.8,SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038999 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'daily weight' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime ASC LIMIT 1,1, How many prescriptions were ordered for cyanocobalamin in 2100?,https://claude.ai/share/1d6966ad-404d-4898-8438-3ec7a8e8bf72,"Based on the MIMIC-IV database, there were 9 prescriptions ordered for cyanocobalamin in 2100.",9,"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'cyanocobalamin' AND strftime('%Y',prescriptions.starttime) = '2100'",1, How many prescriptions were ordered for acetylcysteine (iv) in 2100?,https://claude.ai/share/5a8d984f-8efe-4a64-9d53-d120d0b1a9e2,Answer: 4 prescriptions were ordered for acetylcysteine (IV) in 2100.,4,"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'acetylcysteine (iv)' AND strftime('%Y',prescriptions.starttime) = '2100'",1, What was the first diagnosis that patient 10021666 received this year?,https://claude.ai/share/44658cae-a15a-49bd-b0ea-e6d5d73cb39f,Diagnosis: Do not resuscitate status,do not resuscitate status,"SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd_code IN ( SELECT diagnoses_icd.icd_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021666 ) AND datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') ORDER BY diagnoses_icd.charttime ASC LIMIT 1 )",1, When did patient 10038081 get the first blood (ebv) microbiology test since 16 months ago?,https://claude.ai/share/322949ed-1a24-4276-986c-3f8a82806318,"patient 10038081 got their first blood EBV microbiology test on October 1, 2100 at 13:08:00",2100-10-01 13:08:00,"SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038081 ) AND microbiologyevents.spec_type_desc = 'blood (ebv)' AND datetime(microbiologyevents.charttime) >= datetime(current_time,'-16 month') ORDER BY microbiologyevents.charttime ASC LIMIT 1",1, When was the last time that patient 10003400 was discharged from the hospital?,https://claude.ai/share/e9c331ae-a93c-4a4f-b827-a92ae9d9dc77,patient 10003400 was last discharged from the hospital on 2100-06-15 at 15:05:00.,2100-06-15 15:05:00,"SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 10003400 AND datetime(admissions.admittime) >= datetime(current_time,'-1 year') ORDER BY admissions.dischtime DESC LIMIT 1",1, Please show me the top three most usual procedures for patients aged 20s since 2100.,https://claude.ai/share/bfc48de5-9822-4ec1-acc4-82017ab1b0a8,Top 3 Most Common Procedures Extracorporeal circulation auxiliary to open heart surgery (ICD-9: 3961) Performed 2 times This procedure involves using a heart-lung machine to support circulation during cardiac surgery Insertion of catheter into spinal canal for infusion of therapeutic or palliative substances (ICD-9: 0390) Performed 1 time This involves placing a catheter in the spinal canal for delivering medications directly to the spine Injection of anesthetic into spinal canal for analgesia (ICD-9: 0391) Performed 1 time This is a spinal anesthesia procedure for pain management,"central venous catheter placement with guidance; closed reduction of fracture with internal fixation, femur; extracorporeal circulation auxiliary to open heart surgery; incision with removal of foreign body or device from skin and subcutaneous tissue; injection of anesthetic into spinal canal for analgesia; insertion of catheter into spinal canal for infusion of therapeutic or palliative substances; insertion of intercostal catheter for drainage; open heart valvuloplasty of mitral valve without replacement; other repair of vessel; reopening of recent thoracotomy site; resection of vessel with replacement, thoracic vessels; thoracoscopic decortication of lung","SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.icd_code IN ( SELECT T1.icd_code FROM ( SELECT procedures_icd.icd_code, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM procedures_icd WHERE procedures_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29 ) AND strftime('%Y',procedures_icd.charttime) >= '2100' GROUP BY procedures_icd.icd_code ) AS T1 WHERE T1.C1 <= 3 )",1, What is the name of the medication that patient 10036156 received two or more times in their last hospital visit?,https://claude.ai/share/7519e796-6157-4f50-aaaa-517b5ff6ad1e,"Based on my analysis of the MIMIC-IV database, patient 10036156 received several medications two or more times during their last hospital visit (admission ID 28019404, from July 15-17, 2100). The medications are: bag - prescribed 4 times (most frequent) sodium chloride 0.9% - prescribed 3 times neutra-phos - prescribed 3 times trazodone - prescribed 2 times pantoprazole - prescribed 2 times",bag; neutra-phos; pantoprazole; sodium chloride 0.9%; trazodone,"SELECT T1.drug FROM ( SELECT prescriptions.drug, COUNT( prescriptions.starttime ) AS C1 FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10036156 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) GROUP BY prescriptions.drug ) AS T1 WHERE T1.C1 >= 2",1, How many patients in 2100 received central venous catheter placement with guidance after the reopening of recent thoracotomy site procedure within the same month?,https://claude.ai/share/dbc89510-05fe-4163-83cc-f2df7e8293fc,1,1,"SELECT COUNT( DISTINCT T1.subject_id ) FROM ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'reopening of recent thoracotomy site' ) AND strftime('%Y',procedures_icd.charttime) = '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'central venous catheter placement with guidance' ) AND strftime('%Y',procedures_icd.charttime) = '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T1.charttime,'start of month') = datetime(T2.charttime,'start of month')",1, Show me the top five most frequently prescribed medications since 2100.,https://claude.ai/share/da2708ed-344d-49ec-b792-167669a45e9d,"Insulin - 280 prescriptions Used for managing blood glucose levels in diabetic patients 0.9% Sodium Chloride - 271 prescriptions Normal saline solution, commonly used for IV hydration and medication dilution Sodium Chloride 0.9% Flush - 264 prescriptions Used to flush IV lines and maintain patency of vascular access devices 5% Dextrose - 217 prescriptions Glucose solution used for IV hydration and to provide calories Furosemide - 164 prescriptions A loop diuretic used to treat fluid retention and heart failure",0.9% sodium chloride; 5% dextrose; furosemide; insulin; sodium chloride 0.9% flush,"SELECT T1.drug FROM ( SELECT prescriptions.drug, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM prescriptions WHERE strftime('%Y',prescriptions.starttime) >= '2100' GROUP BY prescriptions.drug ) AS T1 WHERE T1.C1 <= 5",1, Calculate the number of patients who stayed in the med/surg this year.,https://claude.ai/share/9beaa5a6-b644-4f50-927b-770cc2d57d28,"Here's the breakdown by med/surg unit type: med/surg: 13 unique patients (30 total transfers) med/surg/trauma: 7 unique patients (13 total transfers) med/surg/gyn: 2 unique patients (4 total transfers)",13,"SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'med/surg' AND datetime(transfers.intime,'start of year') = datetime(current_time,'start of year','-0 year') )",1, Did patient 10002428 come to the er during the first hospital encounter?,https://claude.ai/share/40ce8ac9-c23b-4d59-96ad-5c5eb8697cb9,"Based on my analysis of the MIMIC-IV database, yes, patient 10002428 did come to the ER during their first (and only) hospital encounter.",1,SELECT COUNT(*)>0 FROM admissions WHERE admissions.subject_id = 10002428 AND admissions.admission_location = 'emergency room' AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1,1, How many lactated ringers prescriptions were given out since 2100?,https://claude.ai/share/5df07554-702f-4a1e-834e-b0699fce9ee1,"94 prescriptions for ""lactated ringers""",94,"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'lactated ringers' AND strftime('%Y',prescriptions.starttime) >= '2100'",1, What is the number of times patient 10019172 visited the hospital?,https://claude.ai/share/c70332a1-4ac5-43c1-8acc-6b6697f75a66,"Summary: Patient 10019172 had 2 hospital visits: First visit: October 12-15, 2100 (elective admission via physician referral, discharged home) Second visit: November 19-25, 2100 (elective admission via physician referral, discharged to home health care)",2,SELECT COUNT( DISTINCT admissions.hadm_id ) FROM admissions WHERE admissions.subject_id = 10019172,1, What's the diastolic blood pressure change of patient 10022281 last measured on the last ICU visit compared to the first value measured on the last ICU visit?,https://claude.ai/share/73295312-3d45-4532-a3d1-092578457026,"The patient's diastolic blood pressure decreased by 11.0 mmHg from the first measurement to the last measurement during their ICU stay, going from 52.0 mmHg to 41.0 mmHg.",-11,SELECT ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10022281 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime DESC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure diastolic' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime DESC LIMIT 1 ) - ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10022281 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime DESC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure diastolic' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime ASC LIMIT 1 ),1, How many patients were prescribed albuterol 0.083% neb soln within the same hospital visit after they were diagnosed with personal history of malignant neoplasm of prostate in 2100?,https://claude.ai/share/264c297f-50db-42da-883e-83f6be42a2b2,"Based on my analysis of the MIMIC-IV database, 1 patient was prescribed albuterol 0.083% neb soln within the same hospital visit after being diagnosed with personal history of malignant neoplasm of prostate in 2100.",1,"SELECT COUNT( DISTINCT T1.subject_id ) FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'personal history of malignant neoplasm of prostate' ) AND strftime('%Y',diagnoses_icd.charttime) = '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, prescriptions.starttime, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'albuterol 0.083% neb soln' AND strftime('%Y',prescriptions.starttime) = '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.starttime AND T1.hadm_id = T2.hadm_id",1, When was the last instance when patient 10021487's respiratory rate was greater than 17.0 on 12/17/2100?,https://claude.ai/share/12a4c4d6-3966-4dcb-aa2f-c2aa9170542e,"Based on my query of the MIMIC-IV database, the last instance when patient 10021487's respiratory rate was greater than 17.0 on December 17, 2100 was at 23:00:00 (11:00 PM) with a respiratory rate of 23.0 insp/min (inspirations per minute).",2100-12-17 23:00:00,"SELECT chartevents.charttime FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021487 ) ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate' AND d_items.linksto = 'chartevents' ) AND chartevents.valuenum > 17.0 AND strftime('%Y-%m-%d',chartevents.charttime) = '2100-12-17' ORDER BY chartevents.charttime DESC LIMIT 1",1, What's new in patient 10039831's medication list today compared to the list yesterday?,https://claude.ai/share/ff019beb-b507-43c6-bb0b-9ac602246a6f,"All 9 medications listed below are NEW additions to the patient's medication list today: Insulin - 0.0 unit, subcutaneous (started at 23:00) Glucagon - 1.0 mg, intramuscular (started at 23:00) 0.9% Sodium Chloride - 500.0 ml, intravenous (started at 23:00) Pantoprazole - 40.0 mg, intravenous (started at 21:00) Sodium Chloride 0.9% Flush - 3.0 ml, intravenous (started at 21:00) 5% Dextrose - 250.0 ml, intravenous (started at 21:00) Vial - 1.0 vial, intravenous (started at 21:00) Ampicillin-Sulbactam - 3.0 g, intravenous (started at 20:00) 0.9% Sodium Chloride (mini bag plus) - 100.0 ml, intravenous (started at 20:00)",0.9% sodium chloride; 0.9% sodium chloride (mini bag plus); 5% dextrose; ampicillin-sulbactam; glucagon; insulin; pantoprazole; sodium chloride 0.9% flush; vial,"SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10039831 ) AND datetime(prescriptions.starttime,'start of day') = datetime(current_time,'start of day','-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10039831 ) AND datetime(prescriptions.starttime,'start of day') = datetime(current_time,'start of day','-1 day')",1, How many people died after being diagnosed with posttraumatic stress disorder within 2 months throughout this year?,https://claude.ai/share/f20b9985-0c1a-4940-aea3-b74460456444,0 people died within 2 months of being diagnosed with PTSD throughout the year 2100.,0,"SELECT COUNT( DISTINCT T2.subject_id ) FROM ( SELECT T1.subject_id, T1.charttime FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'posttraumatic stress disorder' ) ) AS T1 GROUP BY T1.subject_id HAVING MIN(T1.charttime) = T1.charttime AND datetime(T1.charttime,'start of year') = datetime(current_time,'start of year','-0 year') ) AS T2 JOIN ( SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions join patients ON patients.subject_id = admissions.subject_id WHERE patients.dod IS NOT NULL AND datetime(patients.dod,'start of year') = datetime(current_time,'start of year','-0 year') ) as T3 ON T2.subject_id = T3.subject_id WHERE ( datetime(T3.dod) BETWEEN datetime(T2.charttime) AND datetime(T2.charttime,'+2 month') ) OR ( datetime(T2.charttime) BETWEEN datetime(T3.dod) AND datetime(T3.dod,'+2 month') )",1, Provide the ID list of patients who were diagnosed with methicillin susceptible pneumonia due to staphylococcus aureus since 2100.,https://claude.ai/share/708476bc-9204-487d-b366-00543e482c05,"Patient ID with methicillin-susceptible staphylococcus aureus pneumonia since 2100: Patient ID: 10021487",10021487,"SELECT DISTINCT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN ( SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'methicillin susceptible pneumonia due to staphylococcus aureus' ) AND strftime('%Y',diagnoses_icd.charttime) >= '2100' )",1, How many individuals are there who are current patients?,https://claude.ai/share/a96cc3ca-2202-42dd-9164-41d645267ea6,Currently Admitted Patients: There are 4 individuals who are currently admitted to the hospital (patients with admission records but no discharge time).,4,SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.dischtime is null,1, Is systolic blood pressure of patient 10027602 last measured on the last ICU visit greater than the first value measured on the last ICU visit?,https://claude.ai/share/cfed05ba-695c-4ebb-bfbc-c64b279b555d,"Yes, the last systolic blood pressure measurement (137.0 mmHg) is greater than the first measurement (127.0 mmHg).",1,SELECT ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10027602 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime DESC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure systolic' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime DESC LIMIT 1 ) > ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10027602 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime DESC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure systolic' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime ASC LIMIT 1 ),1, "Since 178 days ago, when was the mean blood pressure of patient 10005817, for the last time, observed at less than 76.0?",https://claude.ai/share/52e83ee3-7b3e-46f4-b6d4-2cc500b5d034,"The mean blood pressure of patient 10005817 was last observed at less than 76.0 mmHg on December 24, 2100 at 14:02:00, with a value of 64.0 mmHg.",2100-12-24 14:02:00,"SELECT chartevents.charttime FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10005817 ) ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure mean' AND d_items.linksto = 'chartevents' ) AND chartevents.valuenum < 76.0 AND datetime(chartevents.charttime) >= datetime(current_time,'-178 day') ORDER BY chartevents.charttime DESC LIMIT 1",1, "Has patient 10006580 had any implantation or replacement of carotid sinus stimulation device, total system procedure in 2100?",https://claude.ai/share/d0446f9d-df84-4250-9713-2070f619e5ee,"Yes, patient 10006580 had an ""implantation or replacement of carotid sinus stimulation device, total system"" procedure in 2100.",1,"SELECT COUNT(*)>0 FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'implantation or replacement of carotid sinus stimulation device, total system' ) AND procedures_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10006580 ) AND strftime('%Y',procedures_icd.charttime) = '2100'",1, "Give me the top four most frequent diagnoses that patients were diagnosed with in the same month after being diagnosed with body mass index 35.0-35.9, adult this year.",https://claude.ai/share/43cc38f8-f727-4705-b51e-7b2c2c0134bb,"Top 4 Most Frequent Subsequent Diagnoses: Unspecified essential hypertension (ICD9: 4019) Frequency: 2 occurrences Atrial fibrillation (ICD9: 42731) Frequency: 2 occurrences Long-term (current) use of anticoagulants (ICD9: V5861) Frequency: 2 occurrences Anxiety disorder, unspecified (ICD10: F419) Frequency: 1 occurrence","atrial fibrillation; autistic disorder, current or active state; long-term (current) use of anticoagulants; personal history of sudden cardiac arrest; postprocedural fever; unspecified essential hypertension","SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd_code IN ( SELECT T3.icd_code FROM ( SELECT T2.icd_code, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'body mass index 35.0-35.9, adult' ) AND datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') ) AS T1 JOIN ( SELECT admissions.subject_id, diagnoses_icd.icd_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T1.charttime,'start of month') = datetime(T2.charttime,'start of month') GROUP BY T2.icd_code ) AS T3 WHERE T3.C1 <= 4 )",1, Please list the yearly average volume of stool that was output by patient 10020740 since 03/26/2100.,https://claude.ai/share/ed2ffeb4-2637-4e61-bad2-32f454f76b0f,"Results: Year 2100: 400.0 ml total volume Number of measurements: 4 recorded instances Average per measurement: 100.0 ml",100,"SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10020740 ) ) AND outputevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'stool' AND d_items.linksto = 'outputevents' ) AND strftime('%Y-%m-%d',outputevents.charttime) >= '2100-03-26' GROUP BY strftime('%Y',outputevents.charttime)",1, Is the anion gap level of patient 10003400 measured at 2100-06-15 05:34:00 less than the level measured at 2100-06-14 06:15:00?,https://claude.ai/share/32887ef3-7d04-4fac-ac7b-bf2a872f1e10,"Yes, the anion gap level is lower on 2100-06-15 05:34:00 compared to 2100-06-14 06:15:00.",1,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10003400 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap' ) AND labevents.charttime = '2100-06-15 05:34:00' ) < ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10003400 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap' ) AND labevents.charttime = '2100-06-14 06:15:00' ),1, Show me the length of stay in days of patient 10004422's first ICU stay.,https://claude.ai/share/1470f0e1-d544-4df3-9362-843ee446ca97,"The length of stay for patient 10004422's first ICU stay is 6.36 days. Here are the details: Patient ID: 10004422 ICU Stay ID: 32155744 Hospital Admission ID: 21255400 ICU Unit: Cardiac Vascular Intensive Care Unit (CVICU) Admission Time: January 19, 2100 at 09:44:50 Discharge Time: January 25, 2100 at 18:18:46 Length of Stay: 6.36 days",6.357,"SELECT strftime('%J', icustays.outtime) - strftime('%J', icustays.intime) FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10004422 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime ASC LIMIT 1",1, "Among patients who were diagnosed with anemia, unspecified since 2100, what are the top three most commonly prescribed medications that followed during the same hospital visit for patients in their 60 or above?",https://claude.ai/share/53ed88ff-906b-4faf-9d35-141443efb7da,"Top 3 Most Commonly Prescribed Medications: Sodium Chloride (Saline) Solutions - 63 total prescriptions Prescribed to 100% of patients (7 out of 7) Various forms: IV fluids, flushes, mini bags This is commonly used for hydration and electrolyte balance Dextrose - 32 total prescriptions Prescribed to 71.4% of patients (5 out of 7) Typically 5% dextrose solution given intravenously Used for nutritional support and glucose maintenance Insulin - 27 total prescriptions Prescribed to 28.6% of patients (2 out of 7) Administered subcutaneously Used for diabetes management, which is common in elderly hospitalized patients",0.9% sodium chloride; 5% dextrose; insulin; sodium chloride 0.9% flush,"SELECT T3.drug FROM ( SELECT T2.drug, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'anemia, unspecified' ) AND strftime('%Y',diagnoses_icd.charttime) >= '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, prescriptions.drug, prescriptions.starttime, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE admissions.age >= 60 AND strftime('%Y',prescriptions.starttime) >= '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.starttime AND T1.hadm_id = T2.hadm_id GROUP BY T2.drug ) AS T3 WHERE T3.C1 <= 3",1, What was patient 10009628's insurance plan on their last hospital encounter?,https://claude.ai/share/fc3e13fd-ac9a-4882-a8a2-760626b3df85,"Based on the query results, patient 10009628's insurance plan on their last hospital encounter was Medicaid.",medicaid,SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 10009628 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1,1, How many patients were treated with endoscopic control of gastric or duodenal bleeding in this year?,https://claude.ai/share/caa119b9-7702-45b4-bb33-46e31e769a60,"Based on my analysis of the MIMIC-IV database, 1 patient was treated with endoscopic control of gastric or duodenal bleeding in the year 2100. The specific details are: Patient ID: 10019777 Hospital Admission ID: 27738145 Admission Date: March 3, 2100 Procedure Date: March 4, 2100 Discharge Date: March 20, 2100 Procedure Code: ICD-9 4443 (endoscopic control of gastric or duodenal bleeding) This patient had a hospital stay of about 17 days, with the endoscopic procedure performed one day after admission.",1,"SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'endoscopic control of gastric or duodenal bleeding' ) AND datetime(procedures_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') )",1, What was patient 10022281's first output time of foley on 06/23/2100?,https://claude.ai/share/1bd9c32e-15c0-43ed-bd0f-5eab2ea70bf1,"Based on the query results, patient 10022281's first foley output time on 06/23/2100 was at 06:23:00 (6:23 AM), with an output volume of 150.0 ml.",2100-06-23 06:23:00,"SELECT outputevents.charttime FROM outputevents WHERE outputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10022281 ) ) AND outputevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_items.linksto = 'outputevents' ) AND strftime('%Y-%m-%d',outputevents.charttime) = '2100-06-23' ORDER BY outputevents.charttime ASC LIMIT 1",1, How many people died after being diagnosed with long term (current) use of opiate analgesic during the same month during the last year?,https://claude.ai/share/fee4c73d-ee78-40d7-b8c5-55c8c9670dc7,0 people died after being diagnosed with long term (current) use of opiate analgesic during the same month during the last year.,0,"SELECT COUNT( DISTINCT T2.subject_id ) FROM ( SELECT T1.subject_id, T1.charttime FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'long term (current) use of opiate analgesic' ) ) AS T1 GROUP BY T1.subject_id HAVING MIN(T1.charttime) = T1.charttime AND datetime(T1.charttime,'start of year') = datetime(current_time,'start of year','-1 year') ) AS T2 JOIN ( SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions join patients ON patients.subject_id = admissions.subject_id WHERE patients.dod IS NOT NULL AND datetime(patients.dod,'start of year') = datetime(current_time,'start of year','-1 year') ) as T3 ON T2.subject_id = T3.subject_id WHERE datetime(T2.charttime,'start of month') = datetime(T3.dod,'start of month')",1, What was the first measurement of patient 10013049's height since 25 months ago?,https://claude.ai/share/193456d2-9734-4b47-a452-6b849acdc9c2,"The first measurement of patient 10013049's height since 25 months ago (from the reference time of 2100-12-31 23:59:00) was: 183.0 cm recorded on 2100-06-23 09:33:00 This measurement was taken approximately 6 months and 8 days before the reference time, and it represents the earliest height measurement for this patient within the specified 25-month window (since 2098-12-01 23:59:00).",183,"SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10013049 ) ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'height (cm)' AND d_items.linksto = 'chartevents' ) AND datetime(chartevents.charttime) >= datetime(current_time,'-25 month') ORDER BY chartevents.charttime ASC LIMIT 1",1, List the top three most frequent lab tests that patients were given in the same hospital visit after being diagnosed with dysphonia in 2100.,https://claude.ai/share/6d552a9d-a9d9-447b-8131-f015c4488f1b,"Top 3 Most Frequent Lab Tests for Dysphonia Patients in 2100: Glucose - 9 measurements Most frequently ordered test Tests performed from September 12 to September 19, 2100 Urea Nitrogen - 8 measurements Second most frequent test Tests performed from September 13 to September 19, 2100 Sodium - 8 measurements Third most frequent test (tied with several others) Tests performed from September 13 to September 19, 2100","anion gap; bicarbonate; calcium, total; chloride; cortisol; creatinine; glucose; hematocrit; hemoglobin; magnesium; mch; mchc; mcv; phosphate; platelet count; rdw; red blood cells; sodium; urea nitrogen; white blood cells","SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN ( SELECT T3.itemid FROM ( SELECT T2.itemid, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'dysphonia' ) AND strftime('%Y',diagnoses_icd.charttime) = '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, labevents.itemid, labevents.charttime, admissions.hadm_id FROM labevents JOIN admissions ON labevents.hadm_id = admissions.hadm_id WHERE strftime('%Y',labevents.charttime) = '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND T1.hadm_id = T2.hadm_id GROUP BY T2.itemid ) AS T3 WHERE T3.C1 <= 3 )",1, What was patient 10018081's first procedure time since 1 year ago?,https://claude.ai/share/e71242a8-2b97-492c-83e3-3d0e6f39f795,"Patient 10018081's first procedure time since 1 year ago (from the reference time of ""2100-12-31 23:59:00"") was 2100-12-28 00:00:00.",2100-12-28 00:00:00,"SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10018081 ) AND datetime(procedures_icd.charttime) >= datetime(current_time,'-1 year') ORDER BY procedures_icd.charttime ASC LIMIT 1",1, When did patient 10020786 receive the last magnesium test in their last hospital encounter?,https://claude.ai/share/0f919cd5-efea-4255-aff9-9d7550aa0518,"Based on my analysis of the MIMIC-IV database, I found that: Patient 10020786 received their last magnesium test on July 4, 2100 at 6:35 AM during their last hospital encounter.",2100-07-04 06:35:00,SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium' ) AND labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10020786 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) ORDER BY labevents.charttime DESC LIMIT 1,1, When was the last mrsa screen microbiology test given to patient 10015272 in the last hospital encounter?,https://claude.ai/share/bb852192-a814-4dca-b030-904b570295c7,"Based on my analysis of the MIMIC-IV database, I found that patient 10015272's last MRSA screen microbiology test was performed on June 21, 2100 at 22:35:00 during their most recent hospital encounter.",2100-06-21 22:35:00,SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10015272 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND microbiologyevents.spec_type_desc = 'mrsa screen' ORDER BY microbiologyevents.charttime DESC LIMIT 1,1, "Among patients in their 30s since 2100, what are the top three prescribed drugs?",https://claude.ai/share/254f341e-4771-4ea4-ab5b-a14e9e454a09,"Top 3 Prescribed Drugs for Patients in Their 30s (Since 2100) 0.9% Sodium Chloride - 19 prescriptions Normal saline solution, commonly used for IV hydration and medication dilution Bag - 9 prescriptions This likely refers to IV bags or medication delivery systems Metoprolol Tartrate - 7 prescriptions A beta-blocker medication used to treat high blood pressure and heart conditions",0.9% sodium chloride; bag; diazepam; famotidine; metoprolol tartrate,"SELECT T1.drug FROM ( SELECT prescriptions.drug, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39 ) AND strftime('%Y',prescriptions.starttime) >= '2100' GROUP BY prescriptions.drug ) AS T1 WHERE T1.C1 <= 3",1, What was the last time patient 10037975 got the stool microbiology test?,https://claude.ai/share/ac2bc2ac-ffa9-46f1-956d-f1244954e0f5,"Based on the results, the last time patient 10037975 got stool microbiology tests was on February 11, 2100 at 11:03:00.",2100-02-11 11:03:00,SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10037975 ) AND microbiologyevents.spec_type_desc = 'stool' ORDER BY microbiologyevents.charttime DESC LIMIT 1,1, Was the calculated total co2 level of patient 10038933 last measured on the first hospital visit less than the second to last measurement on the first hospital visit?,https://claude.ai/share/3df4017d-d3a1-4377-83a2-04a72b5c98a4,"No, the first measured calculated total CO2 level (26.0 meq/l) was not less than the second-to-last measurement (26.0 meq/l). Both values are equal at 26.0 meq/l",0,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038933 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2' ) ORDER BY labevents.charttime DESC LIMIT 1 ) < ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038933 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2' ) ORDER BY labevents.charttime DESC LIMIT 1 OFFSET 1 ),1, Tell me the number of times a open heart valvuloplasty of mitral valve without replacement took place in the previous year.,https://claude.ai/share/b053c07e-df4f-4b88-8de1-c53b2cc3d6d8,"Based on my analysis of the MIMIC-IV database, here are the findings: Number of open heart valvuloplasty procedures of mitral valve without replacement in the previous year (2099): 0",0,"SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'open heart valvuloplasty of mitral valve without replacement' ) AND datetime(procedures_icd.charttime,'start of year') = datetime(current_time,'start of year','-1 year')",1, What are the top five most frequent output events since 1 year ago?,https://claude.ai/share/f74ec30f-a48f-4570-89bd-c6942f108636,"Here are the top 5 most frequent output events from the past year (December 31, 2099 to December 31, 2100): Foley (itemid: 226559) - 3,866 events This refers to Foley catheter urine output, the most common output measurement Chest tube #1 (itemid: 226588) - 394 events Drainage from the first chest tube, used to remove fluid/air from pleural space Void (itemid: 226560) - 254 events Natural urination/voiding events Cerebral ventricular #1 (itemid: 226606) - 200 events Drainage from the first cerebral ventricular drain, used to monitor/manage intracranial pressure TF residual (itemid: 227510) - 173 events Tube feeding residual volume measurements, indicating gastric contents before feeding",cerebral ventricular #1; chest tube #1; foley; tf residual; void,"SELECT d_items.label FROM d_items WHERE d_items.itemid IN ( SELECT T1.itemid FROM ( SELECT outputevents.itemid, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM outputevents WHERE datetime(outputevents.charttime) >= datetime(current_time,'-1 year') GROUP BY outputevents.itemid ) AS T1 WHERE T1.C1 <= 5 )",1, "What was the last value of a lab test of calcium, urine in 12/this year for patient 10021487?",https://claude.ai/share/2ff11200-7165-4da2-b5f9-9d3cbf13f464,"The last value of the calcium urine lab test for patient 10021487 in December 2100 was 15.2 mg/dl, recorded on December 21, 2100 at 09:04:00.",15.2,"SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021487 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, urine' ) AND datetime(labevents.charttime,'start of year') = datetime(current_time,'start of year','-0 year') AND strftime('%m',labevents.charttime) = '12' ORDER BY labevents.charttime DESC LIMIT 1",1, Calculate the patients who received a serology/blood microbiology test since 2100.,https://claude.ai/share/440d30d1-d1b2-4b04-8c46-e5dac926f5e1,"Based on my analysis of the MIMIC-IV database, 41 unique patients received serology/blood microbiology tests since January 1, 2100.",8,"SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'serology/blood' AND strftime('%Y',microbiologyevents.charttime) >= '2100' )",0,"The provided answer significantly overcounted the number of patients by including a broader range of test types and sources than specified. While the gold query strictly filtered for entries in the microbiologyevents table where spec_type_desc = 'serology/blood', the provided answer expanded the scope to include various serological and antibody-related tests from both microbiologyevents and labevents, regardless of their exact match to the 'serology/blood' specification. This inclusion of loosely related tests like immunoglobulin levels and general microbiology entries (e.g., blood cultures) led to an inflated count of 41 patients compared to the gold answer of 8. The primary issue was a mistake, as the answer misinterpreted the constraint implied by spec_type_desc = 'serology/blood' and included data outside of that strict criterion." "Compared to yesterday, what is new in the prescription of patient 10039831 today?",https://claude.ai/share/e58f35ad-b994-4569-901c-0fdaf6dad6f3,"Starting at 20:00: Ampicillin-sulbactam 3.0g IV (antibiotic) 0.9% sodium chloride (mini bag plus) 100ml IV (IV fluid) Starting at 21:00: Vial 1.0 vial IV Pantoprazole 40.0mg IV (proton pump inhibitor) Sodium chloride 0.9% flush 3.0ml IV (IV flush) 5% dextrose 250.0ml IV (IV fluid/glucose) Starting at 23:00: Insulin 0.0 unit SC (subcutaneous) Glucagon 1.0mg IM (intramuscular) 0.9% sodium chloride 500.0ml IV (IV fluid)",0.9% sodium chloride; 0.9% sodium chloride (mini bag plus); 5% dextrose; ampicillin-sulbactam; glucagon; insulin; pantoprazole; sodium chloride 0.9% flush; vial,"SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10039831 ) AND datetime(prescriptions.starttime,'start of day') = datetime(current_time,'start of day','-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10039831 ) AND datetime(prescriptions.starttime,'start of day') = datetime(current_time,'start of day','-1 day')",1, What was the organism found in patient 10027602's first mini-bal microbiology test?,https://claude.ai/share/75b1681e-3bc5-43b2-aa8f-a6d5887648e7,"Based on the query results, I can see that patient 10027602 had mini-BAL microbiology tests performed on 2100-12-02 at 14:50:00. The first mini-BAL test chronologically was the gram stain, which showed no organism (None). However, the respiratory culture from the same mini-BAL sample at the same time showed Staph aureus coag + (Staphylococcus aureus, coagulase positive). So the organism found in patient 10027602's first mini-BAL microbiology test was Staphylococcus aureus (coagulase positive)",staph aureus coag +,SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10027602 ) AND microbiologyevents.spec_type_desc = 'mini-bal' AND microbiologyevents.org_name IS NOT NULL ORDER BY microbiologyevents.charttime ASC LIMIT 1,1, What were the four most frequently performed lab tests since 1 year ago?,https://claude.ai/share/cf386305-080a-4a57-a8fa-996e990dc1a0,"Based on the MIMIC-IV database analysis, the four most frequently performed lab tests in the past year (from December 31, 2099 to December 31, 2100) are: Chloride - 1,004 tests performed Sodium - 1,001 tests performed Hematocrit - 982 tests performed Creatinine - 959 tests performed",chloride; creatinine; hematocrit; sodium,"SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN ( SELECT T1.itemid FROM ( SELECT labevents.itemid, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM labevents WHERE datetime(labevents.charttime) >= datetime(current_time,'-1 year') GROUP BY labevents.itemid ) AS T1 WHERE T1.C1 <= 4 )",1, What are the three commonly ordered medications for patients aged 60 or above?,https://claude.ai/share/aa1df233-d841-417e-ac1c-0edce552e94d,"Based on the MIMIC-IV database analysis, the three most commonly ordered medications for patients aged 60 or above are: Sodium chloride 0.9% flush - 124 prescriptions 0.9% sodium chloride - 122 prescriptions Insulin - 111 prescriptions",0.9% sodium chloride; insulin; sodium chloride 0.9% flush,"SELECT T1.drug FROM ( SELECT prescriptions.drug, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM prescriptions WHERE prescriptions.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60 ) GROUP BY prescriptions.drug ) AS T1 WHERE T1.C1 <= 3",1, What's the total amount of d5 1/2ns that patient 10038933 received on 09/26/this year?,https://claude.ai/share/661164dc-7d7a-4e5f-8db9-ae93720fac69,"Here are the details: 2 separate administrations of D5 1/2NS (item ID 225823) First administration: 1,000 mL at 11:12 AM Second administration: 1,000 mL at 9:03 PM Total amount: 2,000 mL",2000,"SELECT SUM(inputevents.totalamount) FROM inputevents WHERE inputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10038933 ) ) AND inputevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd5 1/2ns' AND d_items.linksto = 'inputevents' ) AND datetime(inputevents.starttime,'start of year') = datetime(current_time,'start of year','-0 year') AND strftime('%m-%d',inputevents.starttime) = '09-26'",1, "So, what was the maximum 25-oh vitamin d value of patient 10029484 since 11/2100?",https://claude.ai/share/5ff13227-10c0-4ae0-a5df-64078d50da49,"The patient had only one 25-OH vitamin D measurement recorded since November 1, 2100, which was 33.0 ng/ml. This value falls within the typical sufficient range for vitamin D (generally considered ≥30 ng/ml or ≥75 nmol/L)",33,"SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10029484 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '25-oh vitamin d' ) AND strftime('%Y-%m',labevents.charttime) >= '2100-11'",1, "How many people received a introduction of nutritional substance into upper gi, via natural or artificial opening procedure within the same month after they had been diagnosed with postprocedural pneumothorax since 2100?",https://claude.ai/share/c3a04c2c-0dfe-4bf3-affd-21a37af0c7e7,"Based on my analysis of the MIMIC-IV database, here are the findings: Answer: 1 patient",1,"SELECT COUNT( DISTINCT T1.subject_id ) FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'postprocedural pneumothorax' ) AND strftime('%Y',diagnoses_icd.charttime) >= '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'introduction of nutritional substance into upper gi, via natural or artificial opening' ) AND strftime('%Y',procedures_icd.charttime) >= '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T1.charttime,'start of month') = datetime(T2.charttime,'start of month')",1, How much of a difference is there in patient 10035185's mean blood pressure last measured on the first ICU visit compared to the second to last value measured on the first ICU visit?,https://claude.ai/share/fe0f7701-2b8f-4060-96cb-944e249440cb,"Results: First measurement: 73.0 mmHg at 2100-05-18 17:29:00 Second-to-last measurement: 81.0 mmHg at 2100-05-19 08:00:00 Difference: 81.0 - 73.0 = 8.0 mmHg",-9,SELECT ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10035185 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime ASC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure mean' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime DESC LIMIT 1 ) - ( SELECT chartevents.valuenum FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10035185 ) AND icustays.outtime IS NOT NULL ORDER BY icustays.intime ASC LIMIT 1 ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial blood pressure mean' AND d_items.linksto = 'chartevents' ) ORDER BY chartevents.charttime DESC LIMIT 1 OFFSET 1 ),0,"The answer deviated from the gold reference by mistakenly comparing the first and second-to-last blood pressure values, rather than the last and second-to-last as explicitly requested in the question. As a result, it reported a positive difference of +8.0 mmHg instead of the correct value of -9 mmHg derived from subtracting the second-to-last from the last measurement. This reflects a mistake in interpreting the temporal ordering required by the question—specifically, misidentifying which values to compare. The question was clear in asking for the difference between the last and the second-to-last measurement, so ambiguity was not the primary issue." "How many patients underwent single internal mammary-coronary artery bypass during the same month after the diagnosis with arthropathy, unspecified, lower leg, in 2100?",https://claude.ai/share/db372d84-9c67-4f43-9288-b206ea900e02,"Based on my analysis of the MIMIC-IV database, 1 patient underwent single internal mammary-coronary artery bypass during the same month after being diagnosed with arthropathy, unspecified, lower leg, in 2100.",1,"SELECT COUNT( DISTINCT T1.subject_id ) FROM ( SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'arthropathy, unspecified, lower leg' ) AND strftime('%Y',diagnoses_icd.charttime) = '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'single internal mammary-coronary artery bypass' ) AND strftime('%Y',procedures_icd.charttime) = '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T1.charttime,'start of month') = datetime(T2.charttime,'start of month')",1, How many patients in 2100 underwent radical excision of other lymph nodes within the same hospital visit after reopening of recent thoracotomy site?,https://claude.ai/share/65180416-146b-4d88-9031-f47914fcad6f,"Based on my analysis of the MIMIC-IV database, I found that 1 patient in 2100 underwent radical excision of other lymph nodes within the same hospital visit after reopening of a recent thoracotomy site.",1,"SELECT COUNT( DISTINCT T1.subject_id ) FROM ( SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'reopening of recent thoracotomy site' ) AND strftime('%Y',procedures_icd.charttime) = '2100' ) AS T1 JOIN ( SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'radical excision of other lymph nodes' ) AND strftime('%Y',procedures_icd.charttime) = '2100' ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND T1.hadm_id = T2.hadm_id",1, Was the SaO2 of patient 10021487 ever greater than 97.0 on 12/12/2100?,https://claude.ai/share/970e8cf3-d70a-496f-ada5-c65e0602b682,"Yes, the SaO2 of patient 10021487 was greater than 97.0 on 12/12/2100 on multiple occasions.",1,"SELECT COUNT(*)>0 FROM chartevents WHERE chartevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021487 ) ) AND chartevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'o2 saturation pulseoxymetry' AND d_items.linksto = 'chartevents' ) AND chartevents.valuenum > 97.0 AND strftime('%Y-%m-%d',chartevents.charttime) = '2100-12-12'",1, How many people received a prescription for dextromethorphan-guaifenesin (sugar free) throughout this year?,https://claude.ai/share/c658f6de-05cd-4eec-8c59-76ccbd549348,Answer: 1 person received a prescription for dextromethorphan-guaifenesin (sugar free) throughout the year.,1,"SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'dextromethorphan-guaifenesin (sugar free)' AND datetime(prescriptions.starttime,'start of year') = datetime(current_time,'start of year','-0 year') )",1, How many patients were treated with closed [percutaneous] [needle] biopsy of kidney since 2100?,https://claude.ai/share/c8cacf79-1271-4c2d-8a92-485dc2da647f,"Based on my analysis of the MIMIC-IV database, 1 patient was treated with closed percutaneous needle biopsy of kidney since 2100.",1,"SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'closed [percutaneous] [needle] biopsy of kidney' ) AND strftime('%Y',procedures_icd.charttime) >= '2100' )",1, "For patients who had bypass coronary artery, one artery from left internal mammary with autologous arterial tissue, open approach, what were the most frequent four microbiology tests carried out within 2 months?",https://claude.ai/share/5e188da3-225f-4ea1-ae2d-99c724c01ecb,"Clinical Context: The MRSA screen being the most common test aligns with standard cardiac surgery protocols, where screening for methicillin-resistant Staphylococcus aureus is routine to prevent surgical site infections, which are particularly serious complications in cardiac surgery patients.",mrsa screen,"SELECT T3.test_name FROM ( SELECT T2.test_name, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM ( SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'bypass coronary artery, one artery from left internal mammary with autologous arterial tissue, open approach' ) ) AS T1 JOIN ( SELECT admissions.subject_id, microbiologyevents.test_name, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id ) AS T2 ON T1.subject_id = T2.subject_id WHERE T1.charttime < T2.charttime AND datetime(T2.charttime) BETWEEN datetime(T1.charttime) AND datetime(T1.charttime,'+2 month') GROUP BY T2.test_name ) AS T3 WHERE T3.C1 <= 4",1, Pull up the IDs of patients who were diagnosed with chronic systolic heart failure in this year.,https://claude.ai/share/f6745b20-1a4a-4dcf-9462-09cd2cf3bf80,"Patient IDs: 10015272 - Diagnosed with chronic systolic (congestive) heart failure 10015931 - Diagnosed with acute on chronic systolic (congestive) heart failure 10021666 - Diagnosed with chronic systolic heart failure 10021938 - Diagnosed with chronic systolic heart failure 10023117 - Diagnosed with chronic systolic heart failure 10037861 - Diagnosed with acute on chronic systolic heart failure",10021666; 10021938; 10023117,"SELECT DISTINCT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN ( SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd_code = ( SELECT d_icd_diagnoses.icd_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.long_title = 'chronic systolic heart failure' ) AND datetime(diagnoses_icd.charttime,'start of year') = datetime(current_time,'start of year','-0 year') )",1, What was the name of the drug which was prescribed to patient 10018501 within the same hospital visit after having received alcohol detoxification in 08/2100?,https://claude.ai/share/50a621cd-ee44-44b6-95c3-994e52ace906,"""phenobarbital alcohol withdrawal dose taper (days 2-7)"" - prescribed on 2100-08-11 ""phenobarbital - icu alcohol withdrawal (initial load / rescue dose)"" - prescribed on 2100-08-12",docusate sodium (liquid); haloperidol; latanoprost 0.005% ophth. soln.; omeprazole; phenobarbital - icu alcohol withdrawal (initial load / rescue dose); phenobarbital alcohol withdrawal dose taper (days 2-7); phenobarbital alcohol withdrawal dose taper (days 2-7); phenobarbital alcohol withdrawal dose taper (days 2-7); phenobarbital alcohol withdrawal dose taper (days 2-7); sarna lotion,"SELECT T2.drug FROM ( SELECT procedures_icd.charttime, procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd_code = ( SELECT d_icd_procedures.icd_code FROM d_icd_procedures WHERE d_icd_procedures.long_title = 'alcohol detoxification' ) AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10018501 ) AND strftime('%Y-%m',procedures_icd.charttime) = '2100-08' ) AS T1 JOIN ( SELECT prescriptions.drug, prescriptions.starttime, prescriptions.hadm_id FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10018501 ) AND strftime('%Y-%m',prescriptions.starttime) = '2100-08' ) AS T2 ON T1.hadm_id = T2.hadm_id WHERE T1.charttime < T2.starttime",0,"The provided answer identified only one drug—phenobarbital—as prescribed to patient 10018501 after alcohol detoxification, whereas the gold answer includes a comprehensive list of all drugs prescribed following the detoxification event during the same hospital visit, including docusate sodium, haloperidol, latanoprost, omeprazole, sarna lotion, and multiple phenobarbital formulations. This discrepancy arose because the provided answer selectively focused on medications explicitly linked to alcohol withdrawal, thereby omitting other concurrently prescribed drugs that satisfy the temporal condition set in the question. The primary issue is a mistake, as the SQL and reasoning overlooked the full set of qualifying prescriptions that occurred after the detoxification procedure within the same admission, not just those with direct indications for alcohol withdrawal. The question did not specify to limit results to withdrawal-related drugs, so the broader set from the gold query is justified." How much is the total hospital cost of patient 10020187 during the stay in 2100?,https://claude.ai/share/4ca7508f-3bd9-4839-98ab-0f045f4a62a9,"The total hospital cost for patient 10020187 during their stay in 2100 is $2,371.19.",2371.19,"SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10020187 ) AND strftime('%Y',cost.chargetime) = '2100'",1, "On their first hospital visit, what was the age of patient 10022880?",https://claude.ai/share/d782f5d9-4c32-4fa7-839d-9c69ed87d74f,"Based on the MIMIC-IV database records, patient 10022880 was 66 years old on their first hospital visit. This first admission occurred on March 31, 2100 at 07:15:00, and the patient's age at that time was recorded as 66 years.",66,SELECT admissions.age FROM admissions WHERE admissions.subject_id = 10022880 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime ASC LIMIT 1,1, Is patient 10027602's free calcium second measured on the last hospital visit less than the value first measured on the last hospital visit?,https://claude.ai/share/bbbe5156-a1e3-46f9-868f-db6537e15092,"Answer: No, the second free calcium measurement (1.11 mmol/L) is NOT less than the first measurement (1.06 mmol/L). The second measurement is actually higher than the first measurement.",0,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10027602 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'free calcium' ) ORDER BY labevents.charttime ASC LIMIT 1 OFFSET 1 ) < ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10027602 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'free calcium' ) ORDER BY labevents.charttime ASC LIMIT 1 ),1, How many times was patient 10020786 admitted to the hospital since 2100?,https://claude.ai/share/1850bf17-f61f-49b6-b708-64cf86cc4462,Patient 10020786 was admitted to the hospital 1 time since 2100.,1,"SELECT COUNT( DISTINCT admissions.hadm_id ) FROM admissions WHERE admissions.subject_id = 10020786 AND strftime('%Y',admissions.admittime) >= '2100'",1, Provide me with the five most common diagnoses.,https://claude.ai/share/ba9e4bd9-1ffb-4a87-968f-bd3263c9f53b,"Based on the MIMIC-IV database analysis, here are the five most common diagnoses: Unspecified Essential Hypertension (42 cases) High blood pressure without a specific underlying cause Other and Unspecified Hyperlipidemia (29 cases) Elevated levels of lipids (fats) in the blood, including high cholesterol Diabetes Mellitus Type II, Not Stated as Uncontrolled (23 cases) Type 2 diabetes without mention of complications or poor control Tobacco Use Disorder (19 cases) Addiction or dependence on tobacco products Atrial Fibrillation (19 cases) Irregular heart rhythm affecting the heart's upper chambers","atrial fibrillation; coronary atherosclerosis of native coronary artery; diabetes mellitus without mention of complication, type ii or unspecified type, not stated as uncontrolled; other and unspecified hyperlipidemia; tobacco use disorder; unspecified essential hypertension","SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd_code IN ( SELECT T1.icd_code FROM ( SELECT diagnoses_icd.icd_code, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd_code ) AS T1 WHERE T1.C1 <= 5 )",1, What is the difference between mchc second measured on the last hospital visit compared to the first value measured on the last hospital visit for patient 10007928?,https://claude.ai/share/3b73a830-a7be-44c2-809c-30c850449841,"Perfect! Now I can calculate the difference between the second and first MCHC measurements during the last hospital visit: First MCHC value: 34.1% (measured on 2100-04-13 04:25:00) Second MCHC value: 34.2% (measured on 2100-04-13 12:06:00) Difference: 34.2% - 34.1% = 0.1%",0.1,SELECT ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10007928 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mchc' ) ORDER BY labevents.charttime ASC LIMIT 1 OFFSET 1 ) - ( SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10007928 AND admissions.dischtime IS NOT NULL ORDER BY admissions.admittime DESC LIMIT 1 ) AND labevents.itemid IN ( SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mchc' ) ORDER BY labevents.charttime ASC LIMIT 1 ),1, Calculate the number of patients who were prescribed senna.,https://claude.ai/share/1f3fbc25-6a6f-46d3-ab85-969e8f140423,"Based on my analysis of the MIMIC-IV database, 17 patients were prescribed senna",17,SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.hadm_id IN ( SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'senna' ),1, Has patient 10037928 received a diagnosis in 2100?,https://claude.ai/share/bb6c04dd-d1ca-44d2-a80b-b58e92f21351,"Yes, patient 10037928 did receive diagnoses in 2100. Specifically, the patient received 6 diagnoses on November 13, 2100 at 01:31:00, all associated with hospital admission ID 28543425.",1,"SELECT COUNT(*)>0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10037928 ) AND strftime('%Y',diagnoses_icd.charttime) = '2100'",1, What is the number of times patient 10014729 visited the hospital in 2100?,https://claude.ai/share/c73c7924-a5f1-4691-8aa9-4fa30a90dd5d,"Based on my analysis of the MIMIC-IV database, patient 10014729 visited the hospital 2 times in the year 2100.",2,"SELECT COUNT( DISTINCT admissions.hadm_id ) FROM admissions WHERE admissions.subject_id = 10014729 AND strftime('%Y',admissions.admittime) = '2100'",1, How many current patients are there aged 60 or above?,https://claude.ai/share/5b9bf833-ae26-4ff8-ad9f-24aa8ee1f7cd,"Based on my analysis of the MIMIC-IV database with the current time set to December 31, 2100, there are 44 current patients aged 60 or above.",1,SELECT COUNT( DISTINCT admissions.subject_id ) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age >= 60,0,"The primary issue was a mistake in interpreting the definition of “current patients.” The answer incorrectly counted patients who were alive (i.e., with no date of death) regardless of whether they were still admitted to the hospital. In contrast, the gold query correctly interpreted “current patients” as those who are still hospitalized (i.e., with dischtime IS NULL). This led to a significant overcount, as the condition for ongoing hospitalization was entirely missed. While the use of date of death is reasonable in general contexts, the question specifically asked for current patients, which the gold query operationalized more precisely by focusing on the discharge status within the admissions table." What was the name of the specimen test that patient 10021666 was given for the first time since 03/2100?,https://claude.ai/share/3fadd840-a63a-4e6b-9824-88b90fd094e6,"MRSA Screen - This was performed on March 31, 2100 at 04:00:00. The specimen type was ""mrsa screen"" and the test name was ""mrsa screen""",mrsa screen,"SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021666 ) AND strftime('%Y-%m',microbiologyevents.charttime) >= '2100-03' ORDER BY microbiologyevents.charttime ASC LIMIT 1",1, How many medications were ordered for patient 10021118 since 10/2100?,https://claude.ai/share/2962d8b0-bb67-4948-bf70-b99e542fab0f,"Answer: Patient 10021118 had 65 medications ordered since October 1, 2100.",65,"SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10021118 ) AND strftime('%Y-%m',prescriptions.starttime) >= '2100-10'",1, Can you show me the top four most frequent lab tests given?,https://claude.ai/share/834a4413-ad60-4935-89b6-3dac74b44618,"Based on the MIMIC-IV database analysis, here are the top 4 most frequent lab tests: Chloride - 1,004 tests Sodium - 1,001 tests Hematocrit - 982 tests Creatinine - 959 tests These results make clinical sense as they represent fundamental laboratory measurements: Chloride and Sodium are key electrolytes that are routinely monitored Hematocrit measures the percentage of blood volume occupied by red blood cells Creatinine is a crucial kidney function marker",chloride; creatinine; hematocrit; sodium,"SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN ( SELECT T1.itemid FROM ( SELECT labevents.itemid, DENSE_RANK() OVER ( ORDER BY COUNT(*) DESC ) AS C1 FROM labevents GROUP BY labevents.itemid ) AS T1 WHERE T1.C1 <= 4 )",1, What is the total or cell saver intake amount that patient 10009628 received on 10/02/this year?,https://claude.ai/share/b0f6ef87-1ac0-4f78-89a2-f70134bf0089,"Based on my query of the MIMIC-IV database, patient 10009628 received a total cell saver intake amount of 500.0 ml on October 2nd, 2100. The record shows: Patient ID: 10009628 Date/Time: 2100-10-02 13:40:00 Amount: 500.0 ml Item: OR cell saver intake",500,"SELECT SUM(inputevents.totalamount) FROM inputevents WHERE inputevents.stay_id IN ( SELECT icustays.stay_id FROM icustays WHERE icustays.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10009628 ) ) AND inputevents.itemid IN ( SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or cell saver intake' AND d_items.linksto = 'inputevents' ) AND datetime(inputevents.starttime,'start of year') = datetime(current_time,'start of year','-0 year') AND strftime('%m-%d',inputevents.starttime) = '10-02'",1, Has patient 10018423 received any lab testing in 2100?,https://claude.ai/share/7aef5fea-5f7a-421e-839c-8210295f60d1,"Yes, patient 10018423 received extensive lab testing in 2100.",1,"SELECT COUNT(*)>0 FROM labevents WHERE labevents.hadm_id IN ( SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10018423 ) AND strftime('%Y',labevents.charttime) = '2100'",1,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hannesill/m4'

If you have feedback or need assistance with the MCP directory API, please join our Discord server