edc-visit-tracking

Base classes for visit reports/tracking in clinicedc/edc


Keywords
django, edc, visit, tracking, clinicedc, clinical, trials, clinical-research, clinical-trials, data-collection, health-informatics
Licenses
xpp/MIT-feh
Install
pip install edc-visit-tracking==0.3.91

Documentation

pypi actions codecov downloads

edc-visit-tracking

Track study participant visit reports.

Declaring a visit model

A visit_model is declared using the model mixin VisitModelMixin. Normally, a visit_model will be declared with additional model mixins, but VisitModelMixin must be there.

Also, ensure the Meta class attributes of VisitModelMixin are inherited. These include required constraints and ordering.

Among other features, VisitModelMixin adds a OneToOneField foreign key to the visit_model that points to edc_appointment.Appointment.

Important: A visit model is a special model in the EDC. A model declared with the model mixin, VisitModelMixin, is the definition of a visit model. CRFs and Requisitions have a foreign key pointing to a visit model. A number of methods on CRFs and Requisitions detect their visit model foreign key name, model class and value by looking for the FK declared with VisitModelMixin.

For a subject that requires ICF the visit model would use the `RequiresConsentModelMixin`:

If the subject does not require ICF, such as an infant, don't include the `RequiresConsentModelMixin`:

A more complete declaration will include model mixins from other libraries. For example:

Declaring a CRF

The CrfModelMixin is required for all CRF models. CRF models have a OneToOneField key to a visit model.

Declaring forms:

The VisitFormMixin includes a number of common validations in the clean method:

PreviousVisitModelMixin

The PreviousVisitModelMixin ensures that visits are entered in sequence. It is included with the VisitModelMixin.

VisitTrackingModelFormMixin

see DEFAULT_REPORT_DATETIME_ALLOWANCE

Missed Visit Report

A detail report should be submitted for scheduled visits that are missed. By selecting the reason missed visit on SubjectVisit, only the missed visit CRF will be required for the timepoint. All other CRFs and requisitions will be excluded.

Unscheduled visits cannot be missed. (To change this behaviour see settings attrubute EDC_VISIT_TRACKING_ALLOW_MISSED_UNSCHEDULED)

The model mixin SubjectVisitMissedModelMixin provides the basic features of a SubjectVisitMissed model.

In your subject app declare:

In your list model app, e.g. meta_lists, declare the list model:

... and update the list_data dictionary, for example:

Window period

By default, the visit report_datetime is validated to stay within the same window period as the appointment. This may be too restrictive in some cases.

To bypass this override `validate_visit_datetime_in_window_period in the VisitFormValidator`

Be sure that your appointment form validator is enforcing window periods before bypassing this check.

See also edc_appointment.