def main(): global_init('curae_domo') p = Patients() p.name = "Karl" p.address = "Berlin" p.phone = "00000000" p.care_level = "high" p.caretaker = "Alex" p.save()
def test_unique_genes_of_wilms(self): possible_values = Patients().get_values_of_multiple_criteria( criteria=[{ 'cancer_type': 'Wilms tumor' }, { 'gene': '' }]) self.assertEqual(3, len(possible_values)) # ['CTNNB1', 'REST', 'PAX6']
def test_unique_significance_multiple_criteria(self): possible_values = Patients().get_values_of_multiple_criteria( criteria=[{ 'gene': 'CTNNB1' }, { 'significance': '' }]) self.assertEqual(2, len(possible_values)) # ['pathogenic',
def test_two_criteria_and(self): patients_two_criteria = Patients().get_by_multiple_criteria( criteria=[{ 'gender': 'male' }, { 'age': 30 }], syntax='AND') self.assertEqual(2, len(patients_two_criteria))
def test_three_criteria_and(self): patients_three_criteria = Patients().get_by_multiple_criteria( criteria=[{ 'gender': 'male' }, { 'age': 30 }, { 'variant_type': 'SNV' }], syntax='AND') self.assertEqual(1, len(patients_three_criteria))
def package_count(cls): return Patients.objects().count()
def popular_packages(cls, limit: int) -> List[Patients]: packages = Patients.objects()\ .order_by('name')\ .limit(limit) return list(packages)
def find_package_by_name(cls, name): package = Patients.objects(name=name).first() return package
def __init__(self): #also adding dummy data doctor = Doctor("Turnip Cow", "christine lu", "nina chen") patient1 = Patients("Nina Chen", "Male", "*****@*****.**", "SWAG") patient2 = Patients("Christine Lu", "Female", "*****@*****.**", "COOL") patient1.add_medication("Weed") patient1.add_task("Run 100km") patient2.add_medication("Cigs") patient2.add_task("Run 100km") patient1.add_appointment( Appointment("05/05/2020", "panadol", "just a mild fever")) doctor.add_patients(patient1) doctor.add_patients(patient2) self.users = [doctor]
def test_all_unique_significance(self): possible_values = Patients().get_values_of_criterion( criterion={'significance': ''}) self.assertEqual(5, len(possible_values)) # ['pathogenic',
def test_all_unique_genes(self): possible_values = Patients().get_values_of_criterion( criterion={'gene': ''}) self.assertEqual(8, len(possible_values)) # ['CTNNB1', 'REST', 'PAX6',
def test_patient_age_number(self): patient_30_years = Patients().get_by_criterion(criterion={'age': 30}) self.assertEqual(3, len(patient_30_years))
def test_patient_male_number(self): males = Patients().get_by_criterion(criterion={'gender': 'male'}) self.assertEqual(6, len(males))
def test_patient_female_number(self): females = Patients().get_by_criterion(criterion={'gender': 'female'}) self.assertEqual(4, len(females))
def test_patient_ids(self): patients = Patients().get_all_data() ids = [patient['id'] for patient in patients] self.assertEqual(list(range(10)), ids)
def test_number_of_patients(self): patients = Patients().get_all_data() self.assertEqual(len(patients), 10)