コード例 #1
0
    def get_next_actions(self):
        next_actions = []

        # add AE followup to next_actions if followup.
        next_actions = self.append_to_next_if_required(
            next_actions=next_actions,
            action_name=self.name,
            required=self.reference_obj.followup == YES,
        )

        # add Death report to next_actions if G5/Death
        next_actions = self.append_to_next_if_required(
            next_actions=next_actions,
            action_name=DEATH_REPORT_ACTION,
            required=(self.reference_obj.outcome == DEAD
                      or self.reference_obj.ae_grade == GRADE5),
        )

        # add Study termination to next_actions if LTFU
        if self.reference_obj.outcome == LOST_TO_FOLLOWUP:
            for offschedule_model in get_offschedule_models(
                    subject_identifier=self.subject_identifier,
                    report_datetime=self.reference_obj.report_datetime,
            ):
                action_cls = site_action_items.get_by_model(
                    model=offschedule_model)
                next_actions = self.append_to_next_if_required(
                    next_actions=next_actions,
                    action_name=action_cls.name,
                    required=True,
                )
        return next_actions
コード例 #2
0
 def get_offschedule_action_cls(self):
     """Returns the action class for the offschedule model.
     """
     action_cls = None
     for onschedule_model_obj in SubjectScheduleHistory.objects.onschedules(
             subject_identifier=self.subject_identifier,
             report_datetime=self.model_obj.report_datetime):
         _, schedule = site_visit_schedules.get_by_onschedule_model(
             onschedule_model=onschedule_model_obj._meta.label_lower)
         offschedule_model = schedule.offschedule_model
         action_cls = site_action_items.get_by_model(
             model=offschedule_model)
     return action_cls