def setUp(self): v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) import_holidays() site_consents.registry = {} site_consents.register(v1_consent) self.visit_schedule = VisitSchedule( name="visit_schedule", verbose_name="Visit Schedule", offstudy_model="visit_schedule_app.subjectoffstudy", death_report_model="visit_schedule_app.deathreport", ) self.schedule = Schedule( name="schedule", onschedule_model="visit_schedule_app.onschedule", offschedule_model="visit_schedule_app.offschedule", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) visit = Visit( code="1000", rbase=relativedelta(days=0), rlower=relativedelta(days=0), rupper=relativedelta(days=6), timepoint=1, ) self.schedule.add_visit(visit) self.visit_schedule.add_schedule(self.schedule) site_visit_schedules._registry = {} site_visit_schedules.register(self.visit_schedule) site_reference_configs.registry = {} site_reference_configs.register_from_visit_schedule(visit_models={ "edc_appointment.appointment": "visit_schedule_app.subjectvisit" }) self.subject_consent = SubjectConsent.objects.create( subject_identifier="12345", consent_datetime=get_utcnow() - relativedelta(seconds=1), dob=date(1995, 1, 1), identity="11111", confirm_identity="11111", ) self.subject_identifier = self.subject_consent.subject_identifier
def consent_factory(self, **kwargs): options = dict( start=kwargs.get('start'), end=kwargs.get('end'), gender=kwargs.get('gender', [MALE, FEMALE]), updates_versions=kwargs.get('updates_versions', []), version=kwargs.get('version', '1'), age_min=kwargs.get('age_min', 16), age_max=kwargs.get('age_max', 64), age_is_adult=kwargs.get('age_is_adult', 18), ) model = kwargs.get('model', 'bcpp_subject.subjectconsent') consent = Consent(model, **options) site_consents.register(consent) return consent
def setUp(self): import_holidays() v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) site_consents.registry = {} site_consents.register(v1_consent) self.visit_schedule = VisitSchedule( name="visit_schedule", verbose_name="Visit Schedule", offstudy_model="visit_schedule_app.subjectoffstudy", death_report_model="visit_schedule_app.deathreport", ) self.schedule = Schedule( name="schedule", onschedule_model="visit_schedule_app.onschedule", offschedule_model="visit_schedule_app.offschedule", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.schedule2 = Schedule( name="schedule_two", onschedule_model="visit_schedule_app.onscheduletwo", offschedule_model="visit_schedule_app.offscheduletwo", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.schedule3 = Schedule( name="schedule_three", onschedule_model="visit_schedule_app.onschedulethree", offschedule_model="visit_schedule_app.offschedulethree", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", )
def setUp(self): super().setUp() v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) import_holidays() site_reference_configs.register_from_visit_schedule(visit_models={ "edc_appointment.appointment": "visit_schedule_app.subjectvisit" }) site_consents.registry = {} site_consents.register(v1_consent)
def setUp(self): site_visit_schedules.loaded = False site_visit_schedules._registry = {} site_visit_schedules.register(visit_schedule) site_reference_configs.register_from_visit_schedule(visit_models={ "edc_appointment.appointment": "visit_schedule_app.subjectvisit" }) v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) self.subject_identifier = "1234" site_consents.registry = {} site_consents.register(v1_consent)
import arrow from dateutil.tz import gettz from datetime import datetime from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE tzinfo = gettz('Africa/Gaborone') clinic_v1 = Consent( 'bcpp_clinic_subject.subjectconsent', version=3, start=arrow.get( datetime(2013, 10, 18, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get( datetime(2018, 4, 30, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=16, age_is_adult=18, age_max=64, gender=[MALE, FEMALE]) site_consents.register(clinic_v1)
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE from .consent_object_validator import ConsentObjectValidator edc_protocol = django_apps.get_app_config('edc_protocol') caregiver_v1 = Consent( 'flourish_caregiver.subjectconsent', version='1', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE]) # tb_caregiver_v1 = Consent( # 'flourish_caregiver.tbinformedconsent', # version='1', # start=edc_protocol.study_open_datetime, # end=edc_protocol.study_close_datetime, # age_min=18, # age_is_adult=18, # age_max=110, # gender=[FEMALE]) caregiver_v2 = Consent( 'flourish_caregiver.subjectconsent',
from edc_consent.consent import Consent from edc_constants.constants import FEMALE, MALE from edc_protocol import Protocol v1_consent = Consent( "edc_offstudy.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], )
from datetime import datetime import arrow from dateutil.tz import gettz from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE app_config = django_apps.get_app_config('edc_protocol') tzinfo = gettz('Africa/Gaborone') v1 = Consent('trainee_subject.subjectconsent', version='1', start=arrow.get(datetime(2020, 5, 2, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get(datetime(2025, 1, 1, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, age_min=18, age_is_adult=18, age_max=120, gender=[MALE, FEMALE]) site_consents.register(v1)
from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import FEMALE, MALE from edc_protocol import Protocol v1 = Consent( "data_manager_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE], ) site_consents.register(v1)
import arrow from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE from dateutil.relativedelta import relativedelta edc_protocol = django_apps.get_app_config("edc_protocol") v1 = Consent( "adverse_event_app.subjectconsent", version="1", start=arrow.utcnow().floor("hour") - relativedelta(years=1), end=arrow.utcnow().ceil("hour"), age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE], ) site_consents.register(v1)
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE from .consent_object_validator import ConsentObjectValidator edc_protocol = django_apps.get_app_config('edc_protocol') v1 = Consent('flourish_child.childdummysubjectconsent', version='1', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=30, age_is_adult=30, age_max=110, gender=[MALE, FEMALE]) v2 = Consent('flourish_child.childdummysubjectconsent', version='2', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=30, age_is_adult=30, age_max=110, gender=[MALE, FEMALE]) v2_1 = Consent('flourish_child.childdummysubjectconsent', version='2.1', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=30,
def setUp(self): v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) site_consents.registry = {} site_consents.register(v1_consent) site_visit_schedules._registry = {} self.visit_schedule = VisitSchedule( name="visit_schedule", verbose_name="Visit Schedule", offstudy_model="visit_schedule_app.SubjectOffstudy", death_report_model="visit_schedule_app.DeathReport", ) self.schedule = Schedule( name="schedule", onschedule_model="visit_schedule_app.OnSchedule", offschedule_model="visit_schedule_app.OffSchedule", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.schedule3 = Schedule( name="schedule_three", onschedule_model="visit_schedule_app.OnScheduleThree", offschedule_model="visit_schedule_app.OffScheduleThree", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.visit_schedule.add_schedule(self.schedule) self.visit_schedule.add_schedule(self.schedule3) site_visit_schedules.register(self.visit_schedule) self.visit_schedule_two = VisitSchedule( name="visit_schedule_two", verbose_name="Visit Schedule Two", offstudy_model="visit_schedule_app.SubjectOffstudy", death_report_model="visit_schedule_app.DeathReport", ) self.schedule_two_1 = Schedule( name="schedule_two", onschedule_model="visit_schedule_app.OnScheduleTwo", offschedule_model="visit_schedule_app.OffScheduleTwo", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.schedule_two_2 = Schedule( name="schedule_four", onschedule_model="visit_schedule_app.OnScheduleFour", offschedule_model="visit_schedule_app.OffScheduleFour", appointment_model="edc_appointment.appointment", consent_model="visit_schedule_app.subjectconsent", ) self.visit_schedule_two.add_schedule(self.schedule_two_1) self.visit_schedule_two.add_schedule(self.schedule_two_2) site_visit_schedules.register(self.visit_schedule_two) self.subject_identifier = "111111" SubjectConsent.objects.create( subject_identifier=self.subject_identifier)
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE edc_protocol = django_apps.get_app_config('edc_protocol') v1 = Consent('pre_flourish.preflourishconsent', version='1', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE]) site_consents.register(v1)
from django.conf import settings from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE from edc_protocol import Protocol v1 = Consent( settings.SUBJECT_CONSENT_MODEL, version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE], ) site_consents.register(v1)
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE edc_protocol = django_apps.get_app_config("edc_protocol") v1 = Consent( "meta_consent.subjectconsent", version="1", start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE], ) site_consents.register(v1)
from edc_constants.constants import FEMALE from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from .consent_object_validator import ConsentObjectValidator app_config = django_apps.get_app_config('edc_protocol') edc_protocol = django_apps.get_app_config('edc_protocol') tzinfo = gettz('Africa/Gaborone') v1 = Consent('td_maternal.subjectconsent', version='1', start=arrow.get(datetime(2016, 4, 1, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get(datetime(2022, 5, 31, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=18, age_is_adult=18, age_max=64, gender=[FEMALE]) v3 = Consent('td_maternal.subjectconsent', version='3', start=arrow.get(datetime(2018, 2, 1, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get(datetime(2022, 5, 31, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=18, age_is_adult=18, age_max=64, gender=[FEMALE])
from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from .consent_object_validator import ConsentObjectValidator app_config = django_apps.get_app_config('edc_protocol') edc_protocol = django_apps.get_app_config('edc_protocol') tzinfo = gettz('Africa/Gaborone') v1 = Consent( 'td_infant.infantdummysubjectconsent', version='1', start=arrow.get( datetime(2016, 4, 1, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get( datetime(2022, 5, 31, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=1, age_is_adult=1, age_max=10, gender=[MALE, FEMALE]) v3 = Consent( 'td_infant.infantdummysubjectconsent', version='3', start=arrow.get( datetime(2018, 2, 1, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get( datetime(2022, 5, 31, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=1, age_is_adult=1,
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE edc_protocol = django_apps.get_app_config("edc_protocol") v1 = Consent( "inte_consent.subjectconsent", version="1", start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=18, age_is_adult=18, age_max=110, gender=[MALE, FEMALE], # randomizer_name="default", ) site_consents.register(v1)
def setUp(self): v1_consent = Consent( "visit_schedule_app.subjectconsent", version="1", start=Protocol().study_open_datetime, end=Protocol().study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE], ) site_consents.registry = {} site_consents.register(v1_consent) self.visit_schedule = VisitSchedule( name="visit_schedule", verbose_name="Visit Schedule", offstudy_model="visit_schedule_app.SubjectOffstudy", death_report_model="visit_schedule_app.DeathReport", ) self.schedule = Schedule( name="schedule", onschedule_model="visit_schedule_app.OnSchedule", offschedule_model="visit_schedule_app.OffSchedule", consent_model="visit_schedule_app.subjectconsent", appointment_model="edc_appointment.appointment", ) self.schedule3 = Schedule( name="schedule_three", onschedule_model="visit_schedule_app.OnScheduleThree", offschedule_model="visit_schedule_app.OffScheduleThree", consent_model="visit_schedule_app.subjectconsent", appointment_model="edc_appointment.appointment", ) self.visit_schedule.add_schedule(self.schedule) self.visit_schedule.add_schedule(self.schedule3) site_visit_schedules._registry = {} site_visit_schedules.register(self.visit_schedule) self.subject_identifier = "12345" self.view = MyView() self.view.kwargs = dict(subject_identifier=self.subject_identifier) self.view.subject_identifier = self.subject_identifier self.view.request = RequestFactory() self.view.request.META = {"HTTP_CLIENT_IP": "1.1.1.1"} self.view_current = MyViewCurrent() self.view_current.kwargs = dict( subject_identifier=self.subject_identifier) self.view_current.subject_identifier = self.subject_identifier self.view_current.request = RequestFactory() self.view_current.request.META = {"HTTP_CLIENT_IP": "1.1.1.1"} self.subject_consent = SubjectConsent.objects.create( subject_identifier="12345", consent_datetime=get_utcnow() - relativedelta(seconds=1), dob=date(1995, 1, 1), identity="11111", confirm_identity="11111", )
from datetime import datetime from django.apps import apps as django_apps from django.conf import settings from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE app_config = django_apps.get_app_config('edc_protocol') tzinfo = gettz('Africa/Gaborone') v1 = Consent('bcpp_subject.subjectconsent', version='1', start=arrow.get(datetime(2013, 10, 18, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get(datetime(2014, 4, 9, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=16, age_is_adult=18, age_max=64, gender=[MALE, FEMALE]) v2 = Consent( 'bcpp_subject.subjectconsent', version='2', # updates_versions=['1'], start=arrow.get(datetime(2014, 4, 10, 0, 0, 0), tzinfo=tzinfo).to('UTC').datetime, end=arrow.get(datetime(2015, 4, 30, 23, 59, 59), tzinfo=tzinfo).to('UTC').datetime, age_min=16, age_is_adult=18,
from django.apps import apps as django_apps from edc_consent.consent import Consent from edc_consent.site_consents import site_consents from edc_constants.constants import MALE, FEMALE edc_protocol = django_apps.get_app_config('edc_protocol') v1 = Consent('ambition_subject.subjectconsent', version='1', start=edc_protocol.study_open_datetime, end=edc_protocol.study_close_datetime, age_min=18, age_is_adult=18, age_max=64, gender=[MALE, FEMALE]) site_consents.register(v1)