<commit_before>#/usr/bin/env python
"""

generate_subject_map_input.py -  Tool to generate patient-to-research subject mapping files based on inputs from REDCap projects 

"""
# Version 0.1 2013-11-18
__authors__ = "<NAME>"
__copyright__ = "Copyright 2014, University of Florida"
__license__ = "BSD 3-Clause"
__version__ = "0.1"
__email__ = "<EMAIL>"
__status__ = "Development"
from lxml import etree
import logging
from lxml import etree
import httplib
from urllib import urlencode
import os
import sys

# This addresses the issues with relative paths
file_dir = os.path.dirname(os.path.realpath(__file__))
goal_dir = os.path.join(file_dir, "../")
proj_root = os.path.abspath(goal_dir)+'/'
sys.path.insert(0, proj_root+'bin/utils/')
from sftp_transactions import sftp_transactions

def main():
    # Configure logging
    configure_logging()
    
    setup_json = proj_root+'config/setup.json'
    global setup
    setup = read_config(setup_json)
    site_catalog_file = proj_root+setup['site_catalog']
    # Initialize Redcap Interface

    properties = init_redcap_interface(setup)
    transform_xsl = setup['transform_xsl']
    response = get_data_from_redcap(properties,setup['token'])
    xml_tree = etree.fromstring(response)
    xslt = etree.parse(transform_xsl)<commit_msg>Modify path of site catalog file<commit_after>#/usr/bin/env python
"""

generate_subject_map_input.py -  Tool to generate patient-to-research subject mapping files based on inputs from REDCap projects 

"""
# Version 0.1 2013-11-18
__authors__ = "<NAME>"
__copyright__ = "Copyright 2014, University of Florida"
__license__ = "BSD 3-Clause"
__version__ = "0.1"
__email__ = "<EMAIL>"
__status__ = "Development"
from lxml import etree
import logging
from lxml import etree
import httplib
from urllib import urlencode
import os
import sys

# This addresses the issues with relative paths
file_dir = os.path.dirname(os.path.realpath(__file__))
goal_dir = os.path.join(file_dir, "../")
proj_root = os.path.abspath(goal_dir)+'/'
sys.path.insert(0, proj_root+'bin/utils/')
from sftp_transactions import sftp_transactions

def main():
    # Configure logging
    configure_logging()
    
    setup_json = proj_root+'config/setup.json'
    global setup
    setup = read_config(setup_json)
    site_catalog_file = proj_root+setup['site_catalog_file']
    # Initialize Redcap Interface

    properties = init_redcap_interface(setup)
    transform_xsl = setup['transform_xsl']
    response = get_data_from_redcap(properties,setup['token'])
    xml_tree = etree.fromstring(response)
    xslt = etree.parse(transform_xsl)
{'fraction_non_alphanumeric': 0.10200927357032458, 'fraction_numerical': 0.013910355486862442, 'mean_word_length': 4.884090909090909, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3497071', 'n_tokens_mistral': 885, 'n_tokens_neox': 827, 'n_words': 206}