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)
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" })
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)
from edc_visit_schedule import Schedule from ..caregiver_visits.cohort_b_visits import visit3000 # Enrollment Schedules b_fu1_schedule_1 = Schedule( name='b_fu1_schedule1', sequence='3', verbose_name='Cohort B(First Child(ren)) Follow Up Schedule', onschedule_model='flourish_caregiver.onschedulecohortbfu', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_fu1_schedule_1.add_visit(visit=visit3000) b_fu2_schedule_1 = Schedule( name='b_fu2_schedule1', sequence='3', verbose_name='Cohort B(Second Child(ren)) Follow Up Schedule', onschedule_model='flourish_caregiver.onschedulecohortbfu', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_fu2_schedule_1.add_visit(visit=visit3000) b_fu3_schedule_1 = Schedule( name='b_fu3_schedule1', sequence='3', verbose_name='Cohort B(Third Child(ren)) Follow Up Schedule',
visit2 = Visit( 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)
**kwargs): super().__init__(allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or maternal_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn, **kwargs) # TODO: Lab Requisitions for visits. antenatal_schedule_3 = Schedule( name='antenatal_schedule_3', verbose_name='Antenatal Visits V3', onschedule_model='td_maternal.onscheduleantenatalenrollment', offschedule_model='td_maternal.maternaloffschedule', consent_model='td_maternal.subjectconsent', appointment_model='edc_appointment.appointment') visit1000 = Visit(code='1000M', title='Antenatal Enrollment V3', timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=None, crfs=crf_1000, facility_name='5-day clinic') antenatal_schedule_3.add_visit(visit=visit1000)
from edc_visit_schedule import Schedule from ..caregiver_visits.cohort_b_visits import visit2000 from .quarterly_schedules import b_quarterly1_schedule_1 # Secondary Aims Schedules b_sec1_schedule_1 = Schedule( name='b_sec1_schedule1', sequence='1', verbose_name='Cohort B(First Child(ren)) Secondary Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortbsec', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_sec2_schedule_1 = Schedule( name='b_sec2_schedule1', sequence='1', verbose_name='Cohort B(Second Child(ren)) Secondary Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortbsec', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_sec3_schedule_1 = Schedule( name='b_sec3_schedule1', sequence='1', verbose_name='Cohort B(Third Child(ren)) Secondary Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortbsec', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent',
from edc_visit_schedule import Schedule from ....crfs import crf_2001, caregiver_crfs_prn from ...schedule_helper import ScheduleHelper from ..caregiver_visits.cohort_b_visits import visit3001 # Quarterly Schedules b_fu_quarterly1_schedule_1 = Schedule( name='b_fu_quarterly1_schedule1', sequence='4', verbose_name='Cohort B(First Child(ren)) FU Quarterly Schedule', onschedule_model='flourish_caregiver.onschedulecohortbfu', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_fu_quarterly2_schedule_1 = Schedule( name='b_fu_quarterly2_schedule1', sequence='4', verbose_name='Cohort B(Second Child(ren)) FU Quarterly Schedule', onschedule_model='flourish_caregiver.onschedulecohortbfu', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_fu_quarterly3_schedule_1 = Schedule( name='b_fu_quarterly3_schedule1', sequence='4', verbose_name='Cohort B(Third Child(ren)) FU Quarterly Schedule', onschedule_model='flourish_caregiver.onschedulecohortbfu', offschedule_model='flourish_caregiver.caregiveroffschedule',
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
from dateutil.relativedelta import relativedelta from edc_visit_schedule import Schedule, Visit from .requisitions import requisitions from .crfs import crfs schedule1 = Schedule( name='schedule1', title='Bcpp Clinic', enrollment_model='bcpp_clinic_subject.enrollment', disenrollment_model='bcpp_clinic_subject.disenrollment',) visit0 = Visit( code='C0', title='Clinic Subject Survey', timepoint=0, rbase=relativedelta(years=0), rlower=relativedelta(years=0), rupper=relativedelta(years=6), requisitions=requisitions, crfs=crfs) schedule1.add_visit(visit=visit0)
allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn or default_crfs_prn, requisitions_prn=requisitions_prn, # or default_requisitions_prn, crfs_missed=crfs_missed, **kwargs, ) # schedule for new participants schedule = Schedule( name=SCHEDULE, verbose_name="Day 1 to Month 12", onschedule_model="mocca_prn.onschedule", offschedule_model="mocca_prn.offschedule", consent_model="mocca_consent.subjectconsent", appointment_model="edc_appointment.appointment", loss_to_followup_model="mocca_prn.losstofollowup", ) visit00 = Visit( code=DAY1, title="Day 1", timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_d1, requisitions_prn=requisitions_prn, crfs=crfs_d1,
super().__init__( allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled, # or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, # or default_crfs_prn, requisitions_prn=requisitions_prn, # or default_requisitions_prn, **kwargs) # schedule for new participants schedule = Schedule( name="schedule", verbose_name="History and Follow-up", onschedule_model="mapitio_prn.onschedule", offschedule_model="mapitio_prn.endofstudy", consent_model="mapitio_consent.subjectconsent", appointment_model="edc_appointment.appointment", ) visit00 = Visit( code=DAY1, title="Day 1", timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_d1, crfs=crfs_d1, facility_name="7-day-clinic", )
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", ) schedule1 = Schedule( name="schedule1", onschedule_model="edc_appointment.onscheduleone", offschedule_model="edc_appointment.offscheduleone", appointment_model="edc_appointment.appointment", consent_model="edc_appointment.subjectconsent", ) schedule2 = Schedule( name="schedule2", onschedule_model="edc_appointment.onscheduletwo", offschedule_model="edc_appointment.offscheduletwo", appointment_model="edc_appointment.appointment", consent_model="edc_appointment.subjectconsent", ) schedule3 = Schedule( name="three_monthly_schedule", onschedule_model="edc_appointment.onschedulethree",
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( name='schedule2', onschedule_model='edc_visit_tracking.onscheduletwo', offschedule_model='edc_visit_tracking.offscheduletwo', consent_model='edc_visit_tracking.subjectconsent', appointment_model='edc_appointment.appointment') visits = [] for index in range(0, 4): visits.append( Visit(
from edc_visit_schedule import Schedule from ..caregiver_visits.cohort_b_visits import visit2000 # Enrollment Schedules b_enrollment1_schedule_1 = Schedule( name='b_enrol1_schedule1', sequence='1', verbose_name='Cohort B(First Child(ren)) Enrollment Schedule', onschedule_model='flourish_caregiver.onschedulecohortbenrollment', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_enrollment1_schedule_1.add_visit(visit=visit2000) b_enrollment2_schedule_1 = Schedule( name='b_enrol2_schedule1', sequence='1', verbose_name='Cohort B(Second Child(ren)) Enrollment Schedule', onschedule_model='flourish_caregiver.onschedulecohortbenrollment', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') b_enrollment2_schedule_1.add_visit(visit=visit2000) b_enrollment3_schedule_1 = Schedule( name='b_enrol3_schedule1', sequence='1', verbose_name='Cohort B(Third Child(ren)) Enrollment Schedule', onschedule_model='flourish_caregiver.onschedulecohortbenrollment',
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)
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)
if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn or default_crfs_prn, requisitions_prn=requisitions_prn or default_requisitions_prn, **kwargs) # schedule for new participants schedule = Schedule( name=SCHEDULE, verbose_name="Day 1 to Week 16 Follow-up", onschedule_model="ambition_prn.onschedule", offschedule_model="ambition_prn.studyterminationconclusion", consent_model="ambition_subject.subjectconsent", appointment_model="edc_appointment.appointment", ) visit0 = Visit( code=DAY1, title="Day 1", timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_d1, crfs=crfs_d1, requisitions_prn=FormsCollection( *[r for r in default_requisitions_prn if r.panel != chemistry_panel]),
super().__init__(allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or infant_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn or infant_requisitions_prn, **kwargs) infant_schedule_v1 = Schedule( name='infant_schedule_v1', verbose_name='Day 1 to 36 months Follow-up V1', onschedule_model='td_infant.onscheduleinfantbirth', offschedule_model='td_infant.infantoffschedule', consent_model='td_infant.infantdummysubjectconsent', appointment_model='td_infant.appointment') visit2000 = Visit(code='2000', title='Birth V1', timepoint=0, rbase=relativedelta(months=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=infant_birth_requisitions, crfs=infant_crf_2000, facility_name='5-day clinic') visit2010 = Visit(code='2010',
if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or maternal_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn or default_requisitions_prn, **kwargs) # TODO: Add PRN for visits. maternal_labour_del_schedule_v3 = Schedule( name='mld_schedule_3', verbose_name='Day 1 to 36 months Follow-up V3', onschedule_model='td_maternal.onschedulematernallabourdel', offschedule_model='td_maternal.maternaloffschedule', consent_model='td_maternal.subjectconsent', appointment_model='edc_appointment.appointment') visit2000 = Visit(code='2000M', title='Delivery Visit V3', timepoint=30, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_followup, crfs=crf_2000, facility_name='5-day clinic') visit2010 = Visit(code='2010M',
**kwargs): super().__init__(allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or child_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn, **kwargs) # Enrollment Schedule child_c_enrollment_schedule_1 = Schedule( name='child_c_enrol_schedule1', sequence='1', verbose_name='Cohort C Child Enrollment Schedule', onschedule_model='flourish_child.onschedulechildcohortcenrollment', offschedule_model='flourish_child.childoffschedule', consent_model='flourish_child.childdummysubjectconsent', appointment_model='flourish_child.appointment') visit2000 = Visit(code='2000', title='Cohort C Child Enrollment Visit', timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(months=3), requisitions=None, crfs=child_c_crf_2000, facility_name='5-day clinic') child_c_enrollment_schedule_1.add_visit(visit=visit2000)
**kwargs): super().__init__(allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or child_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn, **kwargs) # Enrollment Schedule child_a_enrollment_schedule_1 = Schedule( name='child_a_enrol_schedule1', sequence='1', verbose_name='Cohort A Child Enrollment Schedule', onschedule_model='flourish_child.onschedulechildcohortaenrollment', offschedule_model='flourish_child.childoffschedule', consent_model='flourish_child.childdummysubjectconsent', appointment_model='flourish_child.appointment') visit2000 = Visit(code='2000', title='Cohort A Child Enrollment Visit', timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(months=3), requisitions=None, crfs=child_a_crf_2000, facility_name='5-day clinic') child_a_enrollment_schedule_1.add_visit(visit=visit2000)
from dateutil.relativedelta import relativedelta from edc_visit_schedule import Schedule, Visit from .crfs import crf from .requisitions import requisitions # schedule for new participants pre_flourish_schedule = Schedule( name='pre_flourish_schedule', verbose_name='Pre Flourish Schedule', onschedule_model='pre_flourish.onschedulepreflourish', offschedule_model='pre_flourish.preflourishoffstudy', consent_model='pre_flourish.preflourishconsent', appointment_model='edc_appointment.appointment') visit0 = Visit(code='1000', title='Enrollment Visit', timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions, crfs=crf.get(1000), facility_name='5-day clinic') pre_flourish_schedule.add_visit(visit=visit0)
super().__init__( allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled, # or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, # or default_crfs_prn, requisitions_prn=requisitions_prn, # or default_requisitions_prn, **kwargs) # schedule for new participants schedule = Schedule( name=SCHEDULE, verbose_name="Day 1 to Month 12 Follow-up", onschedule_model="inte_prn.onschedule", offschedule_model="inte_prn.endofstudy", consent_model="inte_consent.subjectconsent", appointment_model="edc_appointment.appointment", ) visit00 = Visit( code=DAY1, title="Day 1", timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_d1, crfs=crfs_d1, facility_name="7-day-clinic", )
from edc_visit_schedule import Schedule from .quarterly_schedules import a_quarterly1_schedule_1 # secondary Aims Schedules a_sec_quart1_schedule_1 = Schedule( name='a_sec_quart1_schedule1', sequence='1', verbose_name='Cohort A(First Child(ren)) Sec Quarterly Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortasecquart', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') a_sec_quart2_schedule_1 = Schedule( name='a_sec_quart2_schedule1', sequence='1', verbose_name='Cohort A(Second Child(ren)) Sec Quarterly Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortasecquart', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment') a_sec_quart3_schedule_1 = Schedule( name='a_sec_quart3_schedule1', sequence='1', verbose_name='Cohort A(Third Child(ren)) Sec Quarterly Aims Schedule', onschedule_model='flourish_caregiver.onschedulecohortasecquart', offschedule_model='flourish_caregiver.caregiveroffschedule', consent_model='flourish_caregiver.subjectconsent', appointment_model='edc_appointment.appointment')
if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn or default_crfs_prn, requisitions_prn=requisitions_prn or default_requisitions_prn, **kwargs) # schedule for new participants schedule = Schedule( name='schedule', verbose_name='Day 1 to Week 16 Follow-up', onschedule_model='ambition_prn.onschedule', offschedule_model='ambition_prn.studyterminationconclusion', consent_model='ambition_subject.subjectconsent', appointment_model='edc_appointment.appointment') visit0 = Visit( code=DAY1, title='Day 1', timepoint=0, rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_d1, crfs=crfs_d1, requisitions_prn=FormsCollection( *[r for r in default_requisitions_prn if r.panel != chemistry_panel]),
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()
crfs_prn=None, requisitions_prn=None, allow_unscheduled=None, **kwargs): super().__init__( allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled or maternal_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, requisitions_prn=requisitions_prn or default_requisitions_prn, **kwargs) # TODO: Add PRN for visits. antenatal_membership_schedule_1 = Schedule( name='anv_membership_v1', verbose_name='Antenatal Visit Membership v1', onschedule_model='td_maternal.onscheduleantenatalvisitmembership', offschedule_model='td_maternal.maternaloffschedule', consent_model='td_maternal.subjectconsent', appointment_model='edc_appointment.appointment') visit1010 = Visit( code='1010M', title='Antenatal Visit 1', timepoint=5, rbase=relativedelta(days=1), rlower=relativedelta(days=0), rupper=relativedelta(days=0), requisitions=requisitions_1010m, crfs=crf_1010, facility_name='5-day clinic')
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)
crfs_unscheduled=crfs_unscheduled or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn or default_crfs_prn, requisitions_prn=requisitions_prn, # or default_requisitions_prn, crfs_missed=crfs_missed, **kwargs, ) # schedule for new participants schedule_hiv = Schedule( name=SCHEDULE_HIV, verbose_name="Day 1 to Month 12", onschedule_model="inte_prn.onschedulehiv", offschedule_model="inte_prn.offschedulehiv", consent_model="inte_consent.subjectconsent", appointment_model="edc_appointment.appointment", loss_to_followup_model="inte_prn.losstofollowup", ) schedule_ncd = Schedule( name=SCHEDULE_NCD, verbose_name="Day 1 to Month 12", onschedule_model="inte_prn.onschedulencd", offschedule_model="inte_prn.offschedulencd", consent_model="inte_consent.subjectconsent", appointment_model="edc_appointment.appointment", loss_to_followup_model="inte_prn.losstofollowup", )
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), rlower=relativedelta(days=0), rupper=relativedelta(days=6), crfs=crfs,
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", appointment_model="edc_appointment.appointment", ) schedule2 = Schedule( name="schedule2", onschedule_model="edc_visit_tracking.onscheduletwo", offschedule_model="edc_visit_tracking.offscheduletwo", consent_model="edc_visit_tracking.subjectconsent", appointment_model="edc_appointment.appointment", ) visits = [] for index in range(0, 4): visits.append(
super().__init__( allow_unscheduled=True if allow_unscheduled is None else allow_unscheduled, crfs_unscheduled=crfs_unscheduled, # or default_crfs_unscheduled, requisitions_unscheduled=requisitions_unscheduled or default_requisitions, crfs_prn=crfs_prn, # or default_crfs_prn, requisitions_prn=requisitions_prn, # or default_requisitions_prn, **kwargs) # schedule for new participants schedule_hiv = Schedule( name=SCHEDULE_HIV, verbose_name="Day 1 to Month 12 HIV Follow-up", onschedule_model="inte_prn.onschedulehiv", offschedule_model="inte_prn.endofstudy", consent_model="inte_consent.subjectconsent", appointment_model="edc_appointment.appointment", ) schedule_ncd = Schedule( name=SCHEDULE_NCD, verbose_name="Day 1 to Month 12 NCD Follow-up", onschedule_model="inte_prn.onschedulencd", offschedule_model="inte_prn.endofstudy", consent_model="inte_consent.subjectconsent", appointment_model="edc_appointment.appointment", ) visit00 = Visit( code=DAY1,