def testStringFromRegimenProps(self): """ From the regimen props of the case - get the string representation of the label choices """ qid = {'dot_n_one': '0', 'dot_n_four': '3', 'dot_n_two': '1', 'nonartregimen': '4', 'dot_n_three': '2'} #morning,noon,evening,bedtime tid = {'dot_a_one': '0', 'dot_a_four': '', 'dot_a_two': '1', 'artregimen': '3', 'dot_a_three': '3'} #morning, noon, bedtime bd = {'dot_n_one': '1', 'dot_n_four': '', 'dot_n_two': '2', 'nonartregimen': '2', 'dot_n_three': ''} #noon, evening qd_noon = {'dot_a_one': '1', 'dot_a_four': '', 'dot_a_two': '', 'artregimen': '1', 'dot_a_three': ''} #noon qd_evening = {'dot_n_one': '2', 'dot_n_four': '', 'dot_n_two': '', 'nonartregimen': '1', 'dot_n_three': ''} #evening qid_str = regimen_string_from_doc(DOT_NONART, qid) self.assertEquals(qid_str, 'morning,noon,evening,bedtime') tid_str = regimen_string_from_doc(DOT_ART, tid) self.assertEquals(tid_str, 'morning,noon,bedtime') bd_str = regimen_string_from_doc(DOT_NONART, bd) self.assertEquals(bd_str, 'noon,evening') qd_noon_str = regimen_string_from_doc(DOT_ART, qd_noon) self.assertEquals(qd_noon_str, 'noon') qd_evening_str = regimen_string_from_doc(DOT_NONART, qd_evening) self.assertEquals(qd_evening_str, 'evening')
def testStringFromRegimenProps(self): """ From the regimen props of the case - get the string representation of the label choices """ qid = {'dot_n_one': '0', 'dot_n_four': '3', 'dot_n_two': '1', 'nonartregimen': '4', 'dot_n_three': '2'} #morning,noon,evening,bedtime tid = {'dot_a_one': '0', 'dot_a_four': '', 'dot_a_two': '1', 'artregimen': '3', 'dot_a_three': '3'} #morning, noon, bedtime bd = {'dot_n_one': '1', 'dot_n_four': '', 'dot_n_two': '2', 'nonartregimen': '2', 'dot_n_three': ''} #noon, evening qd_noon = {'dot_a_one': '1', 'dot_a_four': '', 'dot_a_two': '', 'artregimen': '1', 'dot_a_three': ''} #noon qd_evening = {'dot_n_one': '2', 'dot_n_four': '', 'dot_n_two': '', 'nonartregimen': '1', 'dot_n_three': ''} #evening qid_str = regimen_string_from_doc(DOT_NONART, qid) self.assertEqual(qid_str, 'morning,noon,evening,bedtime') tid_str = regimen_string_from_doc(DOT_ART, tid) self.assertEqual(tid_str, 'morning,noon,bedtime') bd_str = regimen_string_from_doc(DOT_NONART, bd) self.assertEqual(bd_str, 'noon,evening') qd_noon_str = regimen_string_from_doc(DOT_ART, qd_noon) self.assertEqual(qd_noon_str, 'noon') qd_evening_str = regimen_string_from_doc(DOT_NONART, qd_evening) self.assertEqual(qd_evening_str, 'evening')
def art_regimen_label_string_display(self): regimen_string = regimen_string_from_doc(DOT_ART, self.to_json()) if regimen_string is None: return "No regimen" else: return "[%s] %s" % (REGIMEN_CHOICES[int( self.art_properties()[enums.CASE_ART_REGIMEN_PROP])], PACT_REGIMEN_CHOICES_FLAT_DICT[regimen_string])
def nonart_regimen_label_string_display(self): regimen_string = regimen_string_from_doc(DOT_NONART, self.to_json()) if regimen_string is None: return "No regimen" elif regimen_string.startswith('Error,'): return "[%s] %s" % (self.nonartregimen, regimen_string) else: return "[%s] %s" % (REGIMEN_CHOICES[int(self.nonart_properties()[enums.CASE_NONART_REGIMEN_PROP])], PACT_REGIMEN_CHOICES_FLAT_DICT[regimen_string])
def art_regimen_label_string_display(self): regimen_string = regimen_string_from_doc(DOT_ART, self.to_json()) if regimen_string is None: return "No regimen" else: return "[%s] %s" % ( REGIMEN_CHOICES[int(self.art_properties()[enums.CASE_ART_REGIMEN_PROP])], PACT_REGIMEN_CHOICES_FLAT_DICT[regimen_string], )
def nonart_regimen_label_string(self): """ representation of the labeled strings of the nonart regimen: morning,noon,evening, etc """ return regimen_string_from_doc(DOT_NONART, self.to_json())
def art_regimen_label_string(self): """ representation of the labeled strings of the art regimen" morning,noon,evening """ return regimen_string_from_doc(DOT_ART, self.to_json())
def nonart_regimen_label_string(self): """ representation of the labeled strings of the nonart regimen: morning, noon, evening, etc """ return regimen_string_from_doc(DOT_NONART, self.to_json())