def test_sham_subject_creation(self):
     self.subject = patientalloc.BCISubject(self.properties,
                                            self.savingProperties,
                                            self.matching_subject_id)
     self.subject.create()
     self.__check_XML_Values__()
     self.__check_data_folder_creation__()
     self.__check_resources_creation__()
 def test_creation(self):
     self.subject = patientalloc.BCISubject(self.properties,
                                            self.savingProperties,
                                            self.matching_subject_id)
     self.assertEqual(self.subject.properties, self.properties)
     self.assertEqual(self.subject.savingProperties, self.savingProperties)
     self.assertEqual(self.subject.matching_subject_id,
                      self.matching_subject_id)
示例#3
0
 def createSubject(self, properties):
     properties['Group'] = self.database.getGroupFromNewEntry(properties)
     subject = None
     if self.settings.subjectCreationType == 'Simple':
         subject = patientalloc.Subject(properties)
     elif self.settings.subjectCreationType == 'BCI':
         matching_subject_id = self.getMatchingSubjectId()
         subject = patientalloc.BCISubject(properties,
                                           self.settings.savingProperties,
                                           matching_subject_id)
     return subject
示例#4
0
 def createSubject(self, properties):
     subject = None
     if self.settings.subjectCreationType == 'Simple':
         subject = patientalloc.Subject(properties)
     elif self.settings.subjectCreationType == 'BCI':
         matching_subject_id, properties[
             'Group'] = self.get_matching_subject_id(properties['Group'])
         subject = patientalloc.BCISubject(properties,
                                           self.settings.savingProperties,
                                           matching_subject_id)
     return subject
    def test_bci_subject_creation(self):
        self.properties = {
            "SubjectID": 'testSubject',
            "Age": '50',
            "Group": 'BCI'
        }
        self.subject = patientalloc.BCISubject(self.properties,
                                               self.savingProperties,
                                               self.matching_subject_id)

        self.subject.create()
        self.__check_XML_Values__()
        self.__check_data_folder_creation__()
        self.__check_resources_creation__()
    def createSubject(self, properties):
        properties['Group'] = self.database.getGroupFromNewEntry(properties)
        self.display_frane_algorithm_results(properties)
        properties['Group'] = self.confirm_new_entry_group_manually(
            properties['Group'])

        # user_confirm = input(" ________________________________________________________\n"
        #                      "| Do you wish to change this group placement?            |\n"
        #                      " ________________________________________________________\n"
        #                      " ________________________________________________________\n"
        #                      "| WARNING: Selecting 'Y' or 'y' will automatically       |\n"
        #                      "| place the new subject entry into the opposite group.   |\n"
        #                      "| (Press 'Y'/'y' for yes, otherwise press ENTER)         |\n"
        #                      " -------------------------------------------------------- \n"
        #                      "                          ")
        # if user_confirm in ['Y', 'y']:
        #     new_group = [i for i in self.database.groups if properties['Group'] not in i]
        #     properties['Group'] = new_group[0]
        #     print("New entry manually placed into '" + properties['Group'] + "' group.")
        new_entry_group = properties['Group']
        subject = None
        if self.settings.subjectCreationType == 'Simple':
            subject = patientalloc.Subject(properties)
        elif self.settings.subjectCreationType == 'BCI':
            # new_entry_group_orig = new_entry_group
            matching_subject_id, properties[
                'Group'] = self.get_matching_subject_id(new_entry_group)
            if new_entry_group != properties['Group']:
                print("New Entry placed in '" + properties['Group'] +
                      "' Group (based on limited matched BCI subjects)")
                self.app.infoBox(
                    "NEW GROUP PLACEMENT",
                    "New Entry placed in '" + properties['Group'] +
                    "' Group (based on limited matched BCI subjects)")
            subject = patientalloc.BCISubject(properties,
                                              self.settings.savingProperties,
                                              matching_subject_id)
        return subject