<commit_before>-- retrieves the amount of billirubun of each adult patient found in the patients table 

with agetbl as
(
	select ad.subject_id, ad.hadm_id
       from mimiciii.admissions ad
       inner join mimiciii.patients p
       on ad.subject_id = p.subject_id 
       where
       -- filter to only adults
        ( 
		(extract(DAY from ad.admittime - p.dob) 
			+ extract(HOUR from ad.admittime - p.dob) /24
			+ extract(MINUTE from ad.admittime - p.dob) / 24 / 60
			) / 365.25 
	) > 15
)
select bucket, count(*) from (
  select width_bucket(valuenum, 0, 280, 280) as bucket
    from mimiciii.labevents le,
    inner join agetbl 
    on le.subject_id = agetbl.subject_id
   where itemid in (51006)
  ) as bun
  group by bucket order by bucket;<commit_msg>Update bun.sql<commit_after>-- retrieves the amount of billirubun of each adult patient found in the patients table 

with agetbl as
(
	select ad.subject_id, ad.hadm_id
       from mimiciii.admissions ad
       inner join mimiciii.patients p
       on ad.subject_id = p.subject_id 
       where
       -- filter to only adults
        ( 
		(extract(DAY from ad.admittime - p.dob) 
			+ extract(HOUR from ad.admittime - p.dob) /24
			+ extract(MINUTE from ad.admittime - p.dob) / 24 / 60
			) / 365.25 
	) > 15
)
select bucket, count(*) from (
  select width_bucket(valuenum, 0, 280, 280) as bucket
    from mimiciii.labevents le
    inner join agetbl 
    on le.subject_id = agetbl.subject_id
   where itemid in (51006)
  ) as bun
  group by bucket order by bucket;
{'fraction_non_alphanumeric': 0.08235294117647059, 'fraction_numerical': 0.032679738562091505, 'mean_word_length': 2.5522041763341066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6241738', 'n_tokens_mistral': 598, 'n_tokens_neox': 517, 'n_words': 170}