def init_data_if_not_present(self): data = symptom_validity_table().get_dict() for key in data: data[key] = 0 if len(self.connection.hgetall('GLOBAL_SYMPTOM_COUNT')) == 0: self.connection.hmset('GLOBAL_SYMPTOM_COUNT', data) if len(self.connection.hgetall('GLOBAL_USERNAME_CHATID')) == 0: self.connection.hmset('GLOBAL_USERNAME_CHATID', {"" : ""})
def populate_diseases(self): diseases_dict = self.diseases_object.get_disease() for specific_disease_name in diseases_dict.keys(): new_table_obj = symptom_validity_table() specific_disease_dict = diseases_dict[specific_disease_name] for symptom in specific_disease_dict.keys(): #print symptom if symptom == 'name': print specific_disease_dict[symptom] + " : LOADED" else: self.set_table(symptom, specific_disease_dict[symptom], new_table_obj, specific_disease_name) self.bucket[specific_disease_name] = new_table_obj #print new_table_obj.get_dict() self.calculate_current_score(specific_disease_dict['name'])
def populate_diseases(self): diseases_dict=self.diseases_object.get_disease() for specific_disease_name in diseases_dict.keys(): new_table_obj = symptom_validity_table() specific_disease_dict = diseases_dict[specific_disease_name] for symptom in specific_disease_dict.keys(): #print symptom if symptom == 'name': print specific_disease_dict[symptom] + " : LOADED" else: self.set_table(symptom, specific_disease_dict[symptom], new_table_obj, specific_disease_name) self.bucket[specific_disease_name] = new_table_obj #print new_table_obj.get_dict() self.calculate_current_score(specific_disease_dict['name'])
def __init__(self): self.data = None self.symptom_validity_table = symptom_validity_table() self.top_tags = __import__('top_questions').data().keys() self._build_data()