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)
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()))
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('')
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
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()
def setup_class_hook(cls): cls.study = create_study_from_dir('remap')
def setup_class_hook(cls): cls.study = create_study_from_dir('valid_study') cls.invalid_study = create_study_from_dir('invalid_study')
def setup_class_hook(cls): cls.study = create_study_from_dir('incomplete')
def setUp(self): self.study = create_study_from_dir('incomplete')