def load_edc():

    if 'test' in sys.argv:
        f = open(os.path.join(
                 Path(os.path.dirname(os.path.realpath(__file__))).ancestor(1).child('td_maternal').child('tests'), 'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
Esempio n. 2
0
def load_edc():

    if 'test' in sys.argv:
        f = open(
            os.path.join(
                Path(os.path.dirname(os.path.realpath(__file__))).ancestor(
                    1).child('td_maternal').child('tests'),
                'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
Esempio n. 3
0
    def setUp(self):
        try:
            site_lab_profiles.register(MaternalProfile())
            site_lab_profiles.register(InfantProfile())
        except AlreadyRegisteredLabProfile:
            pass
        AppConfiguration(lab_profiles=site_lab_profiles).prepare()
        AntenatalEnrollmentVisitSchedule().build()
        PostnatalEnrollmentVisitSchedule().build()
        site_rule_groups.autodiscover()
        InfantBirthVisitSchedule().build()

        self.maternal_eligibility = MaternalEligibilityFactory()
        self.maternal_consent = MaternalConsentFactory(
            registered_subject=self.maternal_eligibility.registered_subject)
        self.registered_subject = self.maternal_consent.registered_subject

        PostnatalEnrollmentFactory(
            registered_subject=self.registered_subject,
            current_hiv_status=POS,
            evidence_hiv_status=YES)
        self.appointment = Appointment.objects.get(registered_subject=self.registered_subject,
                                                   visit_definition__code='1000M')
        self.maternal_visit = MaternalVisitFactory(appointment=self.appointment)
        self.appointment = Appointment.objects.get(
            registered_subject=self.registered_subject, visit_definition__code='2000M')
        maternal_visit = MaternalVisitFactory(appointment=self.appointment)
        self.maternal_labour_del = MaternalLabourDelFactory(maternal_visit=maternal_visit)

        self.registered_subject_infant = RegisteredSubject.objects.get(
            subject_type=INFANT, relative_identifier=self.registered_subject.subject_identifier)
Esempio n. 4
0
def load_edc():
    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()

    for model in get_models():
        try:
            django_databrowse.site.register(model)
        except:
            pass