def get_task_html(self): score = self.total_score() exceeds_cutoff = score >= 8 Q1_DICT = {None: None} Q2_DICT = {None: None} Q3_TO_8_DICT = {None: None} Q9_TO_10_DICT = {None: None} for option in xrange(0, 5): Q1_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q1_option" + str(option)) Q2_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q2_option" + str(option)) Q3_TO_8_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q3to8_option" + str(option)) if option != 1 and option != 3: Q9_TO_10_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q9to10_option" + str(option)) h = u""" <div class="summary"> <table class="summary"> """ h += self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 40") h += tr_qa(WSTRING("audit_exceeds_standard_cutoff"), get_yes_no(exceeds_cutoff)) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """ h += tr_qa(WSTRING("audit_q1_s"), get_from_dict(Q1_DICT, self.q1)) h += tr_qa(WSTRING("audit_q2_s"), get_from_dict(Q2_DICT, self.q2)) for q in xrange(3, 8 + 1): h += tr_qa( WSTRING("audit_q" + str(q) + "_s"), get_from_dict(Q3_TO_8_DICT, getattr(self, "q" + str(q))) ) h += tr_qa(WSTRING("audit_q9_s"), get_from_dict(Q9_TO_10_DICT, self.q9)) h += tr_qa(WSTRING("audit_q10_s"), get_from_dict(Q9_TO_10_DICT, self.q10)) h += u""" </table> <div class="copyright"> AUDIT: Copyright © World Health Organization. Reproduced here under the permissions granted for NON-COMMERCIAL use only. You must obtain permission from the copyright holder for any other use. </div> """ return h
def get_task_html(self): score = self.total_score() Q1_DICT = {None: None} Q2_DICT = {None: None} Q3_DICT = {None: None} for option in xrange(0, 5): Q1_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q1_option" + str(option)) if option == 0: # special! Q2_DICT[option] = str(option) + u" – " + \ WSTRING("audit_c_q2_option0") else: Q2_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q2_option" + str(option)) Q3_DICT[option] = str(option) + u" – " + \ WSTRING("audit_q3to8_option" + str(option)) h = u""" <div class="summary"> <table class="summary"> """ h += self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 12") h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """ h += tr_qa(WSTRING("audit_c_q1_question"), get_from_dict(Q1_DICT, self.q1)) h += tr_qa(WSTRING("audit_c_q2_question"), get_from_dict(Q2_DICT, self.q2)) h += tr_qa(WSTRING("audit_c_q3_question"), get_from_dict(Q3_DICT, self.q3)) h += u""" </table> <div class="copyright"> AUDIT: Copyright © World Health Organization. Reproduced here under the permissions granted for NON-COMMERCIAL use only. You must obtain permission from the copyright holder for any other use. AUDIT-C: presumed to have the same restrictions. </div> """ return h
def get_question_rows(first, last): h = u"" for q in xrange(first, last + 1): f = getattr(self, "frequency" + str(q)) d = getattr(self, "distress" + str(q)) fa = (u"{}: {}".format(f, get_from_dict(FREQ_DICT, f)) if f is not None else None) da = (u"{}: {}".format(d, get_from_dict(DISTRESS_DICT, d)) if d is not None else None) h += tr( WSTRING("cbir_q" + str(q)), answer(fa), answer(da), ) return h
def get_task_html(self): score = self.total_score() ANSWER_DICT = {None: "?"} for option in range(0, 5): ANSWER_DICT[option] = str(option) + u" — " + WSTRING("lshs_a_option" + str(option)) h = u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 48</td></tr> </table> </div> <table class="taskdetail"> <tr> <th width="60%">Question</th> <th width="40%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score ) for q in range(1, LshsA.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("lshs_a_q" + str(q) + "_question"), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))) ) h += u""" </table> """ return h
def get_task_html(self): score = self.total_score() ANSWER_DICTS = [] for q in range(1, Sas.NQUESTIONS + 1): d = {None: "?"} for option in range(0, 5): d[option] = WSTRING("sas_q" + str(q) + "_option" + str(option)) ANSWER_DICTS.append(d) h = u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 40</td></tr> </table> </div> <table class="taskdetail"> <tr> <th width="30%">Question</th> <th width="70%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score ) for q in range(1, Sas.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("sas_q" + str(q) + "_s"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> """ return h
def get_task_html(self): score = self.total_score() ANSWER_DICTS_DICT = {} for q in Bars.TASK_FIELDS: d = {None: "?"} for option in range(0, 6): if option > 3 and q == "q4": continue d[option] = WSTRING("bars_" + q + "_option" + str(option)) ANSWER_DICTS_DICT[q] = d h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 14</td></tr> </table> </div> <table class="taskdetail"> <tr> <th width="35%">Question</th> <th width="65%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score ) for q in Bars.TASK_FIELDS: h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("bars_" + q + "_s"), get_from_dict(ANSWER_DICTS_DICT[q], getattr(self, q)) ) h += u""" </table> """ return h
def get_task_html(self): score = self.total_score() if score > 34: category = WSTRING("severe") elif score >= 20: category = WSTRING("moderate") elif score >= 7: category = WSTRING("mild") else: category = WSTRING("normal") ANSWER_DICTS = [] for q in range(1, Madrs.NQUESTIONS + 1): d = {None: "?"} for option in range(0, 7): if option == 1 or option == 3 or option == 5: d[option] = option else: d[option] = WSTRING("madrs_q" + str(q) + "_option" + str(option)) ANSWER_DICTS.append(d) h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 60</td></tr> <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></tr> </table> </div> <div class="explanation"> Ratings are from 0–6 (0 none, 6 extreme problem). </div> <table class="taskdetail"> <tr> <th width="30%">Question</th> <th width="70%">Answer</th> </tr> <tr><td>{}</td><td><b>{}</b></td></tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score, WSTRING("category"), category, WSTRING("madrs_q_period_rated"), self.period_rated ) for q in range(1, Madrs.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("madrs_q" + str(q) + "_s"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] Total score >34 severe, ≥20 moderate, ≥7 mild, <7 normal. (Hermann et al. 1998, PubMed ID 9506602.) </div> """ return h
def get_task_html(self): MAIN_DICT = { None: None, 0: u"0 — " + WSTRING("fast_q1to3_option0"), 1: u"1 — " + WSTRING("fast_q1to3_option1"), 2: u"2 — " + WSTRING("fast_q1to3_option2"), 3: u"3 — " + WSTRING("fast_q1to3_option3"), 4: u"4 — " + WSTRING("fast_q1to3_option4"), } Q4_DICT = { None: None, 0: u"0 — " + WSTRING("fast_q4_option0"), 2: u"2 — " + WSTRING("fast_q4_option2"), 4: u"4 — " + WSTRING("fast_q4_option4"), } h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(self.total_score()) + " / 16") h += tr_qa(WSTRING("fast_positive") + " <sup>[1]</sup>", get_yes_no(self.is_positive())) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="60%">Question</th> <th width="40%">Answer</th> </tr> """ h += tr_qa(WSTRING("fast_q1"), get_from_dict(MAIN_DICT, self.q1)) h += tr_qa(WSTRING("fast_q2"), get_from_dict(MAIN_DICT, self.q2)) h += tr_qa(WSTRING("fast_q3"), get_from_dict(MAIN_DICT, self.q3)) h += tr_qa(WSTRING("fast_q4"), get_from_dict(Q4_DICT, self.q4)) h += u""" </table> <div class="footnotes"> [1] Negative if Q1 = 0. Positive if Q1 ≥ 3. Otherwise positive if total score ≥ 3. </div> """ return h
def get_rating_text(self): ratingdict = { None: None, 0: WSTRING("service_satis_rating_a0"), 1: WSTRING("service_satis_rating_a1"), 2: WSTRING("service_satis_rating_a2"), 3: WSTRING("service_satis_rating_a3"), 4: WSTRING("service_satis_rating_a4"), } return get_from_dict(ratingdict, self.rating)
def get_task_html(self): Q8PROBLEMTYPE_DICT = { None: None, "A": WSTRING("honos65_q8problemtype_option_a"), "B": WSTRING("honos65_q8problemtype_option_b"), "C": WSTRING("honos65_q8problemtype_option_c"), "D": WSTRING("honos65_q8problemtype_option_d"), "E": WSTRING("honos65_q8problemtype_option_e"), "F": WSTRING("honos65_q8problemtype_option_f"), "G": WSTRING("honos65_q8problemtype_option_g"), "H": WSTRING("honos65_q8problemtype_option_h"), "I": WSTRING("honos65_q8problemtype_option_i"), "J": WSTRING("honos65_q8problemtype_option_j"), } h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(self.total_score()) + " / 48") h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer <sup>[1]</sup></th> </tr> """ h += tr_qa(WSTRING("honos_period_rated"), self.period_rated) for i in range(1, 8 + 1): h += tr_qa( self.get_q(i), self.get_answer(i, getattr(self, "q" + str(i))) ) h += tr_qa(WSTRING("honos65_q8problemtype_s"), get_from_dict(Q8PROBLEMTYPE_DICT, self.q8problemtype)) h += tr_qa(WSTRING("honos65_q8otherproblem_s"), self.q8otherproblem) for i in range(9, Honos.NQUESTIONS + 1): h += tr_qa( self.get_q(i), self.get_answer(i, getattr(self, "q" + str(i))) ) h += u""" </table> <div class="footnotes"> [1] 0 = no problem; 1 = minor problem requiring no action; 2 = mild problem but definitely present; 3 = moderately severe problem; 4 = severe to very severe problem; 9 = not known. </div> """ + Honos.COPYRIGHT_DIV return h
def get_rating_text(self): ratingdict = { None: None, 1: WSTRING("fft_a1"), 2: WSTRING("fft_a2"), 3: WSTRING("fft_a3"), 4: WSTRING("fft_a4"), 5: WSTRING("fft_a5"), 6: WSTRING("fft_a6"), } return get_from_dict(ratingdict, self.rating)
def get_task_html(self): ANSWER_DICT = {None: None} for option in xrange(0, 3 + 1): ANSWER_DICT[option] = ( str(option) + u" — " + WSTRING("copebrief_a" + str(option)) ) h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr_qa("Self-distraction (Q1, Q19)", self.self_distraction()) h += tr_qa("Active coping (Q2, Q7)", self.active_coping()) h += tr_qa("Denial (Q3, Q8)", self.denial()) h += tr_qa("Substance use (Q4, Q11)", self.substance_use()) h += tr_qa("Use of emotional support (Q5, Q15)", self.emotional_support()) h += tr_qa("Use of instrumental support (Q10, Q23)", self.instrumental_support()) h += tr_qa("Behavioural disengagement (Q6, Q16)", self.behavioural_disengagement()) h += tr_qa("Venting (Q9, Q21)", self.venting()) h += tr_qa("Positive reframing (Q12, Q17)", self.positive_reframing()) h += tr_qa("Planning (Q14, Q25)", self.planning()) h += tr_qa("Humour (Q18, Q28)", self.humour()) h += tr_qa("Acceptance (Q20, Q24)", self.acceptance()) h += tr_qa("Religion (Q22, Q27)", self.religion()) h += tr_qa("Self-blame (Q13, Q26)", self.self_blame()) h += u""" </table> </div> <div class="explanation"> Individual items are scored 0–3 (as in Carver 1997 PMID 16250744), not 1–4 (as in http://www.psy.miami.edu/faculty/ccarver/sclBrCOPE.html). Summaries, which are all based on two items, are therefore scored 0–6. </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """ for q in xrange(1, self.NQUESTIONS + 1): h += tr_qa( u"Q{}. {}".format(q, WSTRING("copebrief_q" + str(q))), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))) ) h += u""" </table> """ return h
def get_task_html(self): score = self.total_score() above_cutoff_1 = score >= 10 above_cutoff_2 = score >= 13 ANSWER_DICTS = [] for q in range(1, Epds.NQUESTIONS + 1): d = {None: "?"} for option in range(0, 4): d[option] = str(option) + u" — " + WSTRING("epds_q" + str(q) + "_option" + str(option)) ANSWER_DICTS.append(d) h = u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 30</td></tr> <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></td></tr> <tr><td>{} <sup>[2]</sup></td><td><b>{}</b></td></tr> </table> </div> <div class="explanation"> Ratings are over the last week. <b>{}</b> </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score, WSTRING("epds_above_cutoff_1"), get_yes_no(above_cutoff_1), WSTRING("epds_above_cutoff_2"), get_yes_no(above_cutoff_2), WSTRING("epds_always_look_at_suicide"), ) for q in range(1, Epds.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("epds_q" + str(q) + "_question"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))), ) h += u""" </table> <div class="footnotes"> [1] ≥10. [2] ≥13. (Cox et al. 1987, PubMed ID 3651732.) </div> """ return h
def get_task_html(self): score = self.total_score() severity = self.severity() ANSWER_DICT = {None: None} for option in range(0, 4): ANSWER_DICT[option] = ( str(option) + u" — " + WSTRING("gad7_a" + str(option)) ) h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 21") h += tr(WSTRING("gad7_anxiety_severity") + " <sup>[1]</sup>", severity) h += u""" </table> </div> <div class="explanation"> Ratings are over the last 2 weeks. </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """ for q in range(1, Gad7.NQUESTIONS + 1): h += tr_qa( WSTRING("gad7_q" + str(q)), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] ≥15 severe, ≥10 moderate, ≥5 mild. Score ≥10 identifies: generalized anxiety disorder with sensitivity 89%, specificity 82% (Spitzer et al. 2006, PubMed ID 16717171); panic disorder with sensitivity 74%, specificity 81% (Kroenke et al. 2010, PMID 20633738); social anxiety with sensitivity 72%, specificity 80% (Kroenke et al. 2010); post-traumatic stress disorder with sensitivity 66%, specificity 81% (Kroenke et al. 2010). The majority of evidence contributing to these figures comes from primary care screening studies. </div> """ return h
def get_task_html(self): score = self.total_score() nsevere = self.num_severe() somatoform_likely = nsevere >= 3 severity = self.severity() ANSWER_DICT = {None: None} for option in range(0, 3): ANSWER_DICT[option] = str(option) + u" – " + \ WSTRING("phq15_a" + str(option)) h = u""" <div class="summary"> <table class="summary"> """ h += self.get_is_complete_tr() h += tr(WSTRING("total_score") + " <sup>[1]</sup>", answer(score) + " / 30") h += tr_qa(WSTRING("phq15_n_severe_symptoms") + " <sup>[2]</sup>", nsevere) h += tr_qa(WSTRING("phq15_exceeds_somatoform_cutoff") + " <sup>[3]</sup>", get_yes_no(somatoform_likely)) h += tr_qa(WSTRING("phq15_symptom_severity") + " <sup>[4]</sup>", severity) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="70%">Question</th> <th width="30%">Answer</th> </tr> """ for q in range(1, Phq15.NQUESTIONS + 1): h += tr_qa( WSTRING("phq15_q" + str(q)), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] In males, maximum score is actually 28. [2] Questions with scores ≥2 are considered severe. [3] ≥3 severe symptoms. [4] Total score ≥15 severe, ≥10 moderate, ≥5 mild, otherwise none. </div> """ return h
def get_task_html(self): score = self.total_score() below_cutoff = score <= 12 ANSWER_DICTS = [] for q in range(1, Fab.NQUESTIONS + 1): d = {None: "?"} for option in range(0, 5): d[option] = ( str(option) + u" — " + WSTRING("fab_q" + str(q) + "_option" + str(option))) ANSWER_DICTS.append(d) h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 18</td></tr> <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></td></tr> </table> </div> <table class="taskdetail"> <tr> <th width="40%">Question</th> <th width="60%">Score</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score, WSTRING("fab_below_cutoff"), get_yes_no(below_cutoff), ) for q in range(1, Fab.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("fab_q" + str(q) + "_title"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] Cutoff is ≤12. In patients with early dementia (MMSE > 24), a cutoff score of FAB ≤12 (*) can differentiate frontotemporal dementia from Alzheimer's disease (sensitivity for FTD 77%, specificy 87%; Slachevksy et al. 2004, PubMed ID 15262742). (*) I think: the phrase is "a cutoff of 12", which is somewhat ambiguous! </div> """ return h
def get_task_html(self): score = self.total_score() n_csi_symptoms = self.get_num_csi_symptoms() csi_catatonia = n_csi_symptoms >= 2 ANSWER_DICTS_DICT = {} for q in Bfcrs.TASK_FIELDS: d = {None: "?"} for option in range(0, 5): if (option != 0 and option != 3) and q in ["q17", "q18", "q19", "q20", "q21"]: continue d[option] = WSTRING("bfcrs_" + q + "_option" + str(option)) ANSWER_DICTS_DICT[q] = d h = u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 69</td></tr> <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></td></tr> <tr><td>{} <sup>[2]</sup></td><td><b>{}</b></td></tr> </table> </div> <table class="taskdetail"> <tr> <th width="35%">Question</th> <th width="65%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score, WSTRING("csi_num_symptoms_present"), n_csi_symptoms, WSTRING("csi_catatonia_present"), get_yes_no(csi_catatonia) ) for q in range(1, Bfcrs.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( "Q" + str(q) + u" — " + WSTRING("bfcrs_q" + str(q) + "_title"), get_from_dict(ANSWER_DICTS_DICT["q" + str(q)], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] Symptoms 1–14, counted as present if score >0. [2] Number of CSI symptoms ≥2. </div> """ return h
def get_task_html(self): p = self.score_p() n = self.score_n() g = self.score_g() composite = self.composite() total = p + n + g ANSWERS = { None: None, 1: WSTRING("panss_option1"), 2: WSTRING("panss_option2"), 3: WSTRING("panss_option3"), 4: WSTRING("panss_option4"), 5: WSTRING("panss_option5"), 6: WSTRING("panss_option6"), 7: WSTRING("panss_option7"), } h = ( self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> """ ) h += self.get_is_complete_tr() h += tr_qa(u"{} (30–210)".format(WSTRING("total_score")), total) h += tr_qa(u"{} (7–49)".format(WSTRING("panss_p")), p) h += tr_qa(u"{} (7–49)".format(WSTRING("panss_n")), n) h += tr_qa(u"{} (16–112)".format(WSTRING("panss_g")), g) h += tr_qa(WSTRING("panss_composite"), composite) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="40%">Question</th> <th width="60%">Answer</th> </tr> """ for q in Panss.TASK_FIELDS: h += tr_qa(WSTRING("panss_" + q + "_s"), get_from_dict(ANSWERS, getattr(self, q))) h += ( u""" </table> """ + DATA_COLLECTION_ONLY_DIV ) return h
def get_task_html(self): MAIN_DICT = { None: None, 1: u"1 — " + WSTRING("wemwbs_a1"), 2: u"2 — " + WSTRING("wemwbs_a2"), 3: u"3 — " + WSTRING("wemwbs_a3"), 4: u"4 — " + WSTRING("wemwbs_a4"), 5: u"5 — " + WSTRING("wemwbs_a5") } h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr( WSTRING("total_score"), answer(self.total_score()) + u" (range {}–{})".format( Swemwbs.MINTOTALSCORE, Swemwbs.MAXTOTALSCORE ) ) h += u""" </table> </div> <div class="explanation"> Ratings are over the last 2 weeks. </div> <table class="taskdetail"> <tr> <th width="60%">Question</th> <th width="40%">Answer</th> </tr> """ for i in range(1, Swemwbs.N_QUESTIONS + 1): nstr = str(i) h += tr_qa(WSTRING("swemwbs_q" + nstr), get_from_dict(MAIN_DICT, getattr(self, "q" + nstr))) h += u""" </table> <div class="copyright"> SWEMWBS: from Stewart-Brown et al. (2009), <i>Health and Quality of Life Outcomes</i> 7:15, http://www.hqlo.com/content/7/1/15; © 2009 Stewart-Brown et al.; distributed under the terms of the Creative Commons Attribution License. </div> """ return h
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 get_task_html(self): score = self.total_score() above_cutoff = score >= 6 ANSWER_DICTS = [] for q in range(1, Asrm.NQUESTIONS + 1): d = {None: "?"} for option in range(0, 5): d[option] = ( str(option) + u" — " + WSTRING("asrm_q" + str(q) + "_option" + str(option))) ANSWER_DICTS.append(d) h = u""" <div class="summary"> <table class="summary"> {} <tr><td>{}</td><td><b>{}</b> / 20</td></tr> <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></td></tr> </table> </div> <div class="explanation"> Ratings are over the last week. </div> <table class="taskdetail"> <tr> <th width="30%">Question</th> <th width="70%">Answer</th> </tr> """.format( self.get_is_complete_tr(), WSTRING("total_score"), score, WSTRING("asrm_above_cutoff"), get_yes_no(above_cutoff), ) for q in range(1, Asrm.NQUESTIONS + 1): h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( WSTRING("asrm_q" + str(q) + "_s"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] Cutoff is ≥6. Scores of ≥6 identify mania/hypomania with sensitivity 85.5%, specificity 87.3% (Altman et al. 1997, PubMed ID 9359982). </div> """ return h
def get_task_html(self): OPTION_DICT = {None: None} for a in range(self.MIN_SCORE, self.MAX_SCORE + 1): OPTION_DICT[a] = WSTRING("zbi_a" + str(a)) h = u""" <div class="summary"> <table class="summary"> {complete_tr} <tr> <td>Total score (/ 48)</td> <td>{total}</td> </td> </table> </div> <table class="taskdetail"> {tr_responder} {tr_relationship} </table> <table class="taskdetail"> <tr> <th width="75%">Question</th> <th width="25%">Answer (0–4)</th> </tr> """.format( complete_tr=self.get_is_complete_tr(), total=answer(self.total_score()), tr_responder=tr_qa(u"Responder’s name", self.responder_name), tr_relationship=tr_qa(u"Responder’s relationship to patient", self.responder_relationship), ) for q in xrange(1, self.NQUESTIONS + 1): a = getattr(self, "q" + str(q)) fa = (u"{}: {}".format(a, get_from_dict(OPTION_DICT, a)) if a is not None else None) h += tr( WXSTRING( self.EXTRASTRING_TASKNAME, "q" + str(q), "[ZBI: Q{}]".format(q) ), answer(fa) ) h += u""" </table> """ + DATA_COLLECTION_UNLESS_UPGRADED_DIV return h
def get_task_html(self): MAIN_DICT = { None: None, 0: u"0 — " + WSTRING("bprsold_option0"), 1: u"1 — " + WSTRING("bprsold_option1"), 2: u"2 — " + WSTRING("bprsold_option2"), 3: u"3 — " + WSTRING("bprsold_option3"), 4: u"4 — " + WSTRING("bprsold_option4"), 5: u"5 — " + WSTRING("bprsold_option5"), 6: u"6 — " + WSTRING("bprsold_option6"), 7: u"7 — " + WSTRING("bprsold_option7") } h = self.get_standard_clinician_block() + u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score") + u" (0–168; 24–168 if all rated)", answer(self.total_score())) h += u""" </table> </div> <div class="explanation"> Each question has specific answer definitions (see e.g. tablet app). </div> <table class="taskdetail"> <tr> <th width="60%">Question</th> <th width="40%">Answer <sup>[1]</sup></th> </tr> """ for i in range(1, Bprse.NQUESTIONS + 1): h += tr_qa( WSTRING("bprse_q" + str(i) + "_s"), get_from_dict(MAIN_DICT, getattr(self, "q" + str(i))) ) h += u""" </table> <div class="footnotes"> [1] All answers are in the range 1–7, or 0 (not assessed, for some). </div> """ return h
def get_task_html(self): score = self.total_score() exceeds_cutoff_1 = score >= 6 exceeds_cutoff_2 = score >= 11 MAIN_DICT = { None: None, "Y": WSTRING("Yes"), "N": WSTRING("No") } h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 28") h += tr_qa(WSTRING("dast_exceeds_standard_cutoff_1"), get_yes_no(exceeds_cutoff_1)) h += tr_qa(WSTRING("dast_exceeds_standard_cutoff_2"), get_yes_no(exceeds_cutoff_2)) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="80%">Question</th> <th width="20%">Answer</th> </tr> """ for q in range(1, Dast.NQUESTIONS + 1): h += tr( WSTRING("dast_q" + str(q)), answer(get_from_dict(MAIN_DICT, getattr(self, "q" + str(q)))) + u" — " + answer(str(self.get_score(q))) ) h += u""" </table> <div class="copyright"> DAST: Copyright © Harvey A. Skinner and the Centre for Addiction and Mental Health, Toronto, Canada. Reproduced here under the permissions granted for NON-COMMERCIAL use only. You must obtain permission from the copyright holder for any other use. </div> """ return h
def get_task_html(self): score = self.total_score() severity = self.severity() ANSWER_DICTS = [] for q in range(1, Hama.NQUESTIONS + 1): d = {None: None} for option in range(0, 4): d[option] = WSTRING("hama_q" + str(q) + "_option" + str(option)) ANSWER_DICTS.append(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) + " / 56") h += tr_qa(WSTRING("hama_symptom_severity") + " <sup>[1]</sup>", severity) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="50%">Question</th> <th width="50%">Answer</th> </tr> """ for q in range(1, Hama.NQUESTIONS + 1): h += tr_qa( WSTRING("hama_q" + str(q) + "_s") + " " + WSTRING( "hama_q" + str(q) + "_question"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] ≥31 very severe, ≥25 moderate to severe, ≥18 mild to moderate, otherwise mild. </div> """ return h
def get_task_html(self): score = self.total_score() severity = self.severity() ANSWER_DICTS = [] for q in range(1, Hamd7.NQUESTIONS + 1): d = {None: None} for option in range(0, 5): if q == 6 and option > 2: continue d[option] = WSTRING("hamd7_q" + str(q) + "_option" + str(option)) ANSWER_DICTS.append(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) + " / 26") h += tr_qa(WSTRING("hamd7_severity") + " <sup>[1]</sup>", severity) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="30%">Question</th> <th width="70%">Answer</th> </tr> """ for q in range(1, Hamd7.NQUESTIONS + 1): h += tr_qa( WSTRING("hamd7_q" + str(q) + "_s"), get_from_dict(ANSWER_DICTS[q - 1], getattr(self, "q" + str(q))) ) h += u""" </table> <div class="footnotes"> [1] ≥20 severe, ≥12 moderate, ≥4 mild, <4 none. </div> """ return h
def get_task_html(self): score = self.total_score() likelihood = self.likelihood() MAIN_DICT = { None: None, "Y": WSTRING("Yes"), "N": WSTRING("No") } h = u""" <div class="summary"> <table class="summary"> """ h += self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 13") h += tr_qa(WSTRING("smast_problem_likelihood") + " <sup>[1]</sup>", likelihood) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="80%">Question</th> <th width="20%">Answer</th> </tr> """ for q in range(1, Smast.NQUESTIONS + 1): h += tr( WSTRING("smast_q" + str(q)), answer(get_from_dict(MAIN_DICT, getattr(self, "q" + str(q)))) + u" — " + str(self.get_score(q)) ) h += u""" </table> <div class="footnotes"> [1] Total score ≥3 probable, ≥2 possible, 0–1 unlikely. </div> """ return h
def get_task_html(self): score = self.total_score() exceeds_threshold = self.exceeds_ross_threshold() MAIN_DICT = { None: None, "Y": WSTRING("Yes"), "N": WSTRING("No") } h = u""" <div class="summary"> <table class="summary"> """ + self.get_is_complete_tr() h += tr(WSTRING("total_score"), answer(score) + " / 53") h += tr_qa(WSTRING("mast_exceeds_threshold"), get_yes_no(exceeds_threshold)) h += u""" </table> </div> <table class="taskdetail"> <tr> <th width="80%">Question</th> <th width="20%">Answer</th> </tr> """ for q in range(1, Mast.NQUESTIONS + 1): h += tr( WSTRING("mast_q" + str(q)), ( answer(get_from_dict(MAIN_DICT, getattr(self, "q" + str(q)))) + answer(u" — " + str(self.get_score(q))) ) ) h += u""" </table> """ return h
def get_row(self, q, ANSWER_DICT): return u"""<tr><td>{}</td><td><b>{}</b></td><td>{}</td></tr>""".format( WSTRING("gass_q" + str(q)), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))), get_yes_no(getattr(self, "d" + str(q))) )
def get_row(self, q, ANSWER_DICT): return u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format( "Q" + str(q) + u" — " + WSTRING("lunsers_q" + str(q)), get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q))) )