edc-visit-schedule

Base classes for visit reports/tracking in clinicedc/edc


Keywords
django, edc, visit, schedule, data, collection, clinicedc, clinical, trials, clinical-research, clinical-trial-management-system, data-collection-schedules, health-informatics
Licenses
xpp/MIT-feh
Install
pip install edc-visit-schedule==0.3.97

Documentation

pypi actions codecov downloads

edc-visit-schedule

Add longitudinal data collection schedules to your EDC project.

Installation

Add to settings:

Overview

  • A Visit Schedule lives in your app in visit_schedules.py. Each app can declare and register one or more visit schedules in its visit_schedules module. Visit schedules are loaded when autodiscover is called from AppConfig.
  • A VisitSchedule contains Schedules which contain Visits which contain Crfs and Requisitions.
  • A schedule is effectively a "data collection schedule" where each contained visit represents a data collection timepoint.
  • A subject is put on a schedule by the schedule's onschedule model and taken off by the schedule's offschedule model. In the example below we use models OnSchedule and OffSchedule to do this for schedule schedule1.

Usage

First, create a file visit_schedules.py in the root of your app where the visit schedule code below will live.

Next, declare lists of data Crfs and laboratory Requisitions to be completed during each visit. For simplicity, we assume that every visit has the same data collection requirement (not usually the case).

Create a new visit schedule:

Visit schedules contain Schedules so create a schedule:

About consent_definitions:

As you will see below, the schedule is a container for a data collection schedule of forms (CRFs and requisitions) for a single study timepoint or visit. Ethically, a subject's data may not be collected before the subject has signed and submitted the informed consent form (ICF). Schedule is configured with information about the ICF that covers the forms it contains. When a form for a subject is validated and submitted, the Schedule will provide the consent_definition (or definitions) so that the calling object can confirm the subject is consented. The ICF is represented by the class ConsentDefinition from edc_consent.

See also class ConsentDefinition in edc_consent.

Schedules contains visits, so declare some visits and add to the schedule:

Add the schedule to your visit schedule:

Register the visit schedule with the site registry:

When Django loads, the visit schedule class will be available in the global site_visit_schedules.

The site_visit_schedules has a number of methods to help query the visit schedule and some related data.

Note: The schedule above was declared with onschedule_model=OnSchedule. An on-schedule model uses the CreateAppointmentsMixin from edc_appointment. On onschedule.save() the method onschedule.create_appointments is called. This method uses the visit schedule information to create the appointments as per the visit data in the schedule. See also edc_appointment.

OnSchedule and OffSchedule models

Two models mixins are required for the on-schedule and off-schedule models, OnScheduleModelMixin and OffScheduleModelMixin. OnSchedule/OffSchedule models are specific to a schedule. The visit_schedule_name and schedule_name are declared on the model's Meta class attribute visit_schedule_name.

For example: