def register_to_site_reference_configs(): site_reference_configs.registry = {} reference = ReferenceModelConfig( name="edc_metadata_rules.CrfOne", fields=["f1", "f2", "f3"] ) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfTwo", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfThree", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfFour", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfFive", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfSix", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_metadata_rules.CrfSeven", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig( name="edc_metadata_rules.CrfMissingManager", fields=["f1"] ) site_reference_configs.register(reference)
def register_to_site_reference_configs(): site_reference_configs.registry = {} reference = ReferenceModelConfig(name="review_dashboard_app.CrfOne", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfTwo", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfThree", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfFour", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfFive", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfSix", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="review_dashboard_app.CrfSeven", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig( name="review_dashboard_app.CrfMissingManager", fields=["f1"] ) site_reference_configs.register(reference)
def enroll(subject_identifier=None): subject_identifier = subject_identifier or "1111111" site_reference_configs.registry = {} reference = ReferenceModelConfig( name="edc_action_item.CrfLongitudinalOne", fields=["f1", "f2", "f3"]) site_reference_configs.register(reference) site_visit_schedules._registry = {} site_visit_schedules.loaded = False site_visit_schedules.register(visit_schedule) site_reference_configs.register_from_visit_schedule( visit_models={ "edc_appointment.appointment": "edc_metadata.subjectvisit" }) subject_consent = SubjectConsent.objects.create( subject_identifier=subject_identifier, consent_datetime=get_utcnow()) _, schedule = site_visit_schedules.get_by_onschedule_model( "edc_metadata.onschedule") schedule.put_on_schedule( subject_identifier=subject_consent.subject_identifier, onschedule_datetime=subject_consent.consent_datetime, ) return subject_identifier
def register_configs(): site_reference_configs.registry = {} site_reference_configs.loaded = False site_reference_configs.register_from_visit_schedule( visit_models={ "edc_appointment.appointment": "reference_app.subjectvisit" }) reference_config = ReferenceModelConfig( name="reference_app.testmodel", fields=["field_str", "report_datetime"]) site_reference_configs.register(reference_config) reference_config = ReferenceModelConfig( name="reference_app.subjectrequisition.cd4", fields=["panel"]) site_reference_configs.register(reference_config) reference_config = ReferenceModelConfig( name="reference_app.subjectrequisition.vl", fields=["panel"]) site_reference_configs.register(reference_config) reference_config = ReferenceModelConfig( name="reference_app.subjectrequisition.wb", fields=["panel"]) site_reference_configs.register(reference_config) configs = { "reference_app.crfone": [ "field_str", "field_date", "field_datetime", "field_int", ], } for reference_name, fields in configs.items(): site_reference_configs.add_fields_to_config(name=reference_name, fields=fields)
def register_to_site_reference_configs(): site_reference_configs.registry = {} reference = ReferenceModelConfig(name="data_manager_app.CrfOne", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfTwo", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfThree", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfFour", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfFive", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfSix", fields=["f1"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="data_manager_app.CrfSeven", fields=["f1"]) site_reference_configs.register(reference)
from edc_reference import site_reference_configs, ReferenceModelConfig from edc_visit_schedule.site_visit_schedules import site_visit_schedules reference = ReferenceModelConfig(name='bcpp_subject.anonymousconsent', fields=['consent_datetime']) site_reference_configs.register(reference) site_reference_configs.register_from_visit_schedule( site_visit_schedules=site_visit_schedules) configs = { 'bcpp_subject.circumcision': ['circumcised'], 'bcpp_subject.elisahivresult': ['hiv_result', 'hiv_result_datetime'], 'bcpp_subject.hicenrollment': ['hic_permission'], 'bcpp_subject.hivcareadherence': ['arv_evidence', 'ever_taken_arv', 'on_arv', 'medical_care'], 'bcpp_subject.hivresult': ['hiv_result', 'hiv_result_datetime'], 'bcpp_subject.hivresultdocumentation': ['result_date', 'result_recorded', 'result_doc_type'], 'bcpp_subject.hivtestinghistory': ['verbal_hiv_result', 'other_record', 'has_tested', 'has_record'], 'bcpp_subject.hivtestreview': ['hiv_test_date', 'recorded_hiv_result'], 'bcpp_subject.medicaldiagnoses': ['cancer_record', 'heart_attack_record', 'tb_record'], 'bcpp_subject.outpatientcare': ['govt_health_care'], 'bcpp_subject.reproductivehealth': ['currently_pregnant', 'menopause'], 'bcpp_subject.resourceutilization': ['out_patient', 'hospitalized'], 'bcpp_subject.sexualbehaviour': ['last_year_partners', 'ever_sex'], 'bcpp_subject.subjectvisit': ['survey_schedule', 'survey'], } for reference_name, fields in configs.items():
from edc_reference import ReferenceModelConfig, site_reference_configs from edc_registration.model_mixins import UpdatesOrCreatesRegistrationModelMixin from edc_sites.models import SiteModelMixin from edc_visit_schedule.model_mixins import ( OffScheduleModelMixin, OnScheduleModelMixin, SubjectOnScheduleModelMixin, VisitScheduleFieldsModelMixin, VisitScheduleMethodsModelMixin, ) from edc_visit_tracking.model_mixins import VisitModelMixin from edc_lab.model_mixins import RequisitionModelMixin site_reference_configs.registry = {} reference = ReferenceModelConfig(name="edc_lab.subjectrequisition.panel", fields=["panel"]) site_reference_configs.register(reference) reference = ReferenceModelConfig(name="edc_lab.CrfOne", fields=["f1"]) site_reference_configs.register(reference) class SubjectRequisitionManager(models.Manager): def get_by_natural_key(self, requisition_identifier, subject_identifier, report_datetime): subject_visit = SubjectVisit.objects.get( subject_identifier=subject_identifier, report_datetime=report_datetime) return self.get(requisition_identifier=requisition_identifier, subject_visit=subject_visit)