Chinastark/bird_dataset huggingface dataset:
Database: synthea
Question: In 2010, how many single patients took Nitrofurantoin 5 mg/ML [Furadantin] to cure cystitis?
Evidence: in 2010 refers to substr(medications.START, 1, 4) = '2010' AND substr(medications.stop, 1, 4) = '2010'; Nitrofurantoin 5 mg/ML [Furadantin] refers to medications.DESCRIPTION = 'Nitrofurantoin 5 MG/ML [Furadantin]'; cystitis refers to medications.REASONDESCRIPTION = 'Cystitis';
SQL: SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.marital = 'S' AND T2.REASONDESCRIPTION = 'Cystitis' AND T2.DESCRIPTION = 'Nitrofurantoin 5 MG/ML [Furadantin]' AND strftime('%Y', T2.START) = '2010'
Database: synthea
Question: Tell me the reason for Lavelle Vandervort's encounter on 11/20/2013?
Evidence: reason for encounter refers to encounters.REASONDESCRIPTION; on 11/20/2013 refers to encounters.DATE = '2013-11-20';
SQL: SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DATE = '2013-11-20' AND T1.first = 'Lavelle' AND T1.last = 'Vandervort'
Database: synthea
Question: From 1/9/2011 to 8/29/2012, how many German patients have their outpatient encounters?
Evidence: From 1/9/2011 to 8/29/2012 refers to encounters.DATE between '2011-09-01' and '2012-08-29'; German patients refers to ethnicity = 'german'; outpatient encounters refers to encounters.DESCRIPTION = 'Outpatient Encounter';
SQL: SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.ethnicity = 'german' AND T2.DATE BETWEEN '2011-01-09' AND '2012-08-29' AND T2.DESCRIPTION = 'Outpatient Encounter'
Database: synthea
Question: What is the social security number and address of the patient who encountered viral sinusitis symptoms on 6/13/2008?
Evidence: social security number refers to ssn; encountered viral sinusitis refers to encounters.REASONDESCRIPTION = 'Viral sinusitis (disorder)'; on 6/13/2008 refers to encounters.DATE = '2008-06-13';
SQL: SELECT T1.ssn, T1.address FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DATE = '2008-06-13' AND T2.REASONDESCRIPTION = 'Viral sinusitis (disorder)' AND T2.DESCRIPTION = 'Encounter for symptom'
Database: synthea
Question: Give me the reason, name of the drug, and duration of medication under encounter ID 23c293ec-dbae-4a22-896e-f12cf3c8bac3. Tell me if the patient is still alive.
Evidence: reason refers to medications.REASONDESCRIPTION; name of the drug refers to medications.DESCRIPTION; duration of medication = SUBTRACT(julianday(medications.STOP, julianday(medications.START))); ecounter ID refers to encounters.ID; encounters.ID = '23c293ec-dbae-4a22-896e-f12cf3c8bac3'; if patients.deathdate is null then the patient is alive; if patients.deathdate is not null then the patient is not alive;
SQL: SELECT T2.REASONDESCRIPTION, T2.DESCRIPTION , strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days , CASE WHEN T1.deathdate IS NULL THEN 'alive' ELSE 'dead' END FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.ENCOUNTER = '23c293ec-dbae-4a22-896e-f12cf3c8bac3'
Database: synthea
Question: How many patients with shellfish allergies died when they were under 12 years old? Please give their full names.
Evidence: shellfish allergies refers to allergies.DESCRIPTION = 'Shellfish allergy'; died under 12 years old = DIVIDE(SUBTRACT(julianday(patients.deathdate), julianday(patients.birthdate)), 365) < 12; full names = first, last;
SQL: SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Shellfish allergy' AND CAST((strftime('%J', T1.deathdate) - strftime('%J', T1.birthdate)) AS REAL) / 365 < 12
Database: synthea
Question: How long was Mr. Major D'Amore prescribed with Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin]?
Evidence: how long = SUBTRACT(julianday(medications.STOP, julianday(medications.START))); Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin] refers to medications.DESCRIPTION = 'Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin]';
SQL: SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = ' Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin]' AND T1.first = 'Major' AND T1.last = 'D''Amore'
Database: synthea
Question: How many types of medication have been prescribed to Mr. Major D'Amore since his visit to the hospital?
Evidence: types of medications refers to medications.DESCRIPTION;
SQL: SELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore'
Database: synthea
Question: List out all the observation information collected for the patient named Bella Rolfson.
Evidence: observation information refers to observations.DESCRIPTION AND observations.VALUE AND observations.UNITS;
SQL: SELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Bella' AND T1.last = 'Rolfson'
Database: synthea
Question: List out patient names with calcium deficiency.
Evidence: patient names = first, last; calcium deficiency refers to observations.DESCRIPTION = 'Calcium' and observations.VALUE < 8.6;
SQL: SELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Calcium' AND T2.VALUE < 8.6
Database: synthea
Question: List out 5 most common conditions for underweight patient.
Evidence: most common condition refers to MAX(COUNT(conditions.DESCRIPTION)); underweight patient refers to MIN(observations.VALUE WHERE observations.DESCRIPTION = 'Body Mass Index');
SQL: SELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Body Mass Index' GROUP BY T2.VALUE ORDER BY COUNT(T2.VALUE) LIMIT 5
Database: synthea
Question: How many mothers have taken immunization during prenatal visit?
Evidence: expecting mothers can be attributed to encounters.REASONDESCRIPTION = 'Normal pregnancy';
SQL: SELECT COUNT(DISTINCT T2.PATIENT) FROM encounters AS T1 INNER JOIN immunizations AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.REASONDESCRIPTION = 'Normal pregnancy' AND T1.DATE = T2.DATE
Database: synthea
Question: What care plans have been received by Mrs. Elly Koss during year 1970?
Evidence: during year 1970 refers to substr(careplans.START, 1, 4) = '1970' and substr(careplans.STOP, 1, 4) = '1970';
SQL: SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND strftime('%Y', T2.START) = '2013'
Database: synthea
Question: What is the care plan, procedure, medication and the patient's full name for encounter 6f2e3935-b203-493e-a9c0-f23e847b9798?
Evidence: car plan refers to careplans.DESCRIPTION; procedure refers to procedures.DESCRIPTION; medication refers to medications.DESCRIPTION; full name = first, last; encounter refers to encounters.ID; encounters.ID = '6f2e3935-b203-493e-a9c0-f23e847b9798';
SQL: SELECT DISTINCT T3.DESCRIPTION, T4.DESCRIPTION, T5.DESCRIPTION, T1.first, T1.last FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT INNER JOIN careplans AS T3 ON T1.patient = T3.PATIENT INNER JOIN procedures AS T4 ON T1.patient = T4.PATIENT INNER JOIN medications AS T5 ON T1.patient = T5.PATIENT WHERE T2.ID = '6f2e3935-b203-493e-a9c0-f23e847b9798'
Database: synthea
Question: How many male patients are diagnosed with hypertension as compared to female patients?
Evidence: male refers to gender = 'M'; diagnosed with hypertension refers to conditions.DESCRIPTION = 'Hypertension'; female refers to gender = 'F'; number of male patients with hypertension = count(patient WHERE gender = 'M' AND conditions.DESCRIPTION = 'Hypertension'); number of female patients with hypertension = count(patient WHERE gender = 'F' AND conditions.DESCRIPTION = 'Hypertension');
SQL: SELECT COUNT(DISTINCT CASE WHEN T2.gender = 'M' THEN T2.patient END) AS Male , COUNT(DISTINCT CASE WHEN T2.gender = 'F' THEN T2.patient END) AS Female FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Hypertension'
Database: synthea
Question: How many unmarried women were checked for normal pregnancy?
Evidence: unmarried refers to marital = 'S'; women refers to gender = 'F'; normal pregnancy refers to conditions.DESCRIPTION = 'normal pregnancy';
SQL: SELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Normal pregnancy' AND T2.gender = 'F' AND T2.marital = 'S'
Database: synthea
Question: List out the procedure and medicine prescribed for drug overdose patients.
Evidence: procedure refers to procedures.DESCRIPTION; medicine prescribed refers to medications.DESCRIPTION; drug overdose refers to encounters.REASONDESCRIPTION = 'Drug overdose';
SQL: SELECT DISTINCT T2.DESCRIPTION, T3.DESCRIPTION FROM encounters AS T1 INNER JOIN procedures AS T2 ON T1.PATIENT = T2.PATIENT INNER JOIN medications AS T3 ON T1.PATIENT = T3.PATIENT WHERE T1.REASONDESCRIPTION = 'Drug overdose'
Database: synthea
Question: What is the average body mass index for patients with higher total cholesterol?
Evidence: average body mass index = DIVIDE(SUM(observations.VALUE), COUNT(PATIENT) WHERE observations.DESCRIPTION = 'Body Mass Index'); body mass index refers to observations.DESCRIPTION = 'Body Mass Index'; higher total cholesterol refers to observations.DESCRIPTION = 'Total Cholesterol' and observations.VALUE > = 200;
SQL: SELECT SUM(T1.VALUE) / COUNT(T1.PATIENT) FROM observations AS T1 INNER JOIN ( SELECT DISTINCT PATIENT FROM observations WHERE DESCRIPTION = 'Total Cholesterol' AND VALUE > 200 ) AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.DESCRIPTION = 'Body Mass Index'
Database: synthea
Question: What is the difference between average glucose reading for patients in the 20s and 50s?
Evidence: sum(case when t2.DATE-t1.birthdate between 20 and 29 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 20 and 29 then t2.PATIENT else null end)-sum(case when t2.DATE-t1.birthdate between 50 and 59 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 50 and 59 then t2.PATIENT else null end)
SQL: SELECT SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.PATIENT END) - SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.PATIENT END) AS difference FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose'
Database: synthea
Question: What is the percentage of the most common conditions for patients age 60 and above?
Evidence: most common condition refers to MAX(COUNT(conditions.DESCRIPTION)); age 60 and above refers to SUBTRACT(conditions.START, birthdate) > 60; percentage = MULTIPLY(DIVIDE(SUM(patients.patient WHERE MAX(COUNT(conditions.DESCRIPTION)) AND SUBTRACT(conditions.START, birthdate) > 60))), COUNT(patients.patient WHERE MAX(COUNT(conditions.DESCRIPTION)), 10);
SQL: SELECT CAST(SUM(CASE WHEN T5.DESCRIPTION = T3.DESCRIPTION THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.patient) FROM ( SELECT T2.DESCRIPTION, T1.patient FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE ROUND((strftime('%J', T2.START) - strftime('%J', T1.birthdate)) / 365) > 60 GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1 ) AS T3 INNER JOIN patients AS T4 ON T3.patient = T4.patient INNER JOIN conditions AS T5 ON T4.patient = T5.PATIENT WHERE ROUND((strftime('%J', T5.START) - strftime('%J', T4.birthdate)) / 365) > 60
Database: synthea
Question: Name the reason Walter Bahringer visited medical professionals in July 2009.
Evidence: reason for visiting medical professionals refers to encounters.REASONDESCRIPTION;  in July 2009 refers to  substr(encounters.DATE, 1, 7) = '2009-07' ;
SQL: SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Walter' AND T1.last = 'Bahringer' AND T2.DATE LIKE '2009-07%'
Database: synthea
Question: How old was Mr. Stacy Morar at the time of his first emergency room admission due to a drug overdose?
Evidence: how old = SUBTRACT(MIN(encounters.DATE), patients.birthdate); his first emergency room admission refers to MIN(encounters.DATE); drug overdose refers to encounters.REASONDESCRIPTION = 'Drug overdose' ;
SQL: SELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Stacy' AND T1.last = 'Morar' AND T2.DESCRIPTION = 'Emergency Room Admission' AND T2.REASONDESCRIPTION = 'Drug overdose' ORDER BY T2.DATE LIMIT 1
Database: synthea
Question: What drug is administered more often to treat child attention deficit disorder?
Evidence: drug that was administered refers to medications.DESCRIPTION; child attention deficit disorder refers to medications.REASONDESCRIPTION = 'Child attention deficit disorder';
SQL: SELECT DESCRIPTION FROM medications WHERE REASONDESCRIPTION = 'Child attention deficit disorder' GROUP BY DESCRIPTION ORDER BY COUNT(DESCRIPTION) DESC LIMIT 1
Database: synthea
Question: Please include the full name of the patient who received a lung transplant.
Evidence: full name = first, last; lung transplant refers to procedures.DESCRIPTION = 'Transplant of lung (procedure)';
SQL: SELECT T2.first, T2.last FROM procedures AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Transplant of lung (procedure)'
Database: synthea
Question: How many patients on average receive combined chemotherapy and radiation therapy procedures each year?
Evidence: average = DIVIDE(COUNT(procedures.PATIENT), COUNT(substr(procedures.DATE, 1, 4))); combined chemotherapy and radiation therapy refers to procedures.DESCRIPTION = 'Combined chemotherapy and radiation therapy (procedure)';
SQL: SELECT CAST(COUNT(PATIENT) AS REAL) / COUNT(DISTINCT strftime('%Y', DATE)) FROM procedures WHERE DESCRIPTION = 'Combined chemotherapy and radiation therapy (procedure)'
Database: synthea
Question: Indicate the time frame and details of the most recent care plan suggested to Jacquelyn Shanahan.
Evidence: time frame = SUBTRACT(JULIANDAY(careplans.STOP), JULIANDAY(careplans.START)); details of care plan refers to careplans.DESCRIPTION; most recent care plan refers to MIN(careplans.STAR);
SQL: SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS timeFrame , T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' ORDER BY T2.START DESC LIMIT 1
Database: synthea
Question: Identify the allergy period for Isadora Moen and what triggered it.
Evidence: allergy period = SUBTRACT(allergies.START, allergies.STOP); what triggered the allergy refers to allergies.DESCRIPTION;
SQL: SELECT T2.START, T2.STOP, T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Isadora' AND T1.last = 'Moen'
Database: synthea
Question: How old was Mrs. Laronda Bernier at the time of her most recent medical encounter?
Evidence: how old = SUBTRACT(MIN(encounters.DATE), patients.birthdate); most recent medical encounter refers to MIN(encounters.DATE);
SQL: SELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Laronda' AND T1.last = 'Bernier' ORDER BY T2.DATE DESC LIMIT 1
Database: synthea
Question: What condition forced Mrs. Joye Homenick to seek medical attention in 2017?
Evidence: condition refers to conditions.DESCRIPTION; in 2017 refers to substr(conditions.START, 1, 4) = '2017';
SQL: SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Joye' AND T1.last = 'Homenick' AND strftime('%Y', T2.START) = '2017'
Database: synthea
Question: When did Mrs. Joye Homenick receive her most recent influenza seasonal vaccine?
Evidence: when a patient received her most recent vaccine refers to MAX(immunications.DATE); influenza seasonal vaccine refers to immunizations.DESCRIPTION = 'Influenza seasonal injectable preservative free';
SQL: SELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza  seasonal  injectable  preservative free' AND T1.first = 'Joye' AND T1.last = 'Homenick' ORDER BY T2.DATE DESC LIMIT 1
Database: synthea
Question: How long did Elly Koss have to take Acetaminophen 160 MG?
Evidence: how long = SUBTRACT(julianday(medications.stop), julianday(medications.START)); Acetaminophen 160 MG refers to medications.DESCRIPTION = 'Acetaminophen 160 MG';
SQL: SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND last = 'Koss' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'
Database: synthea
Question: How many patients sought medical attention due to a second-degree burn? Describe the care plan recommended to them.
Evidence: second-degree burn refers to encounters.REASONDESCRIPTION = 'Second degree burn'; ;
SQL: SELECT COUNT(DISTINCT T2.PATIENT), T2.DESCRIPTION FROM encounters AS T1 INNER JOIN careplans AS T2 ON T1.PATIENT = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Second degree burn'
Database: synthea
Question: Among all patients who sought medical attention in 2010 due to contact dermatitis, identify the percentage of females.
Evidence: in 2010 refers to substr(encounters.DATE, 1, 4) = '2010'; contact dermatitis refers to encounters.REASONDESCRIPTION = 'Contact dermatitis'; percentage = MULTIPLY(DIVIDE(COUNT(encounters.PATIENT WHERE gender = 'F'), count(encounters.PATIENT) WHERE encounters.REASONDESCRIPTION = 'Contact dermatitis'), 1.0) females refers to gender = 'F';
SQL: SELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM encounters AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.DATE) = '2010' AND T1.REASONDESCRIPTION = 'Contact dermatitis'
Database: synthea
Question: How many interactions did Lorri Simons have with medical professionals between 2010 and 2017? What percentage of encounters are attributed to prenatal visits?
Evidence: between 2010 and 2017 refers to substr(encounters.DATE, 1, 4) between '2010' and '2017'; percentage = MULTIPLY(DIVIDE(COUNT(encounters.ID WHERE DESCRIPTION = 'Prenatal visit'), count(encounters.ID)), 1.0); prenatal visits refers to encounters.DESCRIPTION = 'Prenatal visit';
SQL: SELECT COUNT(T1.patient) , CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Prenatal visit' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Lorri' AND T1.last = 'Simonis' AND strftime('%Y', T2.DATE) BETWEEN '2010' AND '2017'
Database: synthea
Question: State description of medication taken by Joe Homenick.
Evidence: description of medication refers to medications.DESCRIPTION;
SQL: SELECT T1.DESCRIPTION FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Joye' AND T2.last = 'Homenick'
Database: synthea
Question: What is the start date of the care plan of the patient whose maiden name is Adams?
Evidence: start date of the care plan refers to careplans.START;
SQL: SELECT DISTINCT T1.START FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.maiden = 'Adams'
Database: synthea
Question: Among the male patients, who has the earliest starting date of the care plan?
Evidence: male patients refers to gender = 'M'; earliest starting date of the care plan refers to MIN(careplans.START);
SQL: SELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'M' ORDER BY T1.START LIMIT 1
Database: synthea
Question: What is the percentage of Hispanic patients who stopped their care plan in 2011?
Evidence: Hispanic patients refers to ethnicity = 'hispanic'; percentage = MULTIPLY(DIVIDE(COUNT(careplans.PATIENT WHERE ethnicity = 'hispanic'), COUNT(careplans.PATIENT)), 1.0); stopped their care plan in 2011 refers to substr(careplans.stop, 1, 4) = '2011';
SQL: SELECT CAST(SUM(CASE WHEN T2.race = 'hispanic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.stop) = '2011'
Database: synthea
Question: State the description of the reason why Angelo Buckridge needs the care plan.
Evidence: description of the reason of the care plan refers to careplans.REASONDESCRIPTION;
SQL: SELECT DISTINCT T1.REASONDESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Angelo' AND T2.last = 'Buckridge'
Database: synthea
Question: Mention the description of the care plan of American patients.
Evidence: American refers to ethnicity = 'american';
SQL: SELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ethnicity = 'american'
Database: synthea
Question: What are the medical encounter ids of patients who were born in Pembroke MA US?
Evidence: medical encounter ids careplans.ID; born in Pembroke MA US refers to birthplace = 'Pembroke MA US';
SQL: SELECT DISTINCT T1.ENCOUNTER FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.birthplace = 'Pembroke MA US'
Database: synthea
Question: List out the start date of the care plan of alive patients.
Evidence: start of the care plan refers to careplans.START; alive patients refers to deathdate is null;
SQL: SELECT DISTINCT T1.START FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NULL
Database: synthea
Question: How many white patients have the reason code of 10509002?
Evidence: white refers to race = 'white'; reason code of 10509002 refers to careplans.REASONCODE = '10509002';
SQL: SELECT COUNT(DISTINCT T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.race = 'white' AND T1.REASONCODE = '10509002'
Database: synthea
Question: List out full name of patients who have "Diabetic diet" in the description of the care plan.
Evidence: full name = first, last; Diabetic diet refers to careplans.DESCRIPTION = 'Diabetic diet';
SQL: SELECT DISTINCT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Diabetic diet'
Database: synthea
Question: List out the stop date of the care plan of dead patients.
Evidence: stop date of the care plan refers to careplans.STOP; dead patients refers to deathdate is not null;
SQL: SELECT DISTINCT T1.STOP FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NOT NULL AND T1.STOP IS NOT NULL
Database: synthea
Question: How many Italian patients have the care plan code of 304510005?
Evidence: Italian patients refers to ethnicity = 'italian';
SQL: SELECT COUNT(DISTINCT T2.patient) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ethnicity = 'italian' AND T1.CODE = '304510005'
Database: synthea
Question: What is the percentage of female patients who started the care plan in 2010?
Evidence: female patients refers to gender = 'F'; started the care plan in 2010 refers to substr(careplans.START, 1, 4) = '2010'; percentage = MULTIPLY(DIVIDE(COUNT(patients.patient WHERE patients.gender = 'F'), COUNT(patients.patient) WHERE substr(careplans.START, 1, 4) = '2010'), 100);
SQL: SELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) AS percentage FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.START) = '2010'