def register_new_visit_schedule(crfs):
        site_visit_schedules._registry = {}
        site_visit_schedules.loaded = False

        visit = Visit(
            code="1000",
            title="Week 1",
            timepoint=0,
            rbase=relativedelta(days=0),
            rlower=relativedelta(days=0),
            rupper=relativedelta(days=6),
            crfs=crfs,
            allow_unscheduled=True,
            facility_name="5-day-clinic",
        )
        schedule = Schedule(
            name="schedule",
            onschedule_model="edc_metadata.onschedule",
            offschedule_model="edc_metadata.offschedule",
            consent_model="edc_metadata.subjectconsent",
            appointment_model="edc_appointment.appointment",
        )
        schedule.add_visit(visit)
        new_visit_schedule = VisitSchedule(
            name="visit_schedule",
            offstudy_model="edc_metadata.subjectoffstudy",
            death_report_model="edc_metadata.deathreport",
        )
        new_visit_schedule.add_schedule(schedule)
        site_visit_schedules.register(new_visit_schedule)
Ejemplo n.º 2
0
    def setUp(self):
        load_list_data(
            list_data=list_data,
            model_name="edc_visit_tracking.subjectvisitmissedreasons",
        )
        self.subject_identifier = "12345"
        self.helper = self.helper_cls(
            subject_identifier=self.subject_identifier)
        crfs = FormsCollection(
            Crf(show_order=1, model="edc_metadata.crfone", required=True),
            Crf(show_order=2, model="edc_metadata.crftwo", required=True),
            Crf(show_order=3, model="edc_metadata.crfthree", required=True),
            Crf(show_order=4, model="edc_metadata.crffour", required=True),
            Crf(show_order=5, model="edc_metadata.crffive", required=True),
        )
        crfs_missed = FormsCollection(
            Crf(
                show_order=1,
                model="edc_visit_tracking.subjectvisitmissed",
                required=True,
            ), )

        visit_schedule1 = VisitSchedule(
            name="visit_schedule1",
            offstudy_model="edc_visit_tracking.subjectoffstudy",
            death_report_model="edc_visit_tracking.deathreport",
            locator_model="edc_locator.subjectlocator",
        )
        schedule1 = Schedule(
            name="schedule1",
            onschedule_model="edc_visit_tracking.onscheduleone",
            offschedule_model="edc_visit_tracking.offscheduleone",
            consent_model="edc_visit_tracking.subjectconsent",
            appointment_model="edc_appointment.appointment",
        )
        visits = []
        for index in range(0, 4):
            visits.append(
                Visit(
                    code=f"{index + 1}000",
                    title=f"Day {index + 1}",
                    timepoint=index,
                    rbase=relativedelta(days=index),
                    rlower=relativedelta(days=0),
                    rupper=relativedelta(days=6),
                    requisitions=[],
                    crfs=crfs,
                    crfs_missed=crfs_missed,
                    allow_unscheduled=True,
                ))
        for visit in visits:
            schedule1.add_visit(visit)
        visit_schedule1.add_schedule(schedule1)
        site_visit_schedules._registry = {}
        site_visit_schedules.register(visit_schedule=visit_schedule1)
        site_reference_configs.register_from_visit_schedule(visit_models={
            "edc_appointment.appointment":
            "edc_visit_tracking.subjectvisit"
        })
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from ..schedules import b_enrollment1_schedule_1, b_enrollment2_schedule_1
from ..schedules import b_enrollment3_schedule_1, b_fu1_schedule_1, b_fu2_schedule_1
from ..schedules import b_fu_quarterly1_schedule_1, b_fu_quarterly2_schedule_1
from ..schedules import b_fu_quarterly3_schedule_1, b_sec_quart1_schedule_1
from ..schedules import b_quarterly1_schedule_1, b_quarterly2_schedule_1
from ..schedules import b_quarterly3_schedule_1, b_fu3_schedule_1
from ..schedules import b_sec1_schedule_1, b_sec2_schedule_1, b_sec3_schedule_1
from ..schedules import b_sec_quart2_schedule_1, b_sec_quart3_schedule_1

cohort_b1_visit_schedule_v1 = VisitSchedule(
    name='b1_visit_schedule1',
    verbose_name='Cohort B Visit Schedule',
    offstudy_model='flourish_prn.caregiveroffstudy',
    death_report_model='flourish_prn.caregiverdeathreport',
    locator_model='',
    previous_visit_schedule=None)

cohort_b1_visit_schedule_v1.add_schedule(b_enrollment1_schedule_1)
cohort_b1_visit_schedule_v1.add_schedule(b_quarterly1_schedule_1)
cohort_b1_visit_schedule_v1.add_schedule(b_sec1_schedule_1)
cohort_b1_visit_schedule_v1.add_schedule(b_sec_quart1_schedule_1)
cohort_b1_visit_schedule_v1.add_schedule(b_fu1_schedule_1)
cohort_b1_visit_schedule_v1.add_schedule(b_fu_quarterly1_schedule_1)

cohort_b2_visit_schedule_v1 = VisitSchedule(
    name='b2_visit_schedule1',
    verbose_name='Cohort B2 Visit Schedule',
    offstudy_model='flourish_prn.caregiveroffstudy',
    death_report_model='flourish_prn.caregiverdeathreport',
    facility_name='5-day-clinic')

visit2 = Visit(
    code='3000',
    title='Day 3',
    timepoint=2,
    rbase=relativedelta(days=2),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    requisitions=requisitions3000,
    crfs=crfs2,
    facility_name='5-day-clinic')

schedule = Schedule(
    name='schedule',
    onschedule_model='edc_metadata.onschedule',
    offschedule_model='edc_metadata.offschedule',
    consent_model='edc_metadata.subjectconsent',
    appointment_model='edc_appointment.appointment')

schedule.add_visit(visit0)
schedule.add_visit(visit1)
schedule.add_visit(visit2)

visit_schedule = VisitSchedule(
    name='visit_schedule',
    offstudy_model='edc_metadata.subjectoffstudy',
    death_report_model='edc_metadata.deathreport')

visit_schedule.add_schedule(schedule)
Ejemplo n.º 5
0
visit = Visit(
    code='1000',
    timepoint=0,
    rbase=relativedelta(days=0),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    requisitions=None,
    crfs=crfs,
    requisitions_unscheduled=None,
    crfs_unscheduled=None,
    allow_unscheduled=False,
    facility_name='5-day-clinic')


schedule = Schedule(
    name='schedule1',
    onschedule_model='edc_appointment.onscheduleone',
    offschedule_model='edc_appointment.offscheduleone',
    appointment_model='edc_appointment.appointment',
    consent_model='edc_consent.subjectconsent')

visit_schedule = VisitSchedule(
    name='visit_schedule',
    offstudy_model='edc_appointment.subjectoffstudy',
    death_report_model='edc_appointment.deathreport',
    locator_model='edc_locator.subjectlocator')

schedule.add_visit(visit)

visit_schedule.add_schedule(schedule)
Ejemplo n.º 6
0
                panel=Panel("four"),
                required=True,
                additional=False),
    Requisition(show_order=50,
                panel=Panel("five"),
                required=True,
                additional=False),
    Requisition(show_order=60,
                panel=Panel("six"),
                required=True,
                additional=False),
)

visit_schedule1 = VisitSchedule(
    name="visit_schedule1",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="edc_visit_tracking.deathreport",
    locator_model="edc_locator.subjectlocator",
)

visit_schedule2 = VisitSchedule(
    name="visit_schedule2",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="edc_visit_tracking.deathreport",
    locator_model="edc_locator.subjectlocator",
)

schedule1 = Schedule(
    name="schedule1",
    onschedule_model="edc_visit_tracking.onscheduleone",
    offschedule_model="edc_visit_tracking.offscheduleone",
    consent_model="edc_visit_tracking.subjectconsent",
Ejemplo n.º 7
0
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from .schedule import schedule

VISIT_SCHEDULE = "visit_schedule"

visit_schedule = VisitSchedule(
    name=VISIT_SCHEDULE,
    verbose_name="Mapitio",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="mapitio_ae.deathreport",
    locator_model="edc_locator.subjectlocator",
    previous_visit_schedule=None,
)

visit_schedule.add_schedule(schedule)

site_visit_schedules.register(visit_schedule)
Ejemplo n.º 8
0
    code="3000",
    title="Day 3",
    timepoint=2,
    rbase=relativedelta(days=2),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    requisitions=requisitions2,
    crfs=crfs2,
    facility_name="default",
)

schedule = Schedule(
    name="schedule",
    onschedule_model=f"{app_label}.onschedule",
    offschedule_model=f"{app_label}.offschedule",
    consent_model=f"{app_label}.subjectconsent",
    appointment_model="edc_appointment.appointment",
)

schedule.add_visit(visit0)
schedule.add_visit(visit1)
schedule.add_visit(visit2)

visit_schedule = VisitSchedule(
    name="visit_schedule",
    offstudy_model=f"{app_label}.subjectoffstudy",
    death_report_model=f"{app_label}.deathreport",
)

visit_schedule.add_schedule(schedule)
Ejemplo n.º 9
0
def get_visit_schedule(i=None):

    i = i or 4

    crfs = FormsCollection(
        Crf(show_order=1, model="edc_metadata.crfone", required=True),
        Crf(show_order=2, model="edc_metadata.crftwo", required=True),
        Crf(show_order=3, model="edc_metadata.crfthree", required=True),
        Crf(show_order=4, model="edc_metadata.crffour", required=True),
        Crf(show_order=5, model="edc_metadata.crffive", required=True),
    )

    requisitions = FormsCollection(
        Requisition(show_order=10,
                    panel=Panel("one"),
                    required=True,
                    additional=False),
        Requisition(show_order=20,
                    panel=Panel("two"),
                    required=True,
                    additional=False),
        Requisition(show_order=30,
                    panel=Panel("three"),
                    required=True,
                    additional=False),
        Requisition(show_order=40,
                    panel=Panel("four"),
                    required=True,
                    additional=False),
        Requisition(show_order=50,
                    panel=Panel("five"),
                    required=True,
                    additional=False),
        Requisition(show_order=60,
                    panel=Panel("six"),
                    required=True,
                    additional=False),
    )

    visit_schedule = VisitSchedule(
        name="visit_schedule",
        offstudy_model="edc_offstudy.subjectoffstudy",
        death_report_model="edc_visit_tracking.deathreport",
        locator_model="edc_locator.subjectlocator",
    )

    schedule = Schedule(
        name="schedule",
        onschedule_model="edc_visit_tracking.onscheduleone",
        offschedule_model="edc_visit_tracking.offscheduleone",
        consent_model="edc_visit_tracking.subjectconsent",
        appointment_model="edc_appointment.appointment",
    )

    visits = []
    for index in range(0, i):
        visits.append(
            Visit(
                code=f"{index + 1}000",
                title=f"Day {index + 1}",
                timepoint=index,
                rbase=relativedelta(days=index),
                rlower=relativedelta(days=0),
                rupper=relativedelta(days=6),
                requisitions=requisitions,
                crfs=crfs,
                facility_name="default",
                allow_unscheduled=True,
            ))
    for visit in visits:
        schedule.add_visit(visit)

    visit_schedule.add_schedule(schedule)
    return visit_schedule
Ejemplo n.º 10
0
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from .schedule import schedule
from .schedule_w10 import schedule_w10

VISIT_SCHEDULE = "visit_schedule"
VISIT_SCHEDULE_W10 = "visit_schedule_w10"

visit_schedule = VisitSchedule(
    name=VISIT_SCHEDULE,
    verbose_name="Ambition",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="ambition_ae.deathreport",
    locator_model="edc_locator.subjectlocator",
    previous_visit_schedule=None,
)

visit_schedule.add_schedule(schedule)

visit_schedule_w10 = VisitSchedule(
    name=VISIT_SCHEDULE_W10,
    verbose_name="Ambition W10",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="ambition_ae.deathreport",
    locator_model="edc_locator.subjectlocator",
    previous_visit_schedule=None,
)

visit_schedule_w10.add_schedule(schedule_w10)

site_visit_schedules.register(visit_schedule)
Ejemplo n.º 11
0
from ..schedules import child_a_enrollment_schedule_1, child_a_birth_schedule_1
from ..schedules import child_a_quarterly_schedule_1, child_a_sec_schedule_1
from ..schedules import child_a_sec_qt_schedule_1, child_b_sec_qt_schedule_1
from ..schedules import child_b_enrollment_schedule_1, child_b_quarterly_schedule_1
from ..schedules import child_b_fu_quarterly_schedule_1, child_c_fu_quarterly_schedule_1
from ..schedules import child_b_sec_schedule_1, child_c_enrollment_schedule_1
from ..schedules import child_c_fu_schedule_1, child_a_fu_quarterly_schedule_1
from ..schedules import child_c_quarterly_schedule_1, child_c_sec_schedule_1
from ..schedules import child_c_sec_qt_schedule_1
from ..schedules import child_pool_schedule_1, child_a_fu_schedule_1, child_b_fu_schedule_1

# Cohort Visit Schedules
child_a_visit_schedule_v1 = VisitSchedule(
    name='child_a_visit_schedule_v1',
    verbose_name='Child Cohort A Visit Schedule',
    offstudy_model='flourish_prn.childoffstudy',
    death_report_model='flourish_prn.childdeathreport',
    locator_model='',
    previous_visit_schedule=None)

child_a_visit_schedule_v1.add_schedule(child_a_enrollment_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_birth_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_quarterly_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_sec_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_sec_qt_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_fu_schedule_1)
child_a_visit_schedule_v1.add_schedule(child_a_fu_quarterly_schedule_1)

child_b_visit_schedule_v1 = VisitSchedule(
    name='child_b_visit_schedule_v1',
    verbose_name='Child Cohort B Visit Schedule',
Ejemplo n.º 12
0
from edc_visit_schedule import VisitSchedule, site_visit_schedules

# from ..models import S

from .schedule import pre_flourish_schedule

pre_flourish_visit_schedule = VisitSchedule(
    name='visit_schedule1',
    verbose_name='Pre Flourish Visit Schedule',
    offstudy_model='pre_flourish.preflourishoffstudy',
    locator_model='pre_flourish.preflourishcaregiverlocator',
    death_report_model='pre_flourish.preflourishdeathreport',
    previous_visit_schedule=None)

pre_flourish_visit_schedule.add_schedule(pre_flourish_schedule)

site_visit_schedules.register(pre_flourish_visit_schedule)
Ejemplo n.º 13
0
    timepoint=0,
    rbase=relativedelta(days=0),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    requisitions=None,
    crfs=crfs,
    requisitions_unscheduled=None,
    crfs_unscheduled=None,
    allow_unscheduled=False,
    facility_name="5-day-clinic",
)

schedule = Schedule(
    name="schedule1",
    onschedule_model="edc_appointment.onscheduleone",
    offschedule_model="edc_appointment.offscheduleone",
    appointment_model="edc_appointment.appointment",
    consent_model="edc_consent.subjectconsent",
)

visit_schedule = VisitSchedule(
    name="visit_schedule",
    offstudy_model="edc_appointment.subjectoffstudy",
    death_report_model="edc_appointment.deathreport",
    locator_model="edc_locator.subjectlocator",
)

schedule.add_visit(visit)

visit_schedule.add_schedule(schedule)
        panel=Panel(
            'four', requisition_model='edc_metadata.subjectrequisition'),
        required=True, additional=False),
    Requisition(
        show_order=50,
        panel=Panel(
            'five', requisition_model='edc_metadata.subjectrequisition'),
        required=True, additional=False),
    Requisition(
        show_order=60,
        panel=Panel('six', requisition_model='edc_metadata.subjectrequisition'),
        required=True, additional=False),
)

visit_schedule1 = VisitSchedule(
    name='visit_schedule1',
    offstudy_model='edc_visit_tracking.subjectoffstudy',
    death_report_model='edc_visit_tracking.deathreport')

visit_schedule2 = VisitSchedule(
    name='visit_schedule2',
    offstudy_model='edc_visit_tracking.subjectoffstudy',
    death_report_model='edc_visit_tracking.deathreport')

schedule1 = Schedule(
    name='schedule1',
    onschedule_model='edc_visit_tracking.onscheduleone',
    offschedule_model='edc_visit_tracking.offscheduleone',
    consent_model='edc_visit_tracking.subjectconsent',
    appointment_model='edc_appointment.appointment')

schedule2 = Schedule(
Ejemplo n.º 15
0
from ..schedules import a_enrollment1_schedule_1, a_birth1_schedule_1, a_quarterly1_schedule_1
from ..schedules import a_enrollment2_schedule_1, a_birth2_schedule_1, a_quarterly2_schedule_1
from ..schedules import a_enrollment3_schedule_1, a_birth3_schedule_1, a_quarterly3_schedule_1
from ..schedules import a_fu_quarterly1_schedule_1, a_fu_quarterly2_schedule_1
from ..schedules import a_fu_quarterly3_schedule_1, a_sec_quart1_schedule_1
from ..schedules import a_sec1_schedule_1, a_antenatal1_schedule_1, a_fu1_schedule_1
from ..schedules import a_sec2_schedule_1, a_antenatal2_schedule_1, a_fu2_schedule_1
from ..schedules import a_sec3_schedule_1, a_antenatal3_schedule_1, a_fu3_schedule_1
from ..schedules import a_sec_quart2_schedule_1, a_sec_quart3_schedule_1

# Cohort A Visit Schedules
cohort_a1_visit_schedule_v1 = VisitSchedule(
    name='a1_visit_schedule1',
    verbose_name='Cohort A Visit Schedule',
    offstudy_model='flourish_prn.caregiveroffstudy',
    death_report_model='flourish_prn.caregiverdeathreport',
    locator_model='',
    previous_visit_schedule=None)

cohort_a1_visit_schedule_v1.add_schedule(a_enrollment1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_antenatal1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_birth1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_quarterly1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_sec1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_sec_quart1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_fu1_schedule_1)
cohort_a1_visit_schedule_v1.add_schedule(a_fu_quarterly1_schedule_1)

cohort_a2_visit_schedule_v1 = VisitSchedule(
    name='a2_visit_schedule1',
Ejemplo n.º 16
0
from dateutil.relativedelta import relativedelta
from edc_visit_schedule import Crf, FormsCollection, Schedule, Visit, VisitSchedule

crfs = FormsCollection(
    Crf(show_order=1, model="edc_timepoint.crfone", required=True),
    Crf(show_order=2, model="edc_timepoint.crftwo", required=True),
)

visit_schedule1 = VisitSchedule(
    name="visit_schedule1",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="edc_timepoint.deathreport",
    locator_model="edc_locator.subjectlocator",
)

schedule1 = Schedule(
    name="schedule1",
    onschedule_model="edc_timepoint.onschedule",
    offschedule_model="edc_timepoint.offschedule",
    appointment_model="edc_appointment.appointment",
    consent_model="edc_timepoint.subjectconsent",
)

visits = []
for index in range(0, 4):
    visits.append(
        Visit(
            code=f"{index + 1}000",
            title=f"Day {index + 1}",
            timepoint=index,
            rbase=relativedelta(days=index),
Ejemplo n.º 17
0
                additional=False),
    Requisition(show_order=60,
                panel=panel_six,
                required=True,
                additional=False),
)

crfs_unscheduled = FormsCollection(
    Crf(show_order=1, model="edc_metadata.crfone", required=True),
    Crf(show_order=3, model="edc_metadata.crfthree", required=True),
    Crf(show_order=5, model="edc_metadata.crffive", required=True),
)

visit_schedule1 = VisitSchedule(
    name="visit_schedule1",
    offstudy_model="edc_appointment.subjectoffstudy",
    death_report_model="edc_appointment.deathreport",
    locator_model="edc_appointment.subjectlocator",
)

visit_schedule2 = VisitSchedule(
    name="visit_schedule2",
    offstudy_model="edc_appointment.subjectoffstudy2",
    death_report_model="edc_appointment.deathreport",
    locator_model="edc_appointment.subjectlocator",
)

visit_schedule3 = VisitSchedule(
    name="visit_schedule3",
    offstudy_model="edc_appointment.subjectoffstudy2",
    death_report_model="edc_appointment.deathreport",
    locator_model="edc_appointment.subjectlocator",
Ejemplo n.º 18
0
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from .schedule import schedule1

visit_schedule1 = VisitSchedule(
    name='visit_schedule1',
    verbose_name='Trainee',
    offstudy_model='trainee_prn.subjectoffstudy',
    locator_model='trainee_subject.subject_locator',
    death_report_model='trainee_prn.deathreport',
    previous_visit_schedule=None)

visit_schedule1.add_schedule(schedule1)

site_visit_schedules.register(visit_schedule1)
Ejemplo n.º 19
0
from ..schedules import c_enrollment1_schedule_1, c_quarterly1_schedule_1
from ..schedules import c_enrollment2_schedule_1, c_quarterly2_schedule_1
from ..schedules import c_enrollment3_schedule_1, c_quarterly3_schedule_1
from ..schedules import c_fu1_schedule_1, c_fu2_schedule_1, c_fu3_schedule_1
from ..schedules import c_fu_quarterly1_schedule_1, c_fu_quarterly2_schedule_1
from ..schedules import c_fu_quarterly3_schedule_1, c_sec_quart1_schedule_1
from ..schedules import c_sec1_schedule_1, caregiver_pool1_schedule_1
from ..schedules import c_sec2_schedule_1, caregiver_pool2_schedule_1
from ..schedules import c_sec3_schedule_1, caregiver_pool3_schedule_1
from ..schedules import c_sec_quart2_schedule_1, c_sec_quart3_schedule_1

# Cohort C Visit Schedules
cohort_c1_visit_schedule_v1 = VisitSchedule(
    name='c1_visit_schedule1',
    verbose_name='Cohort C Visit Schedule',
    offstudy_model='flourish_prn.caregiveroffstudy',
    death_report_model='flourish_prn.caregiverdeathreport',
    locator_model='',
    previous_visit_schedule=None)

cohort_c1_visit_schedule_v1.add_schedule(c_enrollment1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(c_quarterly1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(c_sec1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(c_sec_quart1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(caregiver_pool1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(c_fu1_schedule_1)
cohort_c1_visit_schedule_v1.add_schedule(c_fu_quarterly1_schedule_1)

cohort_c2_visit_schedule_v1 = VisitSchedule(
    name='c2_visit_schedule1',
    verbose_name='Cohort C2 Visit Schedule',
Ejemplo n.º 20
0
    title="Day 2",
    timepoint=1,
    rbase=relativedelta(days=1),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    requisitions=None,
    crfs=crfs,
    crfs_unscheduled=None,
    requisitions_unscheduled=None,
    facility_name="7-day-clinic",
)

schedule = Schedule(
    name="schedule",
    onschedule_model="edc_metadata.onschedule",
    offschedule_model="edc_metadata.offschedule",
    consent_model="edc_metadata.subjectconsent",
    appointment_model="edc_appointment.appointment",
)

schedule.add_visit(visit0)
schedule.add_visit(visit1)

visit_schedule = VisitSchedule(
    name="visit_schedule",
    offstudy_model="edc_metadata.subjectoffstudy",
    death_report_model="edc_metadata.deathreport",
)

visit_schedule.add_schedule(schedule)
Ejemplo n.º 21
0
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from .schedules import (antenatal_schedule_1, antenatal_schedule_3,
                        antenatal_membership_schedule_v3,
                        antenatal_membership_schedule_1,
                        maternal_labour_del_schedule_v1,
                        maternal_labour_del_schedule_v3, infant_schedule_v1,
                        infant_schedule_v3)

# Anternatal Visit Schedules

antenatal_visit_schedule_v1 = VisitSchedule(
    name='anv_schedule_v1',
    verbose_name='Antenatal Visit Schedule 1',
    offstudy_model='td_prn.maternaloffstudy',
    death_report_model='td_prn.maternaldeathreport',
    locator_model='td_maternal.maternallocator',
    previous_visit_schedule=None)

antenatal_visit_schedule_v1.add_schedule(antenatal_schedule_1)

antenatal_visit_schedule_v3 = VisitSchedule(
    name='anv_schedule_v3',
    verbose_name='Antenatal Visit Schedule 3',
    offstudy_model='td_prn.maternaloffstudy',
    death_report_model='td_prn.maternaldeathreport',
    locator_model='td_maternal.maternallocator',
    previous_visit_schedule=None)

antenatal_visit_schedule_v3.add_schedule(antenatal_schedule_3)
Ejemplo n.º 22
0
visit1 = Visit(
    code="2000",
    title="Day 2",
    timepoint=1,
    rbase=relativedelta(days=1),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    crfs=crfs,
    facility_name="default",
)

schedule = Schedule(
    name="schedule",
    onschedule_model="edc_visit_schedule.onschedule",
    offschedule_model="edc_visit_schedule.offschedule",
    appointment_model="edc_appointment.appointment",
    consent_model="edc_consent.subjectconsent",
)

schedule.add_visit(visit0)
schedule.add_visit(visit1)

visit_schedule = VisitSchedule(
    name="visit_schedule",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="edc_adverse_event.deathreport",
)

visit_schedule.add_schedule(schedule)
Ejemplo n.º 23
0
    rbase=relativedelta(days=0),
    rlower=relativedelta(days=0),
    rupper=relativedelta(days=6),
    title="Baseline",
    requisitions=None,
    crfs=crfs,
    requisitions_unscheduled=None,
    crfs_unscheduled=None,
    allow_unscheduled=False,
    facility_name="5-day-clinic",
)

schedule = Schedule(
    name="schedule1",
    onschedule_model="adverse_event_app.onschedule",
    offschedule_model="adverse_event_app.StudyTerminationConclusion",
    appointment_model="edc_appointment.appointment",
    consent_model="adverse_event_app.subjectconsent",
)

visit_schedule = VisitSchedule(
    name="visit_schedule",
    offstudy_model="edc_offstudy.subjectoffstudy",
    death_report_model="adverse_event_app.deathreport",
    locator_model="edc_locator.subjectlocator",
)

schedule.add_visit(visit)

visit_schedule.add_schedule(schedule)
from edc_visit_schedule import VisitSchedule, site_visit_schedules

from .schedule import schedule
from .schedule_w10 import schedule_w10

app_label = 'ambition_subject'

visit_schedule = VisitSchedule(
    name='visit_schedule',
    verbose_name='Ambition',
    offstudy_model=f'ambition_prn.studyterminationconclusion',
    death_report_model=f'ambition_prn.deathreport',
    locator_model='edc_locator.subjectlocator',
    previous_visit_schedule=None)

visit_schedule.add_schedule(schedule)

visit_schedule_w10 = VisitSchedule(
    name='visit_schedule_w10',
    verbose_name='Ambition W10',
    offstudy_model=f'ambition_prn.studyterminationconclusion',
    death_report_model=f'ambition_prn.deathreport',
    locator_model='edc_locator.subjectlocator',
    previous_visit_schedule=None)

visit_schedule_w10.add_schedule(schedule_w10)

site_visit_schedules.register(visit_schedule)
site_visit_schedules.register(visit_schedule_w10)
    def setUp(self):
        Appointment.objects.all().delete()
        self.subject_identifier = "12345"
        self.visit_schedule = VisitSchedule(
            name="visit_schedule",
            verbose_name="Visit Schedule",
            offstudy_model="edc_offstudy.subjectoffstudy",
            death_report_model="edc_appointment.deathreport",
        )

        self.schedule = Schedule(
            name="schedule",
            onschedule_model="edc_appointment.onschedule",
            offschedule_model="edc_appointment.offschedule",
            appointment_model="edc_appointment.appointment",
            consent_model="edc_appointment.subjectconsent",
        )

        self.visit1000 = Visit(
            code="1000",
            timepoint=0,
            rbase=relativedelta(days=0),
            rlower=relativedelta(days=0),
            rupper=relativedelta(days=6),
            facility_name="7-day-clinic",
        )

        self.visit1001 = Visit(
            code="1001",
            timepoint=1,
            rbase=relativedelta(days=14),
            rlower=relativedelta(days=1),  # one day before base
            rupper=relativedelta(days=6),
            facility_name="7-day-clinic",
        )

        self.visit1010 = Visit(
            code="1010",
            timepoint=2,
            rbase=relativedelta(days=28),
            rlower=relativedelta(days=6),  # one day before base
            rupper=relativedelta(days=6),
            facility_name="7-day-clinic",
        )
        self.schedule.add_visit(self.visit1000)
        self.schedule.add_visit(self.visit1001)
        self.schedule.add_visit(self.visit1010)
        self.visit_schedule.add_schedule(self.schedule)

        site_visit_schedules._registry = {}
        site_visit_schedules.register(visit_schedule=self.visit_schedule)

        app_config = django_apps.get_app_config("edc_facility")

        class Meta:
            label_lower = ""

        class DummyAppointmentObj:
            subject_identifier = self.subject_identifier
            visit_schedule = self.visit_schedule
            schedule = self.schedule
            facility = app_config.get_facility(name="7-day-clinic")
            _meta = Meta()

        self.model_obj = DummyAppointmentObj()