def vsp_score(self): fields = (repeat_fieldname("vsp_count_dots", 1, 4) + repeat_fieldname("vsp_identify_letter", 1, 4)) return (self.sum_fields(fields) + score_zero_for_absent(self.vsp_copy_infinity) + score_zero_for_absent(self.vsp_copy_cube) + score_zero_for_absent(self.vsp_draw_clock))
def isCompleteGeneral(self): return ( self.are_all_fields_complete( repeat_fieldname("g", 1, Icd10SpecPD.N_GENERAL)) and self.are_all_fields_complete( repeat_fieldname("g1_", 1, Icd10SpecPD.N_GENERAL_1)) )
def lang_score(self): fields = (repeat_fieldname("lang_write_sentences_point", 1, 2) + repeat_fieldname("lang_repeat_sentence", 1, 2) + repeat_fieldname("lang_name_picture", 1, 12) + repeat_fieldname("lang_identify_concept", 1, 4)) return (self.sum_fields(fields) + self.get_follow_command_score() + self.get_repeat_word_score() + score_zero_for_absent(self.lang_read_words_aloud))
def hasPD(self): if self.isPDExcluded(): return False if not self.isCompleteGeneral(): return None return ( self.all_true(repeat_fieldname("g", 1, Icd10SpecPD.N_GENERAL)) and self.count_booleans( repeat_fieldname("g1_", 1, Icd10SpecPD.N_GENERAL_1)) > 1 )
def is_complete(self): if not self.field_contents_valid(): return False if not self.are_all_fields_complete(repeat_fieldname("q", 1, 3)): return False if not self.are_all_fields_complete(repeat_fieldname( "q", 5, Phq15.NQUESTIONS)): return False if self.is_female(): return (self.q4 is not None) else: return True
def hasEUPD_B(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteEU(): return None return ( self.count_booleans( repeat_fieldname("eu", 1, Icd10SpecPD.N_EUPD_I)) >= 3 and self.count_booleans( repeat_fieldname("eu", Icd10SpecPD.N_EUPD_I + 1, Icd10SpecPD.N_EU)) >= 2 )
def isPDExcluded(self): return ( is_false(self.g1) or is_false(self.g2) or is_false(self.g3) or is_false(self.g4) or is_false(self.g5) or is_false(self.g6) or ( self.are_all_fields_complete( repeat_fieldname("g1_", 1, Icd10SpecPD.N_GENERAL_1)) and self.count_booleans( repeat_fieldname("g1_", 1, Icd10SpecPD.N_GENERAL_1)) <= 1 ) )
def hasAnankasticPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteAnankastic(): return None return (self.count_booleans( repeat_fieldname("anankastic", 1, Icd10SpecPD.N_ANANKASTIC)) >= 4)
def hasAnxiousPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteAnxious(): return None return (self.count_booleans( repeat_fieldname("anxious", 1, Icd10SpecPD.N_ANXIOUS)) >= 4)
def hasDependentPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteDependent(): return None return (self.count_booleans( repeat_fieldname("dependent", 1, Icd10SpecPD.N_DEPENDENT)) >= 4)
def hasHistrionicPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteHistrionic(): return None return (self.count_booleans( repeat_fieldname("histrionic", 1, Icd10SpecPD.N_HISTRIONIC)) >= 4)
def hasParanoidPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteParanoid(): return None return (self.count_booleans( repeat_fieldname("paranoid", 1, Icd10SpecPD.N_PARANOID)) >= 4)
def hasDissocialPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteDissocial(): return None return (self.count_booleans( repeat_fieldname("dissocial", 1, Icd10SpecPD.N_DISSOCIAL)) >= 3)
def hasSchizoidPD(self): if not self.hasPD(): return self.hasPD() if not self.isCompleteSchizoid(): return None return (self.count_booleans( repeat_fieldname("schizoid", 1, Icd10SpecPD.N_SCHIZOID)) >= 4)
def is_complete(self): if not self.field_contents_valid(): return False if not self.are_all_fields_complete(repeat_fieldname("q", 1, 9)): return False if self.total_score() > 0 and self.q10 is None: return False return True
def meets_criteria(self): if not self.is_complete: return None return ( self.count_booleans(repeat_fieldname("a", 1, Icd10Schizotypal.N_A)) >= 4 and self.b )
def is_complete(self): return ( self.date_pertains_to is not None and self.are_all_fields_complete(repeat_fieldname( "a", 1, Icd10Schizotypal.N_A)) and self.b is not None and self.field_contents_valid() )
def is_complete(self): if not self.field_contents_valid(): return False if not self.are_all_fields_complete( repeat_fieldname("q", 1, Honos65.NQUESTIONS)): return False if self.q8 != 0 and self.q8 != 9 and self.q8problemtype is None: return False if self.q8 != 0 and self.q8 != 9 and self.q8problemtype == "J" \ and self.q8otherproblem is None: return False return (self.period_rated is not None)
def get_task_html(self): score = self.total_score() severity = self.severity() ANSWER_DICTS_DICT = {} for q in repeat_fieldname("q", 1, Ciwa.NSCOREDQUESTIONS): d = {None: None} for option in range(0, 8): if option > 4 and q == "q10": continue d[option] = WSTRING("ciwa_" + q + "_option" + str(option)) ANSWER_DICTS_DICT[q] = d h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 67") h += tr_qa(WSTRING("ciwa_severity") + " <sup>[1]</sup>", severity) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="35%">Question</th> <th width="65%">Answer</th> </tr> """ for q in range(1, Ciwa.NSCOREDQUESTIONS + 1): h += tr_qa( WSTRING("ciwa_q" + str(q) + "_s"), get_from_dict(ANSWER_DICTS_DICT["q" + str(q)], getattr(self, "q" + str(q))) ) h += subheading_spanning_two_columns(WSTRING("ciwa_vitals_title")) h += tr_qa(WSTRING("ciwa_t"), self.t) h += tr_qa(WSTRING("ciwa_hr"), self.hr) h += tr(WSTRING("ciwa_bp"), answer(self.sbp) + " / " + answer(self.dbp)) h += tr_qa(WSTRING("ciwa_rr"), self.rr) h += u""" </table> <div class="footnotes"> [1] Total score ≥15 severe, ≥8 moderate, otherwise mild/minimal. </div> """ return h
def isCompleteAnankastic(self): return self.are_all_fields_complete( repeat_fieldname("anankastic", 1, Icd10SpecPD.N_ANANKASTIC))
def total_score(self): return self.sum_fields(repeat_fieldname("q", 1, 9))
def isCompleteSchizoid(self): return self.are_all_fields_complete( repeat_fieldname("schizoid", 1, Icd10SpecPD.N_SCHIZOID))
def isCompleteParanoid(self): return self.are_all_fields_complete( repeat_fieldname("paranoid", 1, Icd10SpecPD.N_PARANOID))
def isCompleteDissocial(self): return self.are_all_fields_complete( repeat_fieldname("dissocial", 1, Icd10SpecPD.N_DISSOCIAL))
def isCompleteEU(self): return self.are_all_fields_complete( repeat_fieldname("eu", 1, Icd10SpecPD.N_EU))
def isCompleteHistrionic(self): return self.are_all_fields_complete( repeat_fieldname("histrionic", 1, Icd10SpecPD.N_HISTRIONIC))
def is_complete(self): return ( self.are_all_fields_complete( repeat_fieldname("q", 1, Rand36.NQUESTIONS)) and self.field_contents_valid() )
def isCompleteDependent(self): return self.are_all_fields_complete( repeat_fieldname("dependent", 1, Icd10SpecPD.N_DEPENDENT))
def total_score(self): return self.sum_fields(repeat_fieldname("q", 1, PclCommon.NQUESTIONS))
def isCompleteAnxious(self): return self.are_all_fields_complete( repeat_fieldname("anxious", 1, Icd10SpecPD.N_ANXIOUS))