This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
136 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ | |
""" | ||
|
||
__author__ = "University of Florida CTS-IT Team" | ||
__version__ = "0.13.2" | ||
__version__ = "0.14.2" | ||
__email__ = "[email protected]" | ||
__status__ = "Development" | ||
|
||
|
@@ -309,6 +309,25 @@ def _run(config_file, configuration_directory, do_keep_gen_files, dry_run, | |
# load custom post-processing rules | ||
rules = load_rules(settings.rules, configuration_directory) | ||
|
||
errors = run_preproc(pre_filters, settings) | ||
map(logger.warning, errors) | ||
|
||
raw_txt_file = os.path.join(configuration_directory, 'raw.txt') | ||
escaped_file = os.path.join(configuration_directory, 'rawEscaped.txt') | ||
raw_xml_file = os.path.join(configuration_directory, 'raw.xml') | ||
|
||
# TODO: make this able to run against a local file if desired | ||
# replace certain characters with escape sequences | ||
if get_emr_data: | ||
GetEmrData.data_preprocessing(raw_txt_file, escaped_file) | ||
if get_emr_data: | ||
# run csv2xml.py to generate data in xml format | ||
GetEmrData.generate_xml(escaped_file, raw_xml_file) | ||
if get_emr_data: | ||
# delete rawEscaped.txt | ||
GetEmrData.cleanup(escaped_file) | ||
|
||
|
||
raw_xml_file = os.path.join(configuration_directory, settings.raw_xml_file) | ||
email_settings = get_email_settings(settings) | ||
db_path = database_path | ||
|
@@ -326,8 +345,6 @@ def _run(config_file, configuration_directory, do_keep_gen_files, dry_run, | |
if not resume: | ||
_delete_last_runs_data(data_folder) | ||
|
||
errors = run_preproc(pre_filters, settings) | ||
map(logger.warning, errors) | ||
# TODO: Add preproc errors to report | ||
|
||
alert_summary, person_form_event_tree_with_data, rule_errors, \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
|
||
setup( | ||
name='redi', | ||
version='0.14.1', | ||
version='0.14.2', | ||
author='https://www.ctsi.ufl.edu/research/study-development/informatics-consulting/', | ||
author_email='[email protected]', | ||
packages=find_packages(exclude=['test']), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python | ||
|
||
# Contributors: | ||
# Christopher P. Barnes <[email protected]> | ||
# Andrei Sura: github.com/indera | ||
# Mohan Das Katragadda <[email protected]> | ||
# Philip Chase <[email protected]> | ||
# Ruchi Vivek Desai <[email protected]> | ||
# Taeber Rapczak <[email protected]> | ||
# Nicholas Rejack <[email protected]> | ||
# Josh Hanna <[email protected]> | ||
# Copyright (c) 2014-2015, University of Florida | ||
# All rights reserved. | ||
# | ||
# Distributed under the BSD 3-Clause License | ||
# For full text of the BSD 3-Clause License see http://opensource.org/licenses/BSD-3-Clause | ||
|
||
import unittest | ||
import os | ||
import tempfile | ||
from redi import redi | ||
import shutil | ||
|
||
|
||
class TestGetDBPath(unittest.TestCase): | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def test_get_db_path(self): | ||
db_path = tempfile.mkdtemp() | ||
batch_info_database = "database.db" | ||
redi.get_db_path(batch_info_database, db_path) | ||
full_db_path = os.path.join(batch_info_database, db_path) | ||
assert os.path.exists(full_db_path) == 1 | ||
shutil.rmtree(full_db_path) | ||
|
||
def test_get_db_path_not_exists(self): | ||
# verify that db path is created if it doesn't exist | ||
db_path = "nonExistentPath" | ||
batch_info_database = "database.db" | ||
created_db_path = redi.get_db_path(batch_info_database, db_path) | ||
assert created_db_path == os.path.join(db_path, batch_info_database) | ||
shutil.rmtree(db_path) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters