示例#1
0
from edc_action_item import Action, site_action_items, HIGH_PRIORITY

INFANT_COVID_SCREENING_ACTION = 'update-infant-covid-results'


class InfantCovidScreeningAction(Action):
    name = INFANT_COVID_SCREENING_ACTION
    display_name = 'Update Infant Covid Screening Test Results'
    reference_model = 'td_infant.infantcovidscreening'
    admin_site_name = 'td_infant_admin'
    priority = HIGH_PRIORITY

    def close_action_item_on_save(self):
        """Returns True if action item for \'action_identifier\'
        is to be closed on post_save.
        """
        return self.reference_model_obj.covid_results != 'pending'


site_action_items.register(InfantCovidScreeningAction)
示例#2
0
from edc_action_item import Action, site_action_items
from edc_constants.constants import HIGH_PRIORITY

SUBJECT_LOCATOR_ACTION = "submit-subject-locator"


class SubjectLocatorAction(Action):
    name = SUBJECT_LOCATOR_ACTION
    display_name = "Submit Subject Locator"
    reference_model = "edc_locator.subjectlocator"
    show_link_to_changelist = True
    admin_site_name = "edc_locator_admin"
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(SubjectLocatorAction)
示例#3
0
from .constants import FOLLOWUP_EXAMINATION_ACTION


class FollowupExaminationAction(Action):
    name = FOLLOWUP_EXAMINATION_ACTION
    priority = HIGH_PRIORITY
    display_name = "Followup Exam: AE"
    reference_model = "meta_subject.followupexamination"
    show_on_dashboard = True
    create_by_user = False

    def get_next_actions(self):
        next_actions = []
        if (self.reference_obj.symptoms_g3.exclude(name=NONE).count() > 0 or
                self.reference_obj.symptoms_g4.exclude(name=NONE).count() > 0
                or self.reference_obj.any_other_problems_sae_grade in [
                    GRADE3, GRADE4
                ]) and not is_baseline(self.reference_obj.subject_visit):
            next_actions.append(AE_INITIAL_ACTION)
        return next_actions


site_action_items.register(BloodResultsFbcAction)
site_action_items.register(BloodResultsEgfrAction)
site_action_items.register(BloodResultsLipidAction)
site_action_items.register(BloodResultsLftAction)
site_action_items.register(BloodResultsRftAction)
site_action_items.register(BloodResultsGluAction)
site_action_items.register(BloodResultsHba1cAction)
site_action_items.register(FollowupExaminationAction)
示例#4
0
        # add next Recurrence of Symptoms if YES
        next_actions = self.append_to_next_if_required(
            next_actions=next_actions,
            action_name=RECURRENCE_OF_SYMPTOMS_ACTION,
            required=self.reference_obj.ae_cm_recurrence == YES,
        )
        return next_actions


class RecurrenceOfSymptomsAction(ActionWithNotification):
    name = RECURRENCE_OF_SYMPTOMS_ACTION
    display_name = "Submit Recurrence of Symptoms Report"
    notification_display_name = "Recurrence of Symptoms Report"
    parent_action_names = [AE_INITIAL_ACTION]
    reference_model = "ambition_ae.recurrencesymptom"
    show_link_to_changelist = True
    admin_site_name = "ambition_ae_admin"
    priority = HIGH_PRIORITY
    create_by_user = False
    help_text = "This document is triggered by AE Initial"


site_action_items.register(AeFollowupAction)
site_action_items.register(AeInitialAction)
site_action_items.register(AeSusarAction)
site_action_items.register(AeTmgAction)
site_action_items.register(DeathReportAction)
site_action_items.register(DeathReportTmgAction)
site_action_items.register(DeathReportTmgSecondAction)
site_action_items.register(RecurrenceOfSymptomsAction)
from edc_action_item import Action, site_action_items, HIGH_PRIORITY

SUBJECT_LOCATOR_ACTION = 'submit-subject-locator'


class SubjectLocatorAction(Action):
    name = SUBJECT_LOCATOR_ACTION
    display_name = 'Submit Subject Locator'
    reference_model = 'edc_locator.subjectlocator'
    show_link_to_changelist = True
    admin_site_name = 'edc_locator_admin'
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(SubjectLocatorAction)
示例#6
0
        try:
            self.action_item_model_cls().objects.get(
                parent_action_item=self.related_action_item,
                related_action_item=self.related_action_item,
                action_type__name=self.name,
            )
        except ObjectDoesNotExist:
            pass
        except MultipleObjectsReturned:
            # because more than one action item has the same
            # parent_action_item and related_action_item. this
            # only occurs for older data.
            pass
        else:
            if (self.action_item_model_cls().objects.filter(
                    related_action_item=self.related_action_item,
                    action_type__name=self.name,
            ).count() < 2):
                if (self.reference_obj.cause_of_death !=
                        self.related_action_item.reference_obj.cause_of_death):
                    next_actions = ["self"]
        return next_actions


site_action_items.register(DeathReportAction)
site_action_items.register(DeathReportTmgAction)
site_action_items.register(AeFollowupAction)
site_action_items.register(AeInitialAction)
site_action_items.register(AeSusarAction)
site_action_items.register(AeTmgAction)
示例#7
0
            action_type__name='submit-subject-offstudy')

        try:
            potlako_deathreport_cls.objects.get(
                subject_identifier=subject_identifier)
            if not offstudy:
                actions = [SubjectOffStudyAction]
        except ObjectDoesNotExist:
            pass
        return actions


class SubjectOffStudyAction(Action):
    name = SUBJECT_OFFSTUDY_ACTION
    display_name = 'Submit Subject Offstudy'
    reference_model = 'potlako_prn.subjectoffstudy'
    show_link_to_changelist = True
    show_link_to_add = True
    admin_site_name = 'potlako_prn_admin'
    priority = HIGH_PRIORITY
    singleton = True

    def get_next_actions(self):
        actions = [PotlakoCoordinatorAction]
        return actions


site_action_items.register(DeathReportAction)
site_action_items.register(SubjectOffStudyAction)
site_action_items.register(PotlakoCoordinatorAction)
示例#8
0
    def get_next_actions(self):
        actions = []

        # resave visit to update metadata
        self.reference_model_obj.maternal_visit.save()

        if self.reference_model_obj.number_of_gestations != '1':
            actions = [CaregiverOffStudyAction]
        else:
            self.delete_if_new(CaregiverOffStudyAction)
        return actions


class MaternalCovidScreeningAction(Action):
    name = MATERNAL_COVID_SCREENING_ACTION
    display_name = 'Update Maternal Covid Screening Test Results'
    reference_model = 'flourish_caregiver.maternalcovidscreening'
    admin_site_name = 'flourish_caregiver_admin'
    priority = HIGH_PRIORITY

    def close_action_item_on_save(self):
        """Returns True if action item for \'action_identifier\'
        is to be closed on post_save.
        """
        return self.reference_model_obj.covid_results != 'pending'


site_action_items.register(CaregiverLocatorAction)
site_action_items.register(MaternalUltrasoundAction)
示例#9
0
    def get_next_actions(self):
        actions = []
        trainee_deathreport_cls = django_apps.get_model(
            'trainee_prn.deathreport')

        subject_identifier = self.reference_model_obj.subject_identifier
        try:
            trainee_deathreport_cls.objects.get(
                subject_identifier=subject_identifier)
            actions = [SubjectOffStudyAction]
        except ObjectDoesNotExist:
            pass
        return actions


class SubjectOffStudyAction(Action):

    name = SUBJECT_OFFSTUDY_ACTION
    display_name = 'Submit Subject Offstudy'
    reference_model = 'trainee_prn.subjectoffstudy'
    show_link_to_changelist = True
    show_link_to_add = True
    admin_site_name = 'trainee_prn_admin'
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(DeathReportAction)
site_action_items.register(SubjectOffStudyAction)
示例#10
0
from edc_action_item import Action, site_action_items
from edc_constants.constants import HIGH_PRIORITY

from .constants import RECONSENT_ACTION


class ReconsentAction(Action):
    name = RECONSENT_ACTION
    display_name = "Re-consent participant"
    reference_model = "mapitio_consent.subjectreconsent"
    priority = HIGH_PRIORITY
    show_on_dashboard = True
    show_link_to_changelist = True
    admin_site_name = "mapitio_consent_admin"
    create_by_user = False
    singleton = True
    instructions = (
        "Participant must be re-consented as soon as able. "
        "Participant's ICF was initially completed by next-of-kin.")

    def reopen_action_item_on_change(self):
        return False


site_action_items.register(ReconsentAction)
示例#11
0
    display_name = 'Submit Maternal Delivery'
    reference_model = 'td_maternal.maternallabourdel'
    admin_site_name = 'td_maternal_admin'
    priority = HIGH_PRIORITY

    def get_next_actions(self):
        actions = []
        if self.reference_model_obj.live_infants_to_register != 1:
            actions = [MaternalOffStudyAction]
        return actions


class MaternalCovidScreeningAction(Action):
    name = MATERNAL_COVID_SCREENING_ACTION
    display_name = 'Update Maternal Covid Screening Test Results'
    reference_model = 'td_maternal.maternalcovidscreening'
    admin_site_name = 'td_maternal_admin'
    priority = HIGH_PRIORITY

    def close_action_item_on_save(self):
        """Returns True if action item for \'action_identifier\'
        is to be closed on post_save.
        """
        return self.reference_model_obj.covid_results != 'pending'


site_action_items.register(MaternalCovidScreeningAction)
site_action_items.register(MaternalLabourDeliveryAction)
site_action_items.register(MaternalLocatorAction)
site_action_items.register(MaternalUltrasoundAction)
示例#12
0
from edc_action_item import Action, site_action_items, HIGH_PRIORITY

CHILDCONTINUEDCONSENT_STUDY_ACTION = 'submit-childcontinuedconsent-study'

CHILDASSENT_ACTION = 'submit-childassent'


class ChildContinuedConsentAction(Action):
    name = CHILDCONTINUEDCONSENT_STUDY_ACTION
    display_name = 'Submit Child Continued Consent'
    reference_model = 'flourish_child.childcontinuedconsent'
    admin_site_name = 'flourish_child_admin'
    priority = HIGH_PRIORITY
    singleton = True


class ChildAssentAction(Action):
    name = CHILDASSENT_ACTION
    display_name = 'Submit Child Assent'
    reference_model = 'flourish_child.childassent'
    admin_site_name = 'flourish_child_admin'
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(ChildContinuedConsentAction)
site_action_items.register(ChildAssentAction)
示例#13
0
class BaseBloodResultsAction(Action):
    name = None
    display_name = None
    reference_model = None

    priority = HIGH_PRIORITY
    show_on_dashboard = True
    create_by_user = False

    def reopen_action_item_on_change(self):
        return False

    def get_next_actions(self):
        next_actions = []
        if (self.reference_obj.results_abnormal == YES
                and self.reference_obj.results_reportable == YES
                and not is_baseline(self.reference_obj_has_changed)):
            # AE for reportable result, though not on DAY1.0
            next_actions = [AE_INITIAL_ACTION]
        return next_actions


class BloodResultsLipidAction(BaseBloodResultsAction):
    name = BLOOD_RESULTS_LIPID_ACTION
    display_name = "Reportable result: LIPIDS"
    reference_model = "mocca_subject.bloodresultslipid"


site_action_items.register(BloodResultsLipidAction)
site_action_items.register(SubjectVisitMissedAction)
示例#14
0
        action_item_cls = django_apps.get_model(
            'edc_action_item.actionitem')

        subject_identifier = self.reference_model_obj.subject_identifier
        offstudy = action_item_cls.objects.filter(
            subject_identifier=subject_identifier,
            action_type__name=CAREGIVEROFF_STUDY_ACTION)
        try:
            caregiver_deathreport_cls.objects.get(
                subject_identifier=subject_identifier)
            if not offstudy:
                actions = [CaregiverOffStudyAction]
        except ObjectDoesNotExist:
            pass
        return actions


class ChildDeathReportAction(Action):
    name = CHILD_DEATH_REPORT_ACTION
    display_name = 'Submit Child Death Report'
    reference_model = 'flourish_prn.childdeathreport'
    admin_site_name = 'flourish_prn_admin'
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(CaregiverOffStudyAction)
site_action_items.register(ChildOffStudyAction)
site_action_items.register(CaregiverDeathReportAction)
site_action_items.register(ChildDeathReportAction)
示例#15
0
    name = STUDY_TERMINATION_CONCLUSION_ACTION_W10
    display_name = "Submit W10 Study Termination/Conclusion Report"
    notification_display_name = "W10 Study Termination/Conclusion Report"
    parent_action_names = [DEATH_REPORT_ACTION]
    reference_model = "ambition_prn.studyterminationconclusionw10"
    show_link_to_changelist = True
    admin_site_name = "ambition_prn_admin"
    priority = HIGH_PRIORITY


class ProtocolDeviationViolationAction(BaseProtocolDeviationViolationAction):
    reference_model = "ambition_prn.protocoldeviationviolation"
    admin_site_name = "ambition_prn_admin"


site_action_items.register(ProtocolDeviationViolationAction)
site_action_items.register(StudyTerminationConclusionAction)
site_action_items.register(StudyTerminationConclusionW10Action)

# class DeathReportAction(ActionWithNotification):
#     name = DEATH_REPORT_ACTION
#     display_name = "Submit Death Report"
#     notification_display_name = "Death Report"
#     reference_model = "ambition_prn.deathreport"
#     parent_action_names = [AE_INITIAL_ACTION, AE_FOLLOWUP_ACTION]
#     show_link_to_changelist = True
#     show_link_to_add = True
#     admin_site_name = "ambition_prn_admin"
#     priority = HIGH_PRIORITY
#     singleton = True
#     dirty_fields = ["cause_of_death"]
示例#16
0
                         f"action_item_display_name.html")
        title = getattr(self.reference_obj, "title", "")
        visit_schedule = getattr(self.reference_obj, "visit_schedule", "")
        modified = getattr(self.reference_obj, "modified", None)
        auto = "auto" if getattr(self.reference_obj, "rule_generated",
                                 False) else ""
        try:
            query_priority = self.reference_obj.get_query_priority_display()
        except AttributeError:
            query_priority = NORMAL
        context = dict(
            HIGH_PRIORITY=HIGH_PRIORITY,
            auto=auto,
            category=self.get_category(),
            modified=modified,
            object=self.reference_obj,
            query_priority=query_priority,
            title=title,
            utcnow=get_utcnow(),
            visit_schedule=visit_schedule,
        )
        form_and_numbers_to_string = getattr(self.reference_obj,
                                             "form_and_numbers_to_string",
                                             None)
        if form_and_numbers_to_string:
            context.update(form_and_numbers=form_and_numbers_to_string())
        return render_to_string(template_name, context=context)


site_action_items.register(DataQueryAction)
示例#17
0
            action_cls=site_action_items.get(DEATH_REPORT_ACTION),
            required=deceased)
        # add next AeTmgAction if G4
        next_actions = self.append_to_next_if_required(
            next_actions=next_actions,
            action_cls=AeTmgAction,
            required=self.model_obj.ae_grade == GRADE4)
        # add next Recurrence of Symptoms if YES
        next_actions = self.append_to_next_if_required(
            next_actions=next_actions,
            action_cls=site_action_items.get(RECURRENCE_OF_SYMPTOMS_ACTION),
            required=self.model_obj.ae_cm_recurrence == YES)
        return next_actions


class RecurrenceOfSymptomsAction(Action):
    name = RECURRENCE_OF_SYMPTOMS_ACTION
    display_name = 'Submit Recurrence of Symptoms Report'
    model = 'ambition_ae.recurrencesymptom'
    show_link_to_changelist = True
    admin_site_name = 'ambition_ae_admin'
    priority = HIGH_PRIORITY
    create_by_user = False
    help_text = 'This document is triggered by AE Initial'


site_action_items.register(AeInitialAction)
site_action_items.register(AeTmgAction)
site_action_items.register(AeFollowupAction)
site_action_items.register(RecurrenceOfSymptomsAction)
示例#18
0
from edc_action_item import Action, site_action_items, HIGH_PRIORITY

from edc_locator.action_items import SubjectLocatorAction

MATERNALOFF_STUDY_ACTION = 'submit-caregiver-study'
PRE_FLOURISH_CAREGIVER_LOCATOR_ACTION = 'pre-flourish-submit-caregiver-locator'


class MaternalOffStudyAction(Action):
    name = MATERNALOFF_STUDY_ACTION
    display_name = 'Submit Caregiver Offstudy'
    reference_model = 'pre_flourish.maternaloffstudy'
    admin_site_name = 'pre_flourish_admin'
    priority = HIGH_PRIORITY
    singleton = True


class PreFlourishCaregiverLocatorAction(SubjectLocatorAction):
    name = PRE_FLOURISH_CAREGIVER_LOCATOR_ACTION
    display_name = 'Submit Pre Flourish Caregiver Locator'
    reference_model = 'pre_flourish.preflourishcaregiverlocator'
    admin_site_name = 'pre_flourish_admin'


site_action_items.register(PreFlourishCaregiverLocatorAction)
示例#19
0
)
from edc_adverse_event.constants import (
    AE_FOLLOWUP_ACTION,
    DEATH_REPORT_ACTION,
    STUDY_TERMINATION_CONCLUSION_ACTION,
)


class StudyTerminationConclusionAction(ActionWithNotification):
    name = STUDY_TERMINATION_CONCLUSION_ACTION
    display_name = "Submit Study Termination/Conclusion Report"
    notification_display_name = "Study Termination/Conclusion Report"
    parent_action_names = [
        DEATH_REPORT_ACTION,
        AE_FOLLOWUP_ACTION,
    ]
    reference_model = "adverse_event_app.studyterminationconclusion"
    show_link_to_changelist = True
    admin_site_name = "adverse_event_app_admin"
    priority = HIGH_PRIORITY


site_action_items.register(AeFollowupAction)
site_action_items.register(AeInitialAction)
site_action_items.register(AeSusarAction)
site_action_items.register(AeTmgAction)
site_action_items.register(DeathReportAction)
site_action_items.register(DeathReportTmgAction)
site_action_items.register(DeathReportTmgSecondAction)
site_action_items.register(StudyTerminationConclusionAction)
示例#20
0
from edc_locator.action_items import SubjectLocatorAction as BaseSubjectLocatorAction

from edc_action_item import site_action_items

SUBJECT_LOCATOR_ACTION = 'submit-trainee-subject-locator'


class TraineeSubjectLocatorAction(BaseSubjectLocatorAction):
    name = SUBJECT_LOCATOR_ACTION
    display_name = 'Submit Subject Locator'
    reference_model = 'trainee_subject.subjectlocator'
    admin_site_name = 'trainee_subject_admin'


site_action_items.register(TraineeSubjectLocatorAction)
示例#21
0
        action_item_cls = django_apps.get_model('edc_action_item.actionitem')

        subject_identifier = self.reference_model_obj.subject_identifier
        offstudy = action_item_cls.objects.filter(
            subject_identifier=subject_identifier,
            action_type__name='submit-maternaloff-study')
        try:
            maternal_deathreport_cls.objects.get(
                subject_identifier=subject_identifier)
            if not offstudy:
                actions = [MaternalOffStudyAction]
        except ObjectDoesNotExist:
            pass
        return actions


class InfantDeathReportAction(Action):
    name = INFANT_DEATH_REPORT_ACTION
    display_name = 'Submit Infant Death Report'
    reference_model = 'td_prn.infantdeathreport'
    admin_site_name = 'td_prn_admin'
    priority = HIGH_PRIORITY
    singleton = True


site_action_items.register(MaternalDeathReportAction)
site_action_items.register(MaternalOffStudyAction)
site_action_items.register(InfantDeathReportAction)
site_action_items.register(InfantOffStudyAction)
示例#22
0
from edc_action_item import Action, site_action_items
from edc_constants.constants import HIGH_PRIORITY

from .constants import PRESCRIPTION_ACTION


class PrescriptionAction(Action):
    name = PRESCRIPTION_ACTION
    display_name = "New prescription"
    reference_model = "edc_pharmacy.rx"
    priority = HIGH_PRIORITY
    show_on_dashboard = True
    show_link_to_changelist = True
    admin_site_name = "edc_pharmacy_admin"
    create_by_user = False
    singleton = True
    instructions = (
        "This prescription will cover the participant for the period on study. "
        "All refills are written against this prescription.")

    def reopen_action_item_on_change(self):
        return False


site_action_items.register(PrescriptionAction)
            # early withdrawal if qualifying blood results
            # are abnormal on DAY1
            evaluator = EarlyWithdrawalEvaluator(
                subject_identifier=self.model_obj.subject_identifier)
            if not evaluator.eligible:
                actions = [StudyTerminationConclusionAction]
        elif (self.model_obj.results_abnormal == YES
              and self.model_obj.results_reportable == YES):
            # AE for reportable result, not on DAY1
            actions = [AeInitialAction]
        return actions


class ReconsentAction(Action):
    name = RECONSENT_ACTION
    display_name = 'Re-consent participant'
    model = 'ambition_subject.subjectreconsent'
    priority = HIGH_PRIORITY
    show_on_dashboard = True
    show_link_to_changelist = True
    admin_site_name = 'ambition_subject_admin'
    create_by_user = False
    singleton = True
    instructions = (
        'Participant must be re-consented as soon as able. '
        'Participant\'s ICF was initially completed by next-of-kin.')


site_action_items.register(BloodResultAction)
site_action_items.register(ReconsentAction)
 def setUp(self):
     site_action_items.registry = {}
     site_action_items.register(CrfLongitudinalOneAction)
     site_action_items.register(CrfLongitudinalTwoAction)
     self.subject_identifier = self.enroll()