Exemplo n.º 1
0
    def setup_class_hook(cls):
        cls.study = create_study_from_dir('valid_study')
        cls.tree_file = os.path.join(cls.temp_dir, 'treefile.json')
        cls.json_data = tmtk.arborist.create_concept_tree(cls.study)

        with open(cls.tree_file, 'w') as f:
            f.write(cls.json_data)
Exemplo n.º 2
0
 def test_changes_clinical(self):
     study = create_study_from_dir('valid_study')
     json_data = self.json_data.replace('"text": "Characteristics"',
                                        '"text": "Characteristic"')
     json_data = json_data.replace('"text": "SW48"',
                                   '"text": "SW48_MAPPED"')
     tmtk.arborist.update_study_from_json(study, json_data)
     self.assertEqual(9, len(study.Clinical.show_changes()))
Exemplo n.º 3
0
    def setup_class_hook(cls):
        cls.study = create_study_from_dir('valid_study')
        cls.tmp_batch_home = os.path.join(cls.temp_dir, 'batch_home')
        options.transmart_batch_home = cls.tmp_batch_home
        os.makedirs(cls.tmp_batch_home)

        cls.properties_file = os.path.join(cls.tmp_batch_home, 'batchdb.properties')
        cls.fake_jar = os.path.join(cls.tmp_batch_home, 'transmart-batch-fake.jar')
        with open(cls.properties_file, 'w') as writer:
            writer.write(properties_file)
        with open(cls.fake_jar, 'w') as writer:
            writer.write('')
Exemplo n.º 4
0
    def test_transmart_batch_mode_clinical_params(self):
        params_ = ('MODIFIERS_FILE', 'TRIAL_VISITS_FILE', 'ONTOLOGY_MAP_FILE')
        default = options.transmart_batch_mode

        try:
            options.transmart_batch_mode = True
            limited_study = create_study_from_dir('incomplete')
            for p in params_:
                self.assertTrue(hasattr(self.study.Clinical.params, p))
                self.assertFalse(hasattr(limited_study.Clinical.params, p))

            self.assertTrue(limited_study.Clinical.validate())
            limited_study = limited_study.write_to(self.temp_dir)

        finally:
            options.transmart_batch_mode = default
Exemplo n.º 5
0
 def setup_class_hook(cls):
     cls.study = create_study_from_dir('TEST_ONTOLOGY')
     cls.export = tmtk.toolbox.SkinnyExport(cls.study, cls.temp_dir)
     cls.export.build_observation_fact()
Exemplo n.º 6
0
 def setup_class_hook(cls):
     cls.study = create_study_from_dir('remap')
Exemplo n.º 7
0
 def setup_class_hook(cls):
     cls.study = create_study_from_dir('valid_study')
     cls.invalid_study = create_study_from_dir('invalid_study')
Exemplo n.º 8
0
 def setup_class_hook(cls):
     cls.study = create_study_from_dir('incomplete')
Exemplo n.º 9
0
 def setUp(self):
     self.study = create_study_from_dir('incomplete')