<commit_before>#####################################################################################
## Properties file containing queries to get user authorized data
#####################################################################################
rc_userrights_projects=select distinct a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.project_id in (select distinct m.project_id from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ?  and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table')) 
rc_userrights_forms=select distinct a.data_entry, a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.data_entry in (select distinct m.data_entry from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ? and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table' ))
rc_userrights_events=select distinct d.event_id from redcap_user_rights a, redcap_user_information c, redcap_events_metadata d where a.username = c.username and c.super_user = 1 and c.username like ? or d.event_id in (select distinct p.event_id from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o, redcap_events_metadata p, redcap_events_arms q where m.project_id = n.project_id and n.project_id = q.project_id and q.arm_id = p.arm_id and m.group_id = n.group_id and m.username like ?  and o.super_user = 0 and q.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table'))
//rc_userrights_data=select distinct data0_.project_id, data0_.field_name, data0_.event_id, data0_.record,case forms1_.element_enum when forms1_.element_enum like 'select' then reverse(substring_index( reverse(REPLACE(SUBSTRING(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value+1), LENGTH(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value)) + 1), '\\\\n', '')),',','1')) else data0_.value end as value from redcap_data data0_ inner join  redcap_metadata forms1_ on data0_.field_name=forms1_.field_name and data0_.project_id=forms1_.project_id where (forms1_.field_name, forms1_.project_id) in (select forms2_.field_name, forms2_.project_id from redcap_metadata forms2_ where forms2_.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table' ) and lower(forms2_.form_name) in (select a.form_name from redcap_metadata a where a.form_name in
rc_userrights_data=select distinct data0_.project_id, data0_.field_name, data0_.event_id, data0_.record, case forms1_.element_enum when forms1_.element_enum like 'select' then reverse(substring_index( reverse(REPLACE(SUBSTRING(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value+1), LENGTH(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value)) + 1), '\\\\n', '')),',','1'))  else data0_.value end as value, forms1_.element_label as label from redcap_data data0_ inner join  redcap_metadata forms1_ on data0_.field_name=forms1_.field_name and data0_.project_id=forms1_.project_id  where (forms1_.field_name, forms1_.project_id) in (select forms2_.field_name, forms2_.project_id  from redcap_metadata forms2_ where forms2_.project_id in (select distinct  a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.data_entry in (select distinct m.data_entry from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ? and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table' ))) and lower(forms2_.form_name) in (select a.form_name from redcap_metadata a  where a.form_name in  
 <commit_msg>fixed authorized data query for select and radio<commit_after>#####################################################################################
## Properties file containing queries to get user authorized data
#####################################################################################
rc_userrights_projects=select distinct a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.project_id in (select distinct m.project_id from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ?  and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table')) 
rc_userrights_forms=select distinct a.data_entry, a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.data_entry in (select distinct m.data_entry from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ? and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table' ))
rc_userrights_events=select distinct d.event_id from redcap_user_rights a, redcap_user_information c, redcap_events_metadata d where a.username = c.username and c.super_user = 1 and c.username like ? or d.event_id in (select distinct p.event_id from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o, redcap_events_metadata p, redcap_events_arms q where m.project_id = n.project_id and n.project_id = q.project_id and q.arm_id = p.arm_id and m.group_id = n.group_id and m.username like ?  and o.super_user = 0 and q.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table'))
rc_userrights_data=select distinct data0_.project_id, data0_.field_name, data0_.event_id, data0_.record, case forms1_.element_type when 'select' then reverse(substring_index( reverse(REPLACE(SUBSTRING(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value+1), LENGTH(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value)) + 1), '\\\\n', '')),',','1')) when 'radio' then reverse(substring_index( reverse(REPLACE(SUBSTRING(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value+1), LENGTH(SUBSTRING_INDEX(forms1_.element_enum, '\\\\n', data0_.value)) + 1), '\\\\n', '')),',','1')) else data0_.value end as value, forms1_.element_label as label from redcap_data data0_ inner join  redcap_metadata forms1_ on data0_.field_name=forms1_.field_name and data0_.project_id=forms1_.project_id  where (forms1_.field_name, forms1_.project_id) in (select forms2_.field_name, forms2_.project_id  from redcap_metadata forms2_ where forms2_.project_id in (select distinct  a.project_id from redcap_user_rights a, redcap_user_information c where a.username = c.username and c.super_user = 1 and c.username like ? or a.data_entry in (select distinct m.data_entry from redcap_user_rights m, redcap_data_access_groups n, redcap_user_information o where m.project_id = n.project_id and m.group_id = n.group_id  and m.username like ? and o.super_user = 0 and a.project_id in (select k.project_id from redcap_projects k where k.auth_meth like 'table' ))) and lower(forms2_.form_name) in (select a.form_name from redcap_metadata a  where a.form_name in  
 
{'fraction_non_alphanumeric': 0.12779511180447217, 'fraction_numerical': 0.013650546021840874, 'mean_word_length': 6.2099343955014055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6749144', 'n_tokens_mistral': 2473, 'n_tokens_neox': 2393, 'n_words': 699}