Track study participant visit reports.
For a subject that requires ICF would look like this:
class SubjectVisit(VisitModelMixin, OffstudyMixin, CreatesMetadataModelMixin, RequiresConsentModelMixin, BaseUuidModel):
class Meta(VisitModelMixin.Meta):
consent_model = 'edc_example.subjectconsent'
app_label = 'edc_example'
If the subject does not require ICF, such as an infant, just don't include the RequiresConsentModelMixin
:
class InfantVisit(VisitModelMixin, OffstudyMixin, CreatesMetadataModelMixin, BaseUuidModel):
class Meta(VisitModelMixin.Meta):
app_label = 'edc_example'
In both cases a OneToOneField
attr to edc_example.Appointment
is added through the VisitModelMixin
mixin, so edc_example.Appointment
must exist.
The CrfModelMixin
is required for all CRF models. CRF models have a key to the visit model.
class CrfOne(CrfModelMixin, OffstudyMixin, RequiresConsentModelMixin, UpdatesCrfMetadataModelMixin, BaseUuidModel):
subject_visit = models.OneToOneField(SubjectVisit)
f1 = models.CharField(max_length=10, default='erik')
vl = models.CharField(max_length=10, default=NO)
rdb = models.CharField(max_length=10, default=NO)
class Meta:
consent_model = 'edc_example.subjectconsent'
app_label = 'edc_example'
offstudy_model = 'edc_example.subjectoffstudy'
The VisitFormMixin
includes a number of common validations in the clean
method:
class SubjectVisitForm(VisitFormMixin, forms.ModelForm):
class Meta:
model = SubjectVisit
The PreviousVisitModelMixin
ensures that visits are entered in sequence. It is included with the VisitModelMixin
.