Skip to content

Commit

Permalink
fix visit schedule definition
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 18, 2024
1 parent 10d4693 commit 5b56528
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions adverse_event_app/consents.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from edc_constants.constants import FEMALE, MALE
from edc_utils import get_utcnow

v1 = ConsentDefinition(
consent_v1 = ConsentDefinition(
"adverse_event_app.subjectconsent",
version="1",
start=getattr(
Expand All @@ -26,4 +26,4 @@
gender=[MALE, FEMALE],
)

site_consents.register(v1)
site_consents.register(consent_v1)
8 changes: 5 additions & 3 deletions adverse_event_app/visit_schedules.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from dateutil.relativedelta import relativedelta
from edc_visit_schedule.schedule import Schedule
from edc_visit_schedule.visit import Crf, FormsCollection, Visit
from edc_visit_schedule.visit import Crf, CrfCollection, Visit
from edc_visit_schedule.visit_schedule import VisitSchedule

crfs = FormsCollection(Crf(show_order=1, model="adverse_event_app.crfone", required=True))
from adverse_event_app.consents import consent_v1

crfs = CrfCollection(Crf(show_order=1, model="adverse_event_app.crfone", required=True))

visit = Visit(
code="1000",
Expand All @@ -25,7 +27,7 @@
onschedule_model="adverse_event_app.onschedule",
offschedule_model="adverse_event_app.StudyTerminationConclusion",
appointment_model="edc_appointment.appointment",
consent_model="adverse_event_app.subjectconsent",
consent_definitions=[consent_v1],
)

visit_schedule = VisitSchedule(
Expand Down
32 changes: 16 additions & 16 deletions edc_adverse_event/model_wrappers/death_report_model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ def death_report_tmg_second(self) -> DeathReportModelMixin:

def get_death_report_tmg_model_wrapper(self, action_item):
if not self.death_report_tmg:
model_wrapper = self.death_report_tmg_model_wrapper_cls(
model_obj=self.death_report_tmg_model_cls(
death_report=self.object,
subject_identifier=self.object.subject_identifier,
action_identifier=action_item.action_identifier,
parent_action_item=action_item.parent_action_item,
related_action_item=action_item.related_action_item,
)
# unpersisted model_obj
model_obj = self.death_report_tmg_model_cls(
death_report=self.object,
subject_identifier=self.object.subject_identifier,
action_identifier=action_item.action_identifier,
parent_action_item=action_item.parent_action_item,
related_action_item=action_item.related_action_item,
)
model_wrapper = self.death_report_tmg_model_wrapper_cls(model_obj=model_obj)
else:
model_wrapper = self.death_report_tmg_model_wrapper_cls(
model_obj=self.death_report_tmg
Expand All @@ -137,15 +137,15 @@ def get_death_report_tmg_model_wrapper(self, action_item):

def get_death_report_tmg_second_model_wrapper(self, action_item):
if not self.death_report_tmg_second:
model_wrapper = self.death_report_tmg_second_model_wrapper_cls(
model_obj=self.death_report_tmg_model_cls(
death_report=self.object,
subject_identifier=self.object.subject_identifier,
action_identifier=action_item.action_identifier,
parent_action_item=action_item.parent_action_item,
related_action_item=action_item.related_action_item,
)
# unpersisted model_obj
model_obj = self.death_report_tmg_model_cls(
death_report=self.object,
subject_identifier=self.object.subject_identifier,
action_identifier=action_item.action_identifier,
parent_action_item=action_item.parent_action_item,
related_action_item=action_item.related_action_item,
)
model_wrapper = self.death_report_tmg_second_model_wrapper_cls(model_obj=model_obj)
else:
model_wrapper = self.death_report_tmg_second_model_wrapper_cls(
model_obj=self.death_report_tmg_second
Expand Down
3 changes: 0 additions & 3 deletions edc_adverse_event/modeladmin_mixins/ae_initial_admin_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ class AeInitialModelAdminMixin(
):
form = AeInitialForm

change_list_template = "edc_adverse_event/admin/change_list.html"
change_form_template = "edc_adverse_event/admin/change_form.html"

ordering = ("-ae_awareness_date",)

actions = [print_to_pdf_action]
Expand Down

0 comments on commit 5b56528

Please sign in to comment.