示例#1
0
 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] &ge;10.
             [2] &ge;13.
             (Cox et al. 1987, PubMed ID 3651732.)
         </div>
     """
     return h
示例#2
0
 def get_task_html(self):
     n_csi_symptoms = self.total_score()
     csi_catatonia = n_csi_symptoms >= 2
     h = u"""
         <div class="summary">
             <table class="summary">
                 {}
                 <tr><td>{}</td><td><b>{}</b> / 14</td></tr>
                 <tr><td>{} <sup>[1]</sup></td><td><b>{}</b></td></tr>
             </table>
         </div>
         <table class="taskdetail">
             <tr>
                 <th width="50%">Question</th>
                 <th width="50%">Present?</th>
             </tr>
     """.format(
         self.get_is_complete_tr(),
         WSTRING("csi_num_symptoms_present"), n_csi_symptoms,
         WSTRING("csi_catatonia_present"), get_yes_no(csi_catatonia)
     )
     for q in range(1, Csi.NQUESTIONS + 1):
         h += u"""<tr><td>{}</td><td><b>{}</b></td></tr>""".format(
             "Q" + str(q) + u" — " + WSTRING("bfcrs_q" + str(q) + "_title"),
             get_yes_no_unknown(getattr(self, "q" + str(q)))
         )
     h += u"""
         </table>
         <div class="footnotes">
             [1] Number of CSI symptoms ≥2.
         </div>
     """
     return h
示例#3
0
 def get_task_html(self):
     score = self.total_score()
     exceeds_cutoff = score >= 2
     h = u"""
         <div class="summary">
             <table class="summary">
     """ + self.get_is_complete_tr()
     h += tr(WSTRING("total_score"), answer(score) + " / 4")
     h += tr_qa(WSTRING("cage_over_threshold"), get_yes_no(exceeds_cutoff))
     h += u"""
             </table>
         </div>
         <table class="taskdetail">
             <tr>
                 <th width="70%">Question</th>
                 <th width="30%">Answer</th>
             </tr>
     """
     for q in range(1, Cage.NQUESTIONS + 1):
         h += tr_qa(str(q) + u" — " + WSTRING("cage_q" + str(q)),
                    get_yes_no_none(getattr(self, "q" + str(q))))
     h += u"""
         </table>
     """
     return h
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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
示例#7
0
 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 &le;12.
             In patients with early dementia (MMSE > 24), a cutoff score of
             FAB &le;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
示例#8
0
 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
示例#9
0
 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 &ge;6. Scores of &ge;6 identify mania/hypomania
             with sensitivity 85.5%, specificity 87.3% (Altman et al. 1997,
             PubMed ID 9359982).
         </div>
     """
     return h
示例#10
0
 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
示例#11
0
 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
示例#12
0
 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)))
     )
示例#13
0
 def get_task_html(self):
     tasktype = self.TASK_TYPE
     score = self.total_score()
     num_symptomatic = self.num_symptomatic()
     num_symptomatic_B = self.num_symptomatic_B()
     num_symptomatic_C = self.num_symptomatic_C()
     num_symptomatic_D = self.num_symptomatic_D()
     ptsd = self.ptsd()
     ANSWER_DICT = {None: None}
     for option in range(1, 6):
         ANSWER_DICT[option] = str(option) + u" – " + \
             WSTRING("pcl_option" + str(option))
     h = u"""
         <div class="summary">
             <table class="summary">
     """
     h += self.get_is_complete_tr()
     h += tr_qa(u"{} (17–85)".format(WSTRING("total_score")),
                score)
     h += tr("Number symptomatic <sup>[1]</sup>: B, C, D (total)",
             answer(num_symptomatic_B)
             + ", "
             + answer(num_symptomatic_C)
             + ", "
             + answer(num_symptomatic_D)
             + " ("
             + answer(num_symptomatic)
             + ")")
     h += tr_qa(WSTRING("pcl_dsm_criteria_met") + " <sup>[2]</sup>",
                get_yes_no(ptsd))
     h += u"""
             </table>
         </div>
         <table class="taskdetail">
             <tr>
                 <th width="70%">Question</th>
                 <th width="30%">Answer</th>
             </tr>
     """
     if tasktype == "S":
         h += tr_qa(WSTRING("pcl_s_event_s"), self.event)
         h += tr_qa(WSTRING("pcl_s_eventdate_s"), self.eventdate)
     for q in range(1, PclCommon.NQUESTIONS + 1):
         if q == 1 or q == 6 or q == 13:
             section = "B" if q == 1 else ("C" if q == 6 else "D")
             h += subheading_spanning_two_columns(
                 "DSM section {}".format(section)
             )
         h += tr_qa(
             WSTRING("pcl_q" + str(q) + "_s"),
             get_from_dict(ANSWER_DICT, getattr(self, "q" + str(q)))
         )
     h += u"""
         </table>
         <div class="footnotes">
             [1] Questions with scores ≥3 are considered symptomatic.
             [2] ≥1 ‘B’ symptoms and ≥3 ‘C’ symptoms and
                 ≥2 ‘D’ symptoms.
         </div>
     """
     return h
示例#14
0
 def get_task_html(self):
     MAIN_DICT = {
         None: None,
         0: u"0 — " + WSTRING("phq9_a0"),
         1: u"1 — " + WSTRING("phq9_a1"),
         2: u"2 — " + WSTRING("phq9_a2"),
         3: u"3 — " + WSTRING("phq9_a3"),
     }
     Q10_DICT = {
         None: None,
         0: u"0 — " + WSTRING("phq9_fa0"),
         1: u"1 — " + WSTRING("phq9_fa1"),
         2: u"2 — " + WSTRING("phq9_fa2"),
         3: u"3 — " + WSTRING("phq9_fa3"),
     }
     # NB Unicode string literal: start with u
     h = (
         u"""
         <div class="summary">
             <table class="summary">
     """
         + self.get_is_complete_tr()
     )
     h += tr(WSTRING("total_score") + " <sup>[1]</sup>", answer(self.total_score()) + " / 27")
     h += tr_qa(WSTRING("phq9_depression_severity") + " <sup>[2]</sup>", self.severity())
     h += tr(
         "Number of symptoms: core <sup>[3]</sup>, other <sup>[4]</sup>, " "total",
         answer(self.n_core()) + "/2, " + answer(self.n_other()) + "/7, " + answer(self.n_total()) + "/9",
     )
     h += tr_qa(WSTRING("phq9_mds") + " <sup>[5]</sup>", get_yes_no(self.is_mds()))
     h += tr_qa(WSTRING("phq9_ods") + " <sup>[6]</sup>", get_yes_no(self.is_ods()))
     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, Phq9.N_MAIN_QUESTIONS + 1):
         nstr = str(i)
         h += tr_qa(WSTRING("phq9_q" + nstr), get_from_dict(MAIN_DICT, getattr(self, "q" + nstr)))
     h += tr_qa("10. " + WSTRING("phq9_finalq"), get_from_dict(Q10_DICT, self.q10))
     h += u"""
         </table>
         <div class="footnotes">
             [1] Sum for questions 1–9.
             [2] Total score ≥20 severe, ≥15 moderately severe,
                 ≥10 moderate, ≥5 mild, &lt;5 none.
             [3] Number of questions 1–2 rated ≥2.
             [4] Number of questions 3–8 rated ≥2, or question 9
                 rated ≥1.
             [5] ≥1 core symptom and ≥5 total symptoms (as per
                 DSM-IV-TR page 356).
             [6] ≥1 core symptom and 2–4 total symptoms (as per
                 DSM-IV-TR page 775).
         </div>
     """
     return h
示例#15
0
    def get_task_html(self):
        FREQ_DICT = {None: None}
        DISTRESS_DICT = {None: None}
        for a in range(self.MIN_SCORE, self.MAX_SCORE + 1):
            FREQ_DICT[a] = WSTRING("cbir_f" + str(a))
            DISTRESS_DICT[a] = WSTRING("cbir_d" + str(a))
        HEADINGS = AttrDict({
            "memory": WSTRING("cbir_h_memory"),
            "everyday": WSTRING("cbir_h_everyday"),
            "selfcare": WSTRING("cbir_h_selfcare"),
            "behaviour": WSTRING("cbir_h_abnormalbehaviour"),
            "mood": WSTRING("cbir_h_mood"),
            "beliefs": WSTRING("cbir_h_beliefs"),
            "eating": WSTRING("cbir_h_eating"),
            "sleep": WSTRING("cbir_h_sleep"),
            "motor": WSTRING("cbir_h_stereotypy_motor"),
            "motivation": WSTRING("cbir_h_motivation"),
        })

        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

        h = u"""
            <div class="summary">
                <table class="summary">
                    {complete_tr}
                </table>
                <table class="summary">
                    <tr>
                        <th>Subscale</th>
                        <th>Frequency (% of max)</th>
                        <th>Distress (% of max)</th>
                    </tr>
                    <tr>
                        <td>{HEADINGS.memory}</td>
                        <td>{mem_f}</td>
                        <td>{mem_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.everyday}</td>
                        <td>{everyday_f}</td>
                        <td>{everyday_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.selfcare}</td>
                        <td>{self_f}</td>
                        <td>{self_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.behaviour}</td>
                        <td>{behav_f}</td>
                        <td>{behav_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.mood}</td>
                        <td>{mood_f}</td>
                        <td>{mood_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.beliefs}</td>
                        <td>{beliefs_f}</td>
                        <td>{beliefs_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.eating}</td>
                        <td>{eating_f}</td>
                        <td>{eating_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.sleep}</td>
                        <td>{sleep_f}</td>
                        <td>{sleep_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.motor}</td>
                        <td>{motor_f}</td>
                        <td>{motor_d}</td>
                    </tr>
                    <tr>
                        <td>{HEADINGS.motivation}</td>
                        <td>{motivation_f}</td>
                        <td>{motivation_d}</td>
                    </tr>
                </table>
            </div>
            <table class="taskdetail">
                {tr_responder}
                {tr_relationship}
                {tr_blanks}
                {tr_comments}
            </table>
            <table class="taskdetail">
                <tr>
                    <th width="50%">Question</th>
                    <th width="25%">Frequency (0–4)</th>
                    <th width="25%">Distress (0–4)</th>
                </tr>
        """.format(
            complete_tr=self.get_is_complete_tr(),
            HEADINGS=HEADINGS,
            mem_f=answer(self.frequency_subscore(*self.QNUMS_MEMORY)),
            mem_d=answer(self.distress_subscore(*self.QNUMS_MEMORY)),
            everyday_f=answer(self.frequency_subscore(*self.QNUMS_EVERYDAY)),
            everyday_d=answer(self.distress_subscore(*self.QNUMS_EVERYDAY)),
            self_f=answer(self.frequency_subscore(*self.QNUMS_SELF)),
            self_d=answer(self.distress_subscore(*self.QNUMS_SELF)),
            behav_f=answer(self.frequency_subscore(*self.QNUMS_BEHAVIOUR)),
            behav_d=answer(self.distress_subscore(*self.QNUMS_BEHAVIOUR)),
            mood_f=answer(self.frequency_subscore(*self.QNUMS_MOOD)),
            mood_d=answer(self.distress_subscore(*self.QNUMS_MOOD)),
            beliefs_f=answer(self.frequency_subscore(*self.QNUMS_BELIEFS)),
            beliefs_d=answer(self.distress_subscore(*self.QNUMS_BELIEFS)),
            eating_f=answer(self.frequency_subscore(*self.QNUMS_EATING)),
            eating_d=answer(self.distress_subscore(*self.QNUMS_EATING)),
            sleep_f=answer(self.frequency_subscore(*self.QNUMS_SLEEP)),
            sleep_d=answer(self.distress_subscore(*self.QNUMS_SLEEP)),
            motor_f=answer(self.frequency_subscore(*self.QNUMS_STEREOTYPY)),
            motor_d=answer(self.distress_subscore(*self.QNUMS_STEREOTYPY)),
            motivation_f=answer(
                self.frequency_subscore(*self.QNUMS_MOTIVATION)),
            motivation_d=answer(
                self.distress_subscore(*self.QNUMS_MOTIVATION)),
            tr_responder=tr_qa(u"Responder’s name", self.responder_name),
            tr_relationship=tr_qa(u"Responder’s relationship to patient",
                                  self.responder_relationship),
            tr_blanks=tr(
                "Responded confirmed that blanks are deliberate (N/A)",
                answer(get_yes_no(self.responder_relationship))),
            tr_comments=tr_qa("Comments",
                              answer(self.comments, default="")),
        )
        h += subheading_spanning_three_columns(HEADINGS.memory)
        h += get_question_rows(*self.QNUMS_MEMORY)
        h += subheading_spanning_three_columns(HEADINGS.everyday)
        h += get_question_rows(*self.QNUMS_EVERYDAY)
        h += subheading_spanning_three_columns(HEADINGS.selfcare)
        h += get_question_rows(*self.QNUMS_SELF)
        h += subheading_spanning_three_columns(HEADINGS.behaviour)
        h += get_question_rows(*self.QNUMS_BEHAVIOUR)
        h += subheading_spanning_three_columns(HEADINGS.mood)
        h += get_question_rows(*self.QNUMS_MOOD)
        h += subheading_spanning_three_columns(HEADINGS.beliefs)
        h += get_question_rows(*self.QNUMS_BELIEFS)
        h += subheading_spanning_three_columns(HEADINGS.eating)
        h += get_question_rows(*self.QNUMS_EATING)
        h += subheading_spanning_three_columns(HEADINGS.sleep)
        h += get_question_rows(*self.QNUMS_SLEEP)
        h += subheading_spanning_three_columns(HEADINGS.motor)
        h += get_question_rows(*self.QNUMS_STEREOTYPY)
        h += subheading_spanning_three_columns(HEADINGS.motivation)
        h += get_question_rows(*self.QNUMS_MOTIVATION)
        h += u"""
            </table>
        """
        return h