def test_parsed_exclusion_534(self): with mock.patch('clinical_trials.clinical_study.get_schema') as donk: donk.return_value = self.schema with mock.patch( "clinical_trials.clinical_study.get_study") as dink: dink.return_value = self.cache.get('NCT02536534') study = ClinicalStudy.from_nctid('NCT02536534') content = study.eligibility.criteria processed = process_eligibility(content) self.assertEqual(4, len(processed.get('exclusion')))
def test_parsed_exclusion_668(self): with mock.patch('clinical_trials.clinical_study.get_schema') as donk: donk.return_value = self.schema with mock.patch( "clinical_trials.clinical_study.get_study") as dink: dink.return_value = self.cache.get('NCT01565668') study = ClinicalStudy.from_nctid('NCT01565668') content = study.eligibility.criteria processed = process_eligibility(content) self.assertEqual(18, len(processed.get('exclusion'))) criterion = '- Subject has any medical, psychiatric, addictive or other kind of disorder which compromises ' \ 'the ability of the subject to give written informed consent and/or to comply with procedures' self.assertEqual(criterion, processed.get('exclusion')[-1])
def exclusion_criteria(self): if self._exclusion_criteria is None: processed = process_eligibility(self.criteria) self._exclusion_criteria = processed.get("exclusion", []) return self._exclusion_criteria