Example #1
0
    def get_esr_tracker(self, req: CamcopsRequest) -> TrackerInfo:
        axis_min = -0.5
        axis_max = 10.0
        axis_ticks = [
            TrackerAxisTick(n, str(n)) for n in range(0,
                                                      int(axis_max) + 1)
        ]

        horizontal_lines = [
            self.ESR_MODERATE_HIGH_CUTOFF,
            self.ESR_LOW_MODERATE_CUTOFF,
            self.ESR_REMISSION_LOW_CUTOFF,
            0,
        ]

        horizontal_labels = [
            TrackerLabel(7.55, self.wxstring(req, "high")),
            TrackerLabel(4.15, self.wxstring(req, "moderate")),
            TrackerLabel(2.9, self.wxstring(req, "low")),
            TrackerLabel(1.3, self.wxstring(req, "remission")),
        ]

        return TrackerInfo(
            value=self.das28_esr(),
            plot_label="DAS28-ESR",
            axis_label="DAS28-ESR",
            axis_min=axis_min,
            axis_max=axis_max,
            axis_ticks=axis_ticks,
            horizontal_lines=horizontal_lines,
            horizontal_labels=horizontal_labels,
        )
Example #2
0
    def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
        axis_min = self.MINIMUM - 0.5
        axis_max = self.MAXIMUM + 0.5
        axis_ticks = [
            TrackerAxisTick(n, str(n)) for n in range(0,
                                                      int(axis_max) + 1)
        ]

        horizontal_lines = [self.MAXIMUM, self.ACTIVE_CUTOFF, self.MINIMUM]

        horizontal_labels = [
            TrackerLabel(self.ACTIVE_CUTOFF + 0.5,
                         self.wxstring(req, "active")),
            TrackerLabel(self.ACTIVE_CUTOFF - 0.5,
                         self.wxstring(req, "inactive")),
        ]

        return [
            TrackerInfo(
                value=self.basdai(),
                plot_label="BASDAI",
                axis_label="BASDAI",
                axis_min=axis_min,
                axis_max=axis_max,
                axis_ticks=axis_ticks,
                horizontal_lines=horizontal_lines,
                horizontal_labels=horizontal_labels,
            )
        ]
Example #3
0
    def get_crp_tracker(self, req: CamcopsRequest) -> TrackerInfo:
        axis_min = -0.5
        axis_max = 9.0
        axis_ticks = [
            TrackerAxisTick(n, str(n)) for n in range(0,
                                                      int(axis_max) + 1)
        ]

        horizontal_lines = [
            self.CRP_MODERATE_HIGH_CUTOFF,
            self.CRP_LOW_MODERATE_CUTOFF,
            self.CRP_REMISSION_LOW_CUTOFF,
            0,
        ]

        horizontal_labels = [
            TrackerLabel(6.8, self.wxstring(req, "high")),
            TrackerLabel(3.75, self.wxstring(req, "moderate")),
            TrackerLabel(2.65, self.wxstring(req, "low")),
            TrackerLabel(1.2, self.wxstring(req, "remission")),
        ]

        return TrackerInfo(
            value=self.das28_crp(),
            plot_label="DAS28-CRP",
            axis_label="DAS28-CRP",
            axis_min=axis_min,
            axis_max=axis_max,
            axis_ticks=axis_ticks,
            horizontal_lines=horizontal_lines,
            horizontal_labels=horizontal_labels,
        )
Example #4
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="PHQ-9 total score (rating depressive symptoms)",
             axis_label="Score for Q1-9 (out of {})".format(
                 self.MAX_SCORE_MAIN),
             axis_min=-0.5,
             axis_max=self.MAX_SCORE_MAIN + 0.5,
             axis_ticks=[
                 TrackerAxisTick(27, "27"),
                 TrackerAxisTick(25, "25"),
                 TrackerAxisTick(20, "20"),
                 TrackerAxisTick(15, "15"),
                 TrackerAxisTick(10, "10"),
                 TrackerAxisTick(5, "5"),
                 TrackerAxisTick(0, "0"),
             ],
             horizontal_lines=[19.5, 14.5, 9.5, 4.5],
             horizontal_labels=[
                 TrackerLabel(23, req.wappstring("severe")),
                 TrackerLabel(17, req.wappstring("moderately_severe")),
                 TrackerLabel(12, req.wappstring("moderate")),
                 TrackerLabel(7, req.wappstring("mild")),
                 TrackerLabel(2.25, req.wappstring("none")),
             ])
     ]
Example #5
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="PHQ-9 total score (rating depressive symptoms)",
             axis_label=f"Score for Q1-9 (out of {self.MAX_SCORE_MAIN})",
             axis_min=-0.5,
             axis_max=self.MAX_SCORE_MAIN + 0.5,
             axis_ticks=[
                 TrackerAxisTick(27, "27"),
                 TrackerAxisTick(25, "25"),
                 TrackerAxisTick(20, "20"),
                 TrackerAxisTick(15, "15"),
                 TrackerAxisTick(10, "10"),
                 TrackerAxisTick(5, "5"),
                 TrackerAxisTick(0, "0"),
             ],
             horizontal_lines=[19.5, 14.5, 9.5, 4.5],
             horizontal_labels=[
                 TrackerLabel(23, req.sstring(SS.SEVERE)),
                 TrackerLabel(17, req.sstring(SS.MODERATELY_SEVERE)),
                 TrackerLabel(12, req.sstring(SS.MODERATE)),
                 TrackerLabel(7, req.sstring(SS.MILD)),
                 TrackerLabel(2.25, req.sstring(SS.NONE)),
             ],
         )
     ]
Example #6
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [TrackerInfo(
         value=self.total_score(),
         plot_label="GAD-7 total score",
         axis_label="Total score (out of 21)",
         axis_min=-0.5,
         axis_max=self.MAX_SCORE + 0.5,
         horizontal_lines=[14.5, 9.5, 4.5],
         horizontal_labels=[
             TrackerLabel(17, req.wappstring("severe")),
             TrackerLabel(12, req.wappstring("moderate")),
             TrackerLabel(7, req.wappstring("mild")),
             TrackerLabel(2.25, req.wappstring("none")),
         ]
     )]
Example #7
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(value=self.total_score(),
                     plot_label="CIWA total score",
                     axis_label="Total score (out of {})".format(
                         self.MAX_SCORE),
                     axis_min=-0.5,
                     axis_max=self.MAX_SCORE + 0.5,
                     horizontal_lines=[14.5, 7.5],
                     horizontal_labels=[
                         TrackerLabel(17, req.wappstring("severe")),
                         TrackerLabel(11, req.wappstring("moderate")),
                         TrackerLabel(3.75, req.wappstring("mild")),
                     ])
     ]
Example #8
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(value=self.total_score(),
                     plot_label="MOCA total score",
                     axis_label="Total score (out of {})".format(
                         self.MAX_SCORE),
                     axis_min=-0.5,
                     axis_max=(self.MAX_SCORE + 0.5),
                     horizontal_lines=[25.5],
                     horizontal_labels=[
                         TrackerLabel(26, req.wappstring("normal"),
                                      LabelAlignment.bottom),
                         TrackerLabel(25, req.wappstring("abnormal"),
                                      LabelAlignment.top),
                     ])
     ]
Example #9
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="HAM-A total score",
             axis_label="Total score (out of {})".format(self.MAX_SCORE),
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=[30.5, 24.5, 17.5],
             horizontal_labels=[
                 TrackerLabel(33, req.wappstring("very_severe")),
                 TrackerLabel(27.5, req.wappstring("moderate_to_severe")),
                 TrackerLabel(21, req.wappstring("mild_to_moderate")),
                 TrackerLabel(8.75, req.wappstring("mild")),
             ])
     ]
Example #10
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     line_step = 20
     threshold_line = self.DEPRESSION_RISK_THRESHOLD - 0.5
     # noinspection PyTypeChecker
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="CESD total score",
             axis_label=f"Total score ({self.MIN_SCORE}-{self.MAX_SCORE})",
             axis_min=self.MIN_SCORE - 0.5,
             axis_max=self.MAX_SCORE + 0.5,
             axis_ticks=regular_tracker_axis_ticks_int(self.MIN_SCORE,
                                                       self.MAX_SCORE,
                                                       step=line_step),
             horizontal_lines=equally_spaced_int(
                 self.MIN_SCORE + line_step,
                 self.MAX_SCORE - line_step,
                 step=line_step,
             ) + [threshold_line],
             horizontal_labels=[
                 TrackerLabel(
                     threshold_line,
                     self.wxstring(req, "depression_or_risk_of"),
                 )
             ],
         )
     ]
Example #11
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [TrackerInfo(
         value=self.total_score(),
         plot_label="HAM-D total score",
         axis_label="Total score (out of {})".format(MAX_SCORE),
         axis_min=-0.5,
         axis_max=MAX_SCORE + 0.5,
         horizontal_lines=[22.5, 19.5, 14.5, 7.5],
         horizontal_labels=[
             TrackerLabel(25, self.wxstring(req, "severity_verysevere")),
             TrackerLabel(21, self.wxstring(req, "severity_severe")),
             TrackerLabel(17, self.wxstring(req, "severity_moderate")),
             TrackerLabel(11, self.wxstring(req, "severity_mild")),
             TrackerLabel(3.75, self.wxstring(req, "severity_none")),
         ]
     )]
Example #12
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="SMAST total score",
             axis_label=f"Total score (out of {self.NQUESTIONS})",
             axis_min=-0.5,
             axis_max=self.NQUESTIONS + 0.5,
             horizontal_lines=[2.5, 1.5],
             horizontal_labels=[
                 TrackerLabel(4, self.wxstring(req, "problem_probable")),
                 TrackerLabel(2, self.wxstring(req, "problem_possible")),
                 TrackerLabel(0.75, self.wxstring(req, "problem_unlikely")),
             ],
         )
     ]
Example #13
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="CIWA total score",
             axis_label=f"Total score (out of {self.MAX_SCORE})",
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=[14.5, 7.5],
             horizontal_labels=[
                 TrackerLabel(17, req.sstring(SS.SEVERE)),
                 TrackerLabel(11, req.sstring(SS.MODERATE)),
                 TrackerLabel(3.75, req.sstring(SS.MILD)),
             ],
         )
     ]
Example #14
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     line_step = 20
     preliminary_cutoff = 33
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="PCL-5 total score",
             axis_label=f"Total score ({self.MIN_SCORE}-{self.MAX_SCORE})",
             axis_min=self.MIN_SCORE - 0.5,
             axis_max=self.MAX_SCORE + 0.5,
             axis_ticks=regular_tracker_axis_ticks_int(self.MIN_SCORE,
                                                       self.MAX_SCORE,
                                                       step=line_step),
             horizontal_lines=equally_spaced_int(
                 self.MIN_SCORE + line_step,
                 self.MAX_SCORE - line_step,
                 step=line_step,
             ) + [preliminary_cutoff],
             horizontal_labels=[
                 TrackerLabel(
                     preliminary_cutoff,
                     self.wxstring(req, "preliminary_cutoff"),
                 )
             ],
         )
     ]
Example #15
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="MOCA total score",
             axis_label=f"Total score (out of {self.MAX_SCORE})",
             axis_min=-0.5,
             axis_max=(self.MAX_SCORE + 0.5),
             horizontal_lines=[25.5],
             horizontal_labels=[
                 TrackerLabel(26, req.sstring(SS.NORMAL),
                              LabelAlignment.bottom),
                 TrackerLabel(25, req.sstring(SS.ABNORMAL),
                              LabelAlignment.top),
             ],
         )
     ]
Example #16
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="PHQ-15 total score (rating somatic symptoms)",
             axis_label=f"Score for Q1-15 (out of {self.MAX_TOTAL})",
             axis_min=-0.5,
             axis_max=self.MAX_TOTAL + 0.5,
             horizontal_lines=[14.5, 9.5, 4.5],
             horizontal_labels=[
                 TrackerLabel(22, req.sstring(SS.SEVERE)),
                 TrackerLabel(12, req.sstring(SS.MODERATE)),
                 TrackerLabel(7, req.sstring(SS.MILD)),
                 TrackerLabel(2.25, req.sstring(SS.NONE)),
             ],
         )
     ]
Example #17
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="PHQ-15 total score (rating somatic symptoms)",
             axis_label="Score for Q1-15 (out of {})".format(
                 self.MAX_TOTAL),
             axis_min=-0.5,
             axis_max=self.MAX_TOTAL + 0.5,
             horizontal_lines=[14.5, 9.5, 4.5],
             horizontal_labels=[
                 TrackerLabel(22, req.wappstring("severe")),
                 TrackerLabel(12, req.wappstring("moderate")),
                 TrackerLabel(7, req.wappstring("mild")),
                 TrackerLabel(2.25, req.wappstring("none")),
             ])
     ]
Example #18
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="GAD-7 total score",
             axis_label="Total score (out of 21)",
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=[14.5, 9.5, 4.5],
             horizontal_labels=[
                 TrackerLabel(17, req.sstring(SS.SEVERE)),
                 TrackerLabel(12, req.sstring(SS.MODERATE)),
                 TrackerLabel(7, req.sstring(SS.MILD)),
                 TrackerLabel(2.25, req.sstring(SS.NONE)),
             ],
         )
     ]
Example #19
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="HAM-A total score",
             axis_label=f"Total score (out of {self.MAX_SCORE})",
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=[30.5, 24.5, 17.5],
             horizontal_labels=[
                 TrackerLabel(33, req.sstring(SS.VERY_SEVERE)),
                 TrackerLabel(27.5, req.sstring(SS.MODERATE_TO_SEVERE)),
                 TrackerLabel(21, req.sstring(SS.MILD_TO_MODERATE)),
                 TrackerLabel(8.75, req.sstring(SS.MILD)),
             ],
         )
     ]
Example #20
0
    def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
        axis_min = self.MINIMUM - 0.5
        axis_max = self.MAXIMUM + 0.5
        axis_ticks = [
            TrackerAxisTick(n, str(n)) for n in range(0,
                                                      int(axis_max) + 1, 2)
        ]

        horizontal_lines = [
            self.MAXIMUM,
            self.MODERATE_SEVERITY_MAX,
            self.LOW_SEVERITY_MAX,
            self.NEAR_REMISSION_MAX,
            self.MINIMUM,
        ]

        horizontal_labels = [
            TrackerLabel(
                self.MODERATE_SEVERITY_MAX + 8.0,
                self.wxstring(req, "high_severity"),
            ),
            TrackerLabel(
                self.MODERATE_SEVERITY_MAX - 3.0,
                self.wxstring(req, "moderate_severity"),
            ),
            TrackerLabel(self.LOW_SEVERITY_MAX - 1.5,
                         self.wxstring(req, "low_severity")),
            TrackerLabel(
                self.NEAR_REMISSION_MAX - 1.5,
                self.wxstring(req, "near_remission"),
            ),
        ]

        return [
            TrackerInfo(
                value=self.rapid3(),
                plot_label="RAPID3",
                axis_label="RAPID3",
                axis_min=axis_min,
                axis_max=axis_max,
                axis_ticks=axis_ticks,
                horizontal_lines=horizontal_lines,
                horizontal_labels=horizontal_labels,
            )
        ]
Example #21
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="HAM-D-7 total score",
             axis_label=f"Total score (out of {self.MAX_SCORE})",
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=[19.5, 11.5, 3.5],
             horizontal_labels=[
                 TrackerLabel(23, self.wxstring(req, "severity_severe")),
                 TrackerLabel(15.5, self.wxstring(req,
                                                  "severity_moderate")),
                 TrackerLabel(7.5, self.wxstring(req, "severity_mild")),
                 TrackerLabel(1.75, self.wxstring(req, "severity_none")),
             ],
         )
     ]
Example #22
0
    def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
        axis_min = -0.5
        axis_max = 7.5
        axis_ticks = [
            TrackerAxisTick(n, str(n)) for n in range(0, int(axis_max) + 1)
        ]

        horizontal_lines = [
            self.HIGH_VERY_HIGH_CUTOFF,
            self.MODERATE_HIGH_CUTOFF,
            self.INACTIVE_MODERATE_CUTOFF,
            0,
        ]

        horizontal_labels = [
            TrackerLabel(5.25, self.wxstring(req, "very_high")),
            TrackerLabel(2.8, self.wxstring(req, "high")),
            TrackerLabel(1.7, self.wxstring(req, "moderate")),
            TrackerLabel(0.65, self.wxstring(req, "inactive")),
        ]

        return [
            TrackerInfo(
                value=self.asdas_crp(),
                plot_label="ASDAS-CRP",
                axis_label="ASDAS-CRP",
                axis_min=axis_min,
                axis_max=axis_max,
                axis_ticks=axis_ticks,
                horizontal_lines=horizontal_lines,
                horizontal_labels=horizontal_labels,
            ),
            TrackerInfo(
                value=self.asdas_esr(),
                plot_label="ASDAS-ESR",
                axis_label="ASDAS-ESR",
                axis_min=axis_min,
                axis_max=axis_max,
                axis_ticks=axis_ticks,
                horizontal_lines=horizontal_lines,
                horizontal_labels=horizontal_labels,
            ),
        ]
Example #23
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="EPDS total score (rating depressive symptoms)",
             axis_label=f"Total score (out of {self.MAX_TOTAL})",
             axis_min=-0.5,
             axis_max=self.MAX_TOTAL + 0.5,
             horizontal_lines=[
                 self.CUTOFF_2_GREATER_OR_EQUAL - 0.5,
                 self.CUTOFF_1_GREATER_OR_EQUAL - 0.5,
             ],
             horizontal_labels=[
                 TrackerLabel(self.CUTOFF_2_GREATER_OR_EQUAL,
                              "likely depression"),
                 TrackerLabel(self.CUTOFF_1_GREATER_OR_EQUAL,
                              "possible depression"),
             ],
         )
     ]
Example #24
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     return [
         TrackerInfo(value=self.total_score(),
                     plot_label="MAST total score",
                     axis_label="Total score (out of {})".format(
                         self.MAX_SCORE),
                     axis_min=-0.5,
                     axis_max=self.MAX_SCORE + 0.5,
                     horizontal_lines=[self.ROSS_THRESHOLD - 0.5],
                     horizontal_labels=[
                         TrackerLabel(self.ROSS_THRESHOLD, "Ross threshold",
                                      LabelAlignment.bottom)
                     ])
     ]
Example #25
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     if self.highschooleducation == 1:
         hlines = [26.5, 20.5]
         y_upper = 28.25
         y_middle = 23.5
     else:
         hlines = [24.5, 19.5]
         y_upper = 27.25
         y_middle = 22
     return [
         TrackerInfo(
             value=self.total_score(),
             plot_label="SLUMS total score",
             axis_label="Total score (out of {})".format(self.MAX_SCORE),
             axis_min=-0.5,
             axis_max=self.MAX_SCORE + 0.5,
             horizontal_lines=hlines,
             horizontal_labels=[
                 TrackerLabel(y_upper, req.wappstring("normal")),
                 TrackerLabel(y_middle, self.wxstring(req, "category_mci")),
                 TrackerLabel(17, self.wxstring(req, "category_dementia")),
             ])
     ]
Example #26
0
 def get_trackers(self, req: CamcopsRequest) -> List[TrackerInfo]:
     # $ signs enable TEX mode for matplotlib, e.g. "$BMI (kg/m^2)$"
     return [
         TrackerInfo(
             value=self.bmi(),
             plot_label="Body mass index",
             axis_label="BMI (kg/m^2)",
             axis_min=10,
             axis_max=42,
             horizontal_lines=[13, 15, 16, 17, 17.5, 18.5, 25, 30, 35, 40],
             horizontal_labels=[
                 # positioned near the mid-range for some:
                 TrackerLabel(
                     12.5,
                     self.wxstring(req, "underweight_under_13"),
                     LabelAlignment.top,
                 ),
                 TrackerLabel(14, self.wxstring(req, "underweight_13_15")),
                 TrackerLabel(
                     15.5, self.wxstring(req, "underweight_15_16")
                 ),
                 TrackerLabel(
                     16.5, self.wxstring(req, "underweight_16_17")
                 ),
                 TrackerLabel(
                     17.25, self.wxstring(req, "underweight_17_17.5")
                 ),
                 TrackerLabel(
                     18, self.wxstring(req, "underweight_17.5_18.5")
                 ),
                 TrackerLabel(21.75, self.wxstring(req, "normal")),
                 TrackerLabel(27.5, self.wxstring(req, "overweight")),
                 TrackerLabel(32.5, self.wxstring(req, "obese_1")),
                 TrackerLabel(37.6, self.wxstring(req, "obese_2")),
                 TrackerLabel(
                     40.5,
                     self.wxstring(req, "obese_3"),
                     LabelAlignment.bottom,
                 ),
             ],
             aspect_ratio=1.0,
         ),
         TrackerInfo(
             value=self.mass_kg,
             plot_label="Mass (kg)",
             axis_label="Mass (kg)",
         ),
         TrackerInfo(
             value=self.waist_cm,
             plot_label="Waist circumference (cm)",
             axis_label="Waist circumference (cm)",
         ),
     ]