Exemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0067_add_role_based_access_control_switch'),
    ]

    operations = [
        migrations.CreateModel(
            name='CornerstoneEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('cornerstone_base_url',
                 models.CharField(
                     blank=True,
                     help_text=
                     'The base URL used for API requests to Cornerstone, i.e. https://portalName.csod.com',
                     max_length=255,
                     verbose_name='Cornerstone Base URL')),
                ('enterprise_customer',
                 models.OneToOneField(
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='enterprise.EnterpriseCustomer')),
            ],
        ),
        migrations.CreateModel(
            name='CornerstoneGlobalConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('change_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Change date')),
                ('enabled',
                 models.BooleanField(default=False, verbose_name='Enabled')),
                ('completion_status_api_path',
                 models.CharField(
                     help_text=
                     'The API path for making completion POST requests to Cornerstone.',
                     max_length=255,
                     verbose_name='Completion Status API Path')),
                ('oauth_api_path',
                 models.CharField(
                     help_text=
                     'The API path for making OAuth-related POST requests to Cornerstone. This will be used to gain the OAuth access token which is required for other API calls.',
                     max_length=255,
                     verbose_name='OAuth API Path')),
                ('changed_by',
                 models.ForeignKey(editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Changed by')),
            ],
        ),
        migrations.CreateModel(
            name='CornerstoneLearnerDataTransmissionAudit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('user_guid', models.CharField(max_length=255)),
                ('enterprise_course_enrollment_id',
                 models.PositiveIntegerField(blank=True, null=True)),
                ('course_id',
                 models.CharField(
                     help_text=
                     "The course run's key which is used to uniquely identify the course for Cornerstone.",
                     max_length=255)),
                ('session_token', models.CharField(max_length=255)),
                ('callback_url', models.CharField(max_length=255)),
                ('subdomain', models.CharField(max_length=255)),
                ('course_completed',
                 models.BooleanField(
                     default=False,
                     help_text=
                     "The learner's course completion status transmitted to Cornerstone."
                 )),
                ('completed_timestamp',
                 models.DateTimeField(
                     blank=True,
                     help_text='Date time when user completed course',
                     null=True)),
                ('status',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('error_message', models.TextField(blank=True, null=True)),
                ('user',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='cornerstone_transmission_audit',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalCornerstoneEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('cornerstone_base_url',
                 models.CharField(
                     blank=True,
                     help_text=
                     'The base URL used for API requests to Cornerstone, i.e. https://portalName.csod.com',
                     max_length=255,
                     verbose_name='Cornerstone Base URL')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('enterprise_customer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCustomer')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by':
                'history_date',
                'verbose_name':
                'historical cornerstone enterprise customer configuration',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AlterUniqueTogether(
            name='cornerstonelearnerdatatransmissionaudit',
            unique_together=set([('user', 'course_id')]),
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("meta_subject", "0037_auto_20200517_0207"),
    ]

    operations = [
        migrations.AlterField(
            model_name="historicalmissedvisit",
            name="contact_attempts_count",
            field=models.IntegerField(
                blank=True,
                help_text="Not including pre-appointment reminders",
                null=True,
                validators=[django.core.validators.MinValueValidator(1)],
                verbose_name=
                "Number of attempts made to contact participant since the expected appointment date",
            ),
        ),
        migrations.AlterField(
            model_name="historicalmissedvisit",
            name="contact_attempts_explained",
            field=models.TextField(
                blank=True,
                null=True,
                verbose_name=
                "If contact not made and less than 3 attempts, please explain",
            ),
        ),
        migrations.AlterField(
            model_name="missedvisit",
            name="contact_attempts_count",
            field=models.IntegerField(
                blank=True,
                help_text="Not including pre-appointment reminders",
                null=True,
                validators=[django.core.validators.MinValueValidator(1)],
                verbose_name=
                "Number of attempts made to contact participant since the expected appointment date",
            ),
        ),
        migrations.AlterField(
            model_name="missedvisit",
            name="contact_attempts_explained",
            field=models.TextField(
                blank=True,
                null=True,
                verbose_name=
                "If contact not made and less than 3 attempts, please explain",
            ),
        ),
        migrations.CreateModel(
            name="HistoricalGlucose",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "fasted",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        null=True,
                        verbose_name="Has the participant fasted?",
                    ),
                ),
                (
                    "fasted_duration_str",
                    models.CharField(
                        blank=True,
                        help_text=
                        "Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
                        max_length=8,
                        null=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
                                message=
                                "Invalid format. Expected something like 1h20m, 11h5m, etc",
                            )
                        ],
                        verbose_name=
                        "How long have they fasted in hours and/or minutes?",
                    ),
                ),
                (
                    "fasted_duration_minutes",
                    models.IntegerField(help_text="system calculated value",
                                        null=True),
                ),
                (
                    "fasting_glucose",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        verbose_name="Fasting glucose <u>level</u>",
                    ),
                ),
                (
                    "fasting_glucose_quantifier",
                    models.CharField(
                        choices=[
                            ("=", "="),
                            (">", ">"),
                            (">=", ">="),
                            ("<", "<"),
                            ("<=", "<="),
                        ],
                        default="=",
                        max_length=10,
                    ),
                ),
                (
                    "fasting_glucose_units",
                    models.CharField(
                        blank=True,
                        choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="Units (fasting glucose)",
                    ),
                ),
                (
                    "fasting_glucose_datetime",
                    models.DateTimeField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "<u>Time</u> fasting glucose <u>level</u> measured",
                    ),
                ),
                (
                    "ogtt_base_datetime",
                    models.DateTimeField(
                        blank=True,
                        help_text="(glucose solution given)",
                        null=True,
                        verbose_name=
                        "<u>Time</u> oral glucose solution was given",
                    ),
                ),
                (
                    "ogtt_two_hr",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        verbose_name=
                        "Blood glucose <u>level</u> 2-hours after oral glucose solution given",
                    ),
                ),
                (
                    "ogtt_two_hr_quantifier",
                    models.CharField(
                        choices=[
                            ("=", "="),
                            (">", ">"),
                            (">=", ">="),
                            ("<", "<"),
                            ("<=", "<="),
                        ],
                        default="=",
                        max_length=10,
                    ),
                ),
                (
                    "ogtt_two_hr_units",
                    models.CharField(
                        blank=True,
                        choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="Units (Blood glucose 2hrs after...)",
                    ),
                ),
                (
                    "ogtt_two_hr_datetime",
                    models.DateTimeField(
                        blank=True,
                        help_text="(2 hours after glucose solution given)",
                        null=True,
                        verbose_name=
                        "<u>Time</u> blood glucose measured 2-hours after oral glucose solution given",
                    ),
                ),
                (
                    "ifg_performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the IFG test performed?",
                    ),
                ),
                (
                    "ifg_not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                (
                    "ogtt_performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the OGTT test performed?",
                    ),
                ),
                (
                    "ogtt_not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Glucose (IFG, OGTT)",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Glucose",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "fasted",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        null=True,
                        verbose_name="Has the participant fasted?",
                    ),
                ),
                (
                    "fasted_duration_str",
                    models.CharField(
                        blank=True,
                        help_text=
                        "Duration of fast. Format is `HHhMMm`. For example 1h23m, 12h7m, etc",
                        max_length=8,
                        null=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^([0-9]{1,3}h([0-5]?[0-9]m)?)$",
                                message=
                                "Invalid format. Expected something like 1h20m, 11h5m, etc",
                            )
                        ],
                        verbose_name=
                        "How long have they fasted in hours and/or minutes?",
                    ),
                ),
                (
                    "fasted_duration_minutes",
                    models.IntegerField(help_text="system calculated value",
                                        null=True),
                ),
                (
                    "fasting_glucose",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        verbose_name="Fasting glucose <u>level</u>",
                    ),
                ),
                (
                    "fasting_glucose_quantifier",
                    models.CharField(
                        choices=[
                            ("=", "="),
                            (">", ">"),
                            (">=", ">="),
                            ("<", "<"),
                            ("<=", "<="),
                        ],
                        default="=",
                        max_length=10,
                    ),
                ),
                (
                    "fasting_glucose_units",
                    models.CharField(
                        blank=True,
                        choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="Units (fasting glucose)",
                    ),
                ),
                (
                    "fasting_glucose_datetime",
                    models.DateTimeField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "<u>Time</u> fasting glucose <u>level</u> measured",
                    ),
                ),
                (
                    "ogtt_base_datetime",
                    models.DateTimeField(
                        blank=True,
                        help_text="(glucose solution given)",
                        null=True,
                        verbose_name=
                        "<u>Time</u> oral glucose solution was given",
                    ),
                ),
                (
                    "ogtt_two_hr",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        verbose_name=
                        "Blood glucose <u>level</u> 2-hours after oral glucose solution given",
                    ),
                ),
                (
                    "ogtt_two_hr_quantifier",
                    models.CharField(
                        choices=[
                            ("=", "="),
                            (">", ">"),
                            (">=", ">="),
                            ("<", "<"),
                            ("<=", "<="),
                        ],
                        default="=",
                        max_length=10,
                    ),
                ),
                (
                    "ogtt_two_hr_units",
                    models.CharField(
                        blank=True,
                        choices=[("mg/dL", "mg/dL"), ("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="Units (Blood glucose 2hrs after...)",
                    ),
                ),
                (
                    "ogtt_two_hr_datetime",
                    models.DateTimeField(
                        blank=True,
                        help_text="(2 hours after glucose solution given)",
                        null=True,
                        verbose_name=
                        "<u>Time</u> blood glucose measured 2-hours after oral glucose solution given",
                    ),
                ),
                (
                    "ifg_performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the IFG test performed?",
                    ),
                ),
                (
                    "ifg_not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                (
                    "ogtt_performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the OGTT test performed?",
                    ),
                ),
                (
                    "ogtt_not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name":
                "Glucose (IFG, OGTT)",
                "verbose_name_plural":
                "Glucose (IFG, OGTT)",
                "abstract":
                False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.AddIndex(
            model_name="glucose",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="meta_subjec_subject_35e440_idx",
            ),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("inte_lists", "0006_auto_20200812_0317"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("inte_subject", "0035_auto_20200821_0009"),
    ]

    operations = [
        migrations.CreateModel(
            name="ClinicalReview",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "hiv_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for HIV infection?",
                    ),
                ),
                (
                    "hiv_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "hiv_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "hiv_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with HIV infection?",
                    ),
                ),
                (
                    "hypertension_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for hypertension?",
                    ),
                ),
                (
                    "hypertension_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "hypertension_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "hypertension_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with hypertension?",
                    ),
                ),
                (
                    "diabetes_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for diabetes?",
                    ),
                ),
                (
                    "diabetes_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "diabetes_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "diabetes_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with diabetes?",
                    ),
                ),
                (
                    "test_date",
                    models.DateField(
                        blank=True,
                        editable=False,
                        help_text="question_retired",
                        null=True,
                        verbose_name="Date test requested",
                    ),
                ),
                (
                    "reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "diabetes_reason",
                    models.ManyToManyField(
                        blank=True,
                        related_name="diabetes_tested_reason",
                        to="inte_lists.ReasonsForTesting",
                        verbose_name="Why was the patient tested for diabetes?",
                    ),
                ),
                (
                    "hiv_reason",
                    models.ManyToManyField(
                        blank=True,
                        related_name="hiv_tested_reason",
                        to="inte_lists.ReasonsForTesting",
                        verbose_name="Why was the patient tested for HIV infection?",
                    ),
                ),
                (
                    "hypertension_reason",
                    models.ManyToManyField(
                        blank=True,
                        related_name="hypertension_tested_reason",
                        to="inte_lists.ReasonsForTesting",
                        verbose_name="Why was the patient tested for hypertension?",
                    ),
                ),
                (
                    "reason",
                    models.ManyToManyField(
                        blank=True,
                        editable=False,
                        help_text="question_retired",
                        to="inte_lists.ReasonsForTesting",
                        verbose_name="Why was the patient tested?",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Clinical Review",
                "verbose_name_plural": "Clinical Reviews",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site", django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalClinicalReview",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "hiv_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for HIV infection?",
                    ),
                ),
                (
                    "hiv_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "hiv_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "hiv_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with HIV infection?",
                    ),
                ),
                (
                    "hypertension_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for hypertension?",
                    ),
                ),
                (
                    "hypertension_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "hypertension_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "hypertension_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with hypertension?",
                    ),
                ),
                (
                    "diabetes_tested",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if previously diagnosed. `Since last seen` includes today.",
                        max_length=15,
                        verbose_name="Since last seen, was the patient tested for diabetes?",
                    ),
                ),
                (
                    "diabetes_test_date",
                    models.DateField(
                        blank=True, null=True, verbose_name="Date test requested"
                    ),
                ),
                (
                    "diabetes_reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "diabetes_dx",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=15,
                        verbose_name="As of today, was the patient <u>newly</u> diagnosed with diabetes?",
                    ),
                ),
                (
                    "test_date",
                    models.DateField(
                        blank=True,
                        editable=False,
                        help_text="question_retired",
                        null=True,
                        verbose_name="Date test requested",
                    ),
                ),
                (
                    "reason_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Clinical Review",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalMedications",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "refill_hiv",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for HIV infection.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling HIV medications?",
                    ),
                ),
                (
                    "refill_diabetes",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for Diabetes.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling Diabetes medications?",
                    ),
                ),
                (
                    "refill_hypertension",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for Hypertension.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling Hypertension medications?",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Medications",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Medications",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "refill_hiv",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for HIV infection.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling HIV medications?",
                    ),
                ),
                (
                    "refill_diabetes",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for Diabetes.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling Diabetes medications?",
                    ),
                ),
                (
                    "refill_hypertension",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        help_text="Select `not applicable` if subject has not been prescribed medication for Hypertension.",
                        max_length=25,
                        verbose_name="Is the patient filling / refilling Hypertension medications?",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Medications",
                "verbose_name_plural": "Medications",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site", django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="diabetic",
            new_name="diabetes",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="diabetic_tested",
            new_name="diabetes_tested",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="diabetic_tested_ago",
            new_name="diabetes_tested_ago",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="diabetic_tested_date",
            new_name="diabetes_tested_date",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="hypertensive",
            new_name="hypertension",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="hypertensive_tested",
            new_name="hypertension_tested",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="hypertensive_tested_ago",
            new_name="hypertension_tested_ago",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="hypertensive_tested_date",
            new_name="hypertension_tested_date",
        ),
        migrations.RenameField(
            model_name="healtheconomics",
            old_name="diabetic_expenditure_month",
            new_name="diabetes_expenditure_month",
        ),
        migrations.RenameField(
            model_name="healtheconomics",
            old_name="diabetic_payee",
            new_name="diabetes_payee",
        ),
        migrations.RenameField(
            model_name="healtheconomics",
            old_name="hypertensive_expenditure_month",
            new_name="hypertension_expenditure_month",
        ),
        migrations.RenameField(
            model_name="healtheconomics",
            old_name="hypertensive_payee",
            new_name="hypertension_payee",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="diabetic",
            new_name="diabetes",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="diabetic_tested",
            new_name="diabetes_tested",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="diabetic_tested_ago",
            new_name="diabetes_tested_ago",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="diabetic_tested_date",
            new_name="diabetes_tested_date",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="hypertensive",
            new_name="hypertension",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="hypertensive_tested",
            new_name="hypertension_tested",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="hypertensive_tested_ago",
            new_name="hypertension_tested_ago",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="hypertensive_tested_date",
            new_name="hypertension_tested_date",
        ),
        migrations.RenameField(
            model_name="historicalhealtheconomics",
            old_name="diabetic_expenditure_month",
            new_name="diabetes_expenditure_month",
        ),
        migrations.RenameField(
            model_name="historicalhealtheconomics",
            old_name="diabetic_payee",
            new_name="diabetes_payee",
        ),
        migrations.RenameField(
            model_name="historicalhealtheconomics",
            old_name="hypertensive_expenditure_month",
            new_name="hypertension_expenditure_month",
        ),
        migrations.RenameField(
            model_name="historicalhealtheconomics",
            old_name="hypertensive_payee",
            new_name="hypertension_payee",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="diabetic_tested_estimated_datetime",
            new_name="diabetes_tested_estimated_datetime",
        ),
        migrations.RenameField(
            model_name="clinicalreviewbaseline",
            old_name="hypertensive_tested_estimated_datetime",
            new_name="hypertension_tested_estimated_datetime",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="diabetic_tested_estimated_datetime",
            new_name="diabetes_tested_estimated_datetime",
        ),
        migrations.RenameField(
            model_name="historicalclinicalreviewbaseline",
            old_name="hypertensive_tested_estimated_datetime",
            new_name="hypertension_tested_estimated_datetime",
        ),
        migrations.AddIndex(
            model_name="medications",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="inte_subjec_subject_8345ac_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="clinicalreview",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="inte_subjec_subject_059fb3_idx",
            ),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("mocca_subject", "0004_remove_reasonforvisit_health_services"),
    ]

    operations = [
        migrations.CreateModel(
            name="PatientHealth",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.models.validators.date.
                            datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text=
                        "If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name=
                        "Any comments related to status of this CRF",
                    ),
                ),
                (
                    "ph9interst",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Little interest or pleasure in doing things",
                    ),
                ),
                (
                    "ph9feel",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Feeling down, depressed or hopeless",
                    ),
                ),
                (
                    "ph9troubl",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Trouble falling/staying asleep, sleeping too much",
                    ),
                ),
                (
                    "ph9tired",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Feeling tired or having little energy",
                    ),
                ),
                (
                    "ph9appetit",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Poor appetite or over eating",
                    ),
                ),
                (
                    "ph9badabt",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Feeling bad about yourself or that you are a failure or have let yourself or your family down",
                    ),
                ),
                (
                    "ph9concen",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Trouble concentrating on things such as reading the newspapers or watching television",
                    ),
                ),
                (
                    "ph9moving",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Moving or speaking so slowly  that other people could have noticed or the opposite: being so fidgety or restless that you have been moving around a lot more than usual",
                    ),
                ),
                (
                    "phpthough",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Thoughts that you would be better off dead or of hurting yourself in some way",
                    ),
                ),
                (
                    "ph9functio",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "If you checked off any problems on this questionnaire so far, how difficult have these problems made it for you to do your work, take care of things at home or get along with other people?",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="mocca_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name":
                "Patient Health Questionnaire-9 (PHQ9-)",
                "verbose_name_plural":
                "Patient Health Questionnaires-9 (PHQ9-)",
                "ordering": ("-modified", "-created"),
                "get_latest_by":
                "modified",
                "abstract":
                False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalPatientHealth",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.models.validators.date.
                            datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text=
                        "If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name=
                        "Any comments related to status of this CRF",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "ph9interst",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Little interest or pleasure in doing things",
                    ),
                ),
                (
                    "ph9feel",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Feeling down, depressed or hopeless",
                    ),
                ),
                (
                    "ph9troubl",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Trouble falling/staying asleep, sleeping too much",
                    ),
                ),
                (
                    "ph9tired",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Feeling tired or having little energy",
                    ),
                ),
                (
                    "ph9appetit",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name="Poor appetite or over eating",
                    ),
                ),
                (
                    "ph9badabt",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Feeling bad about yourself or that you are a failure or have let yourself or your family down",
                    ),
                ),
                (
                    "ph9concen",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Trouble concentrating on things such as reading the newspapers or watching television",
                    ),
                ),
                (
                    "ph9moving",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Moving or speaking so slowly  that other people could have noticed or the opposite: being so fidgety or restless that you have been moving around a lot more than usual",
                    ),
                ),
                (
                    "phpthough",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "Thoughts that you would be better off dead or of hurting yourself in some way",
                    ),
                ),
                (
                    "ph9functio",
                    models.CharField(
                        choices=[
                            ("not_at_all", "Not at all"),
                            ("several_days", "Several days"),
                            ("more_than_half", "More than half the days"),
                            ("nearly_everyday", "Nearly everyday"),
                        ],
                        max_length=15,
                        verbose_name=
                        "If you checked off any problems on this questionnaire so far, how difficult have these problems made it for you to do your work, take care of things at home or get along with other people?",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="mocca_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name":
                "historical Patient Health Questionnaire-9 (PHQ9-)",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddIndex(
            model_name="patienthealth",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="mocca_subje_subject_e0c51a_idx",
            ),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("sites", "0002_alter_domain_unique"),
        ("meta_subject", "0001_initial"),
    ]

    operations = [
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="abdominal_tenderness"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="dia_blood_pressure"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="has_abdominal_tenderness"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="has_enlarged_liver"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="heart_rate"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="irregular_heartbeat"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="is_heartbeat_regular"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="jaundice"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="peripheral_oedema"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="respiratory_rate"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="sys_blood_pressure"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="temperature"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="waist_circumference"),
        migrations.RemoveField(model_name="historicalpatienthistory",
                               name="weight"),
        migrations.RemoveField(model_name="patienthistory",
                               name="abdominal_tenderness"),
        migrations.RemoveField(model_name="patienthistory",
                               name="dia_blood_pressure"),
        migrations.RemoveField(model_name="patienthistory",
                               name="has_abdominal_tenderness"),
        migrations.RemoveField(model_name="patienthistory",
                               name="has_enlarged_liver"),
        migrations.RemoveField(model_name="patienthistory", name="heart_rate"),
        migrations.RemoveField(model_name="patienthistory",
                               name="irregular_heartbeat"),
        migrations.RemoveField(model_name="patienthistory",
                               name="is_heartbeat_regular"),
        migrations.RemoveField(model_name="patienthistory", name="jaundice"),
        migrations.RemoveField(model_name="patienthistory",
                               name="peripheral_oedema"),
        migrations.RemoveField(model_name="patienthistory",
                               name="respiratory_rate"),
        migrations.RemoveField(model_name="patienthistory",
                               name="sys_blood_pressure"),
        migrations.RemoveField(model_name="patienthistory",
                               name="temperature"),
        migrations.RemoveField(model_name="patienthistory",
                               name="waist_circumference"),
        migrations.RemoveField(model_name="patienthistory", name="weight"),
        migrations.AddField(
            model_name="followupvitals",
            name="oxygen_saturation",
            field=models.IntegerField(
                editable=False,
                help_text="%",
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(1),
                    django.core.validators.MaxValueValidator(999),
                ],
                verbose_name="Oxygen saturation:",
            ),
        ),
        migrations.AddField(
            model_name="historicalfollowupvitals",
            name="oxygen_saturation",
            field=models.IntegerField(
                editable=False,
                help_text="%",
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(1),
                    django.core.validators.MaxValueValidator(999),
                ],
                verbose_name="Oxygen saturation:",
            ),
        ),
        migrations.AlterField(
            model_name="followupvitals",
            name="respiratory_rate",
            field=models.IntegerField(
                editable=False,
                help_text="breaths/min",
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(6),
                    django.core.validators.MaxValueValidator(50),
                ],
                verbose_name="Respiratory rate:",
            ),
        ),
        migrations.AlterField(
            model_name="historicalfollowupvitals",
            name="respiratory_rate",
            field=models.IntegerField(
                editable=False,
                help_text="breaths/min",
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(6),
                    django.core.validators.MaxValueValidator(50),
                ],
                verbose_name="Respiratory rate:",
            ),
        ),
        migrations.CreateModel(
            name="PhysicalExam",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "weight",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="kg",
                        max_digits=4,
                        validators=[
                            django.core.validators.MinValueValidator(20),
                            django.core.validators.MaxValueValidator(150),
                        ],
                        verbose_name="Weight:",
                    ),
                ),
                (
                    "sys_blood_pressure",
                    models.IntegerField(
                        help_text="in mm. format SYS, e.g. 120",
                        validators=[
                            django.core.validators.MinValueValidator(50),
                            django.core.validators.MaxValueValidator(220),
                        ],
                        verbose_name="Blood pressure: systolic",
                    ),
                ),
                (
                    "dia_blood_pressure",
                    models.IntegerField(
                        help_text="in Hg. format DIA, e.g. 80",
                        validators=[
                            django.core.validators.MinValueValidator(20),
                            django.core.validators.MaxValueValidator(150),
                        ],
                        verbose_name="Blood pressure: diastolic",
                    ),
                ),
                (
                    "heart_rate",
                    models.IntegerField(
                        help_text="BPM",
                        validators=[
                            django.core.validators.MinValueValidator(30),
                            django.core.validators.MaxValueValidator(200),
                        ],
                        verbose_name="Heart rate:",
                    ),
                ),
                (
                    "respiratory_rate",
                    models.IntegerField(
                        editable=False,
                        help_text="breaths/min",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(6),
                            django.core.validators.MaxValueValidator(50),
                        ],
                        verbose_name="Respiratory rate:",
                    ),
                ),
                (
                    "oxygen_saturation",
                    models.IntegerField(
                        editable=False,
                        help_text="%",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="Oxygen saturation:",
                    ),
                ),
                (
                    "temperature",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in degrees Celcius",
                        max_digits=3,
                        validators=[
                            django.core.validators.MinValueValidator(30),
                            django.core.validators.MaxValueValidator(45),
                        ],
                        verbose_name="Temperature:",
                    ),
                ),
                (
                    "is_heartbeat_regular",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Is the heart beat regular?",
                    ),
                ),
                (
                    "irregular_heartbeat",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If the heartbeat is NOT regular, please describe",
                    ),
                ),
                (
                    "waist_circumference",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in centimeters",
                        max_digits=5,
                        validators=[
                            django.core.validators.MinValueValidator(50.0),
                            django.core.validators.MaxValueValidator(175.0),
                        ],
                        verbose_name="Waist circumference",
                    ),
                ),
                (
                    "jaundice",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Jaundice",
                    ),
                ),
                (
                    "peripheral_oedema",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Presence of peripheral oedema",
                    ),
                ),
                (
                    "has_abdominal_tenderness",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Abdominal tenderness on palpation",
                    ),
                ),
                (
                    "abdominal_tenderness",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If YES, abdominal tenderness, please describe",
                    ),
                ),
                (
                    "has_enlarged_liver",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Enlarged liver on palpation",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Patient History",
                "verbose_name_plural": "Patient History",
                "abstract": False,
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalPhysicalExam",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "weight",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="kg",
                        max_digits=4,
                        validators=[
                            django.core.validators.MinValueValidator(20),
                            django.core.validators.MaxValueValidator(150),
                        ],
                        verbose_name="Weight:",
                    ),
                ),
                (
                    "sys_blood_pressure",
                    models.IntegerField(
                        help_text="in mm. format SYS, e.g. 120",
                        validators=[
                            django.core.validators.MinValueValidator(50),
                            django.core.validators.MaxValueValidator(220),
                        ],
                        verbose_name="Blood pressure: systolic",
                    ),
                ),
                (
                    "dia_blood_pressure",
                    models.IntegerField(
                        help_text="in Hg. format DIA, e.g. 80",
                        validators=[
                            django.core.validators.MinValueValidator(20),
                            django.core.validators.MaxValueValidator(150),
                        ],
                        verbose_name="Blood pressure: diastolic",
                    ),
                ),
                (
                    "heart_rate",
                    models.IntegerField(
                        help_text="BPM",
                        validators=[
                            django.core.validators.MinValueValidator(30),
                            django.core.validators.MaxValueValidator(200),
                        ],
                        verbose_name="Heart rate:",
                    ),
                ),
                (
                    "respiratory_rate",
                    models.IntegerField(
                        editable=False,
                        help_text="breaths/min",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(6),
                            django.core.validators.MaxValueValidator(50),
                        ],
                        verbose_name="Respiratory rate:",
                    ),
                ),
                (
                    "oxygen_saturation",
                    models.IntegerField(
                        editable=False,
                        help_text="%",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="Oxygen saturation:",
                    ),
                ),
                (
                    "temperature",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in degrees Celcius",
                        max_digits=3,
                        validators=[
                            django.core.validators.MinValueValidator(30),
                            django.core.validators.MaxValueValidator(45),
                        ],
                        verbose_name="Temperature:",
                    ),
                ),
                (
                    "is_heartbeat_regular",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Is the heart beat regular?",
                    ),
                ),
                (
                    "irregular_heartbeat",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If the heartbeat is NOT regular, please describe",
                    ),
                ),
                (
                    "waist_circumference",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in centimeters",
                        max_digits=5,
                        validators=[
                            django.core.validators.MinValueValidator(50.0),
                            django.core.validators.MaxValueValidator(175.0),
                        ],
                        verbose_name="Waist circumference",
                    ),
                ),
                (
                    "jaundice",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Jaundice",
                    ),
                ),
                (
                    "peripheral_oedema",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Presence of peripheral oedema",
                    ),
                ),
                (
                    "has_abdominal_tenderness",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Abdominal tenderness on palpation",
                    ),
                ),
                (
                    "abdominal_tenderness",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If YES, abdominal tenderness, please describe",
                    ),
                ),
                (
                    "has_enlarged_liver",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Enlarged liver on palpation",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Patient History",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddIndex(
            model_name="physicalexam",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="meta_subjec_subject_7da1da_idx",
            ),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("sites", "0002_alter_domain_unique"),
        ("inte_subject", "0030_auto_20200813_1825"),
    ]

    operations = [
        migrations.AlterField(
            model_name="historicalindicators",
            name="height",
            field=edc_model.models.fields.height.HeightField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="historicalindicators",
            name="weight",
            field=edc_model.models.fields.weight.WeightField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="indicators",
            name="height",
            field=edc_model.models.fields.height.HeightField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="indicators",
            name="weight",
            field=edc_model.models.fields.weight.WeightField(blank=True, null=True),
        ),
        migrations.CreateModel(
            name="HistoricalFamilyHistory",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "hypertension_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>high blood pressure</ul?",
                    ),
                ),
                (
                    "diabetes_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>diabetes</ul?",
                    ),
                ),
                (
                    "hiv_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>HIV</ul?",
                    ),
                ),
                (
                    "high_bp_bs_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="High blood pressure and high blood sugar can cause many illnesses like heart attacks, stroke, kidney failure",
                    ),
                ),
                (
                    "overweight_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Being overweight protects from high blood pressure and high blood sugar",
                    ),
                ),
                (
                    "salty_foods_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Salty food protects from high blood sugar",
                    ),
                ),
                (
                    "excercise_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Regular exercise is important for people with <ul>high blood pressure</ul> or <ul>high blood sugar</ul> even if they are taking medicines for these conditions.",
                    ),
                ),
                (
                    "take_medicine_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Drugs for <ul>blood sugar</ul> and <ul>blood pressure</ul> can make you unwell",
                    ),
                ),
                (
                    "stop_hypertension_meds_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="It is best to stop taking <ul>blood pressure</ul> pills when you feel better and start pill taking again when you feel sick",
                    ),
                ),
                (
                    "traditional_hypertension_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Herbs and traditional medicine are better for managing <ul>blood pressure</ul> than pills and medicines",
                    ),
                ),
                (
                    "stop_diabetes_meds_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="It is best to stop taking <ul>blood sugar</ul> medicines when you feel better and start pill taking again when you feel sick",
                    ),
                ),
                (
                    "traditional_diabetes_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Herbs and traditional medicine are better for managing <ul>diabetes</ul> than pills and medicines",
                    ),
                ),
                (
                    "diabetes_cause_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Having drinks with sugar (e.g. tea/coffee) causes diabetes",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Family History and Knowledge",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="FamilyHistory",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text="If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name="Any comments related to status of this CRF",
                    ),
                ),
                (
                    "hypertension_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>high blood pressure</ul?",
                    ),
                ),
                (
                    "diabetes_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>diabetes</ul?",
                    ),
                ),
                (
                    "hiv_in_household",
                    models.CharField(
                        choices=[
                            ("No", "No"),
                            ("yes_spouse", "Yes, my spouse"),
                            ("yes_parents", "Yes, one of my parents living with me"),
                            ("yes_relative", "Yes, another relative living with me"),
                        ],
                        max_length=25,
                        verbose_name="Do you know if anyone else in your household has <ul>HIV</ul?",
                    ),
                ),
                (
                    "high_bp_bs_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="High blood pressure and high blood sugar can cause many illnesses like heart attacks, stroke, kidney failure",
                    ),
                ),
                (
                    "overweight_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Being overweight protects from high blood pressure and high blood sugar",
                    ),
                ),
                (
                    "salty_foods_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Salty food protects from high blood sugar",
                    ),
                ),
                (
                    "excercise_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Regular exercise is important for people with <ul>high blood pressure</ul> or <ul>high blood sugar</ul> even if they are taking medicines for these conditions.",
                    ),
                ),
                (
                    "take_medicine_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Drugs for <ul>blood sugar</ul> and <ul>blood pressure</ul> can make you unwell",
                    ),
                ),
                (
                    "stop_hypertension_meds_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="It is best to stop taking <ul>blood pressure</ul> pills when you feel better and start pill taking again when you feel sick",
                    ),
                ),
                (
                    "traditional_hypertension_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Herbs and traditional medicine are better for managing <ul>blood pressure</ul> than pills and medicines",
                    ),
                ),
                (
                    "stop_diabetes_meds_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="It is best to stop taking <ul>blood sugar</ul> medicines when you feel better and start pill taking again when you feel sick",
                    ),
                ),
                (
                    "traditional_diabetes_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Herbs and traditional medicine are better for managing <ul>diabetes</ul> than pills and medicines",
                    ),
                ),
                (
                    "diabetes_cause_tf",
                    models.CharField(
                        choices=[
                            ("true", "True"),
                            ("false", "False"),
                            ("dont_know", "Don't know"),
                        ],
                        max_length=25,
                        verbose_name="Having drinks with sugar (e.g. tea/coffee) causes diabetes",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Family History and Knowledge",
                "verbose_name_plural": "Family History and Knowledge",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site", django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.AddIndex(
            model_name="familyhistory",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="inte_subjec_subject_2e330e_idx",
            ),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("meta_lists", "0010_auto_20200617_1738"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("meta_subject", "0050_auto_20200614_1934"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalSubjectVisitMissed",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                        ],
                        max_length=25,
                        verbose_name="Survival status",
                    ),
                ),
                (
                    "contact_attempted",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        help_text="Not including pre-appointment reminders",
                        max_length=25,
                        verbose_name=
                        "Were any attempts made to contact the participant since the expected appointment date?",
                    ),
                ),
                (
                    "contact_attempts_count",
                    models.IntegerField(
                        blank=True,
                        help_text="Not including pre-appointment reminders",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1)
                        ],
                        verbose_name=
                        "Number of attempts made to contact participantsince the expected appointment date",
                    ),
                ),
                (
                    "contact_attempts_explained",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If contact not made and less than 3 attempts, please explain",
                    ),
                ),
                (
                    "contact_last_date",
                    models.DateField(
                        blank=True,
                        default=edc_utils.date.get_utcnow,
                        null=True,
                        validators=[
                            edc_model.validators.date.date_not_future,
                            edc_protocol.validators.
                            date_not_before_study_start,
                        ],
                        verbose_name="Date of last telephone contact/attempt",
                    ),
                ),
                (
                    "contact_made",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name=
                        "Was contact finally made with the participant?",
                    ),
                ),
                (
                    "missed_reasons_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="Please provide further details, if any",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Missed Visit Report",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="SubjectVisitMissed",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "survival_status",
                    models.CharField(
                        choices=[
                            ("alive", "Alive"),
                            ("dead", "Deceased"),
                            ("unknown", "Unknown"),
                        ],
                        max_length=25,
                        verbose_name="Survival status",
                    ),
                ),
                (
                    "contact_attempted",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        help_text="Not including pre-appointment reminders",
                        max_length=25,
                        verbose_name=
                        "Were any attempts made to contact the participant since the expected appointment date?",
                    ),
                ),
                (
                    "contact_attempts_count",
                    models.IntegerField(
                        blank=True,
                        help_text="Not including pre-appointment reminders",
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(1)
                        ],
                        verbose_name=
                        "Number of attempts made to contact participantsince the expected appointment date",
                    ),
                ),
                (
                    "contact_attempts_explained",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name=
                        "If contact not made and less than 3 attempts, please explain",
                    ),
                ),
                (
                    "contact_last_date",
                    models.DateField(
                        blank=True,
                        default=edc_utils.date.get_utcnow,
                        null=True,
                        validators=[
                            edc_model.validators.date.date_not_future,
                            edc_protocol.validators.
                            date_not_before_study_start,
                        ],
                        verbose_name="Date of last telephone contact/attempt",
                    ),
                ),
                (
                    "contact_made",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name=
                        "Was contact finally made with the participant?",
                    ),
                ),
                (
                    "missed_reasons_other",
                    edc_model.models.fields.other_charfield.OtherCharField(
                        blank=True,
                        max_length=35,
                        null=True,
                        verbose_name="If other, please specify ...",
                    ),
                ),
                (
                    "comment",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="Please provide further details, if any",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "missed_reasons",
                    models.ManyToManyField(
                        blank=True,
                        related_name="_subjectvisitmissed_missed_reasons_+",
                        to="meta_lists.SubjectVisitMissedReasons",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name":
                "Missed Visit Report",
                "verbose_name_plural":
                "Missed Visit Report",
                "ordering": ("-modified", "-created"),
                "get_latest_by":
                "modified",
                "abstract":
                False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.RemoveField(
            model_name="missedvisit",
            name="missed_reasons",
        ),
        migrations.RemoveField(
            model_name="missedvisit",
            name="site",
        ),
        migrations.RemoveField(
            model_name="missedvisit",
            name="subject_visit",
        ),
        migrations.DeleteModel(name="HistoricalMissedVisit", ),
        migrations.DeleteModel(name="MissedVisit", ),
        migrations.AddIndex(
            model_name="subjectvisitmissed",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="meta_subjec_subject_89b092_idx",
            ),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ("edc_action_item", "0024_auto_20191024_1000"),
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("meta_subject", "0013_auto_20200119_0013"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalBloodResultsLipid",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                ("tracking_identifier",
                 models.CharField(db_index=True, max_length=30)),
                ("action_identifier",
                 models.CharField(db_index=True, max_length=50)),
                (
                    "parent_action_identifier",
                    models.CharField(
                        help_text=
                        "action identifier that links to parent reference model instance.",
                        max_length=30,
                        null=True,
                    ),
                ),
                (
                    "related_action_identifier",
                    models.CharField(
                        help_text=
                        "action identifier that links to related reference model instance.",
                        max_length=30,
                        null=True,
                    ),
                ),
                ("action_item_reason",
                 models.TextField(editable=False, null=True)),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "results_abnormal",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Are any of the above results abnormal?",
                    ),
                ),
                (
                    "results_reportable",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        help_text=
                        "If YES, this value will open Adverse Event Form.<br/><br/>Note: On Day 1 only abnormal bloods should not be reported as adverseevents.",
                        max_length=25,
                        verbose_name=
                        "If any results are abnormal, are results within grade III or above?",
                    ),
                ),
                ("summary", models.TextField(blank=True, null=True)),
                (
                    "lipid_assay_datetime",
                    models.DateTimeField(
                        blank=True,
                        null=True,
                        validators=[
                            edc_model.validators.date.datetime_not_future
                        ],
                        verbose_name="Result Report Date and Time",
                    ),
                ),
                (
                    "ldl",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="LDL",
                    ),
                ),
                (
                    "ldl_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "ldl_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "ldl_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                (
                    "hdl",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="HDL",
                    ),
                ),
                (
                    "hdl_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "hdl_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "hdl_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                (
                    "trig",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="Triglycerides",
                    ),
                ),
                (
                    "trig_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "trig_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "trig_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "action_item",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "lipid_requisition",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        help_text=
                        "Start typing the requisition identifier or select one from this visit",
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectRequisition",
                        verbose_name="Requisition",
                    ),
                ),
                (
                    "parent_action_item",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "related_action_item",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Blood Result: LIPID",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="BloodResultsLipid",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("tracking_identifier",
                 models.CharField(max_length=30, unique=True)),
                ("action_identifier",
                 models.CharField(max_length=50, unique=True)),
                (
                    "parent_action_identifier",
                    models.CharField(
                        help_text=
                        "action identifier that links to parent reference model instance.",
                        max_length=30,
                        null=True,
                    ),
                ),
                (
                    "related_action_identifier",
                    models.CharField(
                        help_text=
                        "action identifier that links to related reference model instance.",
                        max_length=30,
                        null=True,
                    ),
                ),
                ("action_item_reason",
                 models.TextField(editable=False, null=True)),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "results_abnormal",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Are any of the above results abnormal?",
                    ),
                ),
                (
                    "results_reportable",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        help_text=
                        "If YES, this value will open Adverse Event Form.<br/><br/>Note: On Day 1 only abnormal bloods should not be reported as adverseevents.",
                        max_length=25,
                        verbose_name=
                        "If any results are abnormal, are results within grade III or above?",
                    ),
                ),
                ("summary", models.TextField(blank=True, null=True)),
                (
                    "lipid_assay_datetime",
                    models.DateTimeField(
                        blank=True,
                        null=True,
                        validators=[
                            edc_model.validators.date.datetime_not_future
                        ],
                        verbose_name="Result Report Date and Time",
                    ),
                ),
                (
                    "ldl",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="LDL",
                    ),
                ),
                (
                    "ldl_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "ldl_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "ldl_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                (
                    "hdl",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="HDL",
                    ),
                ),
                (
                    "hdl_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "hdl_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "hdl_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                (
                    "trig",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=8,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(999),
                        ],
                        verbose_name="Triglycerides",
                    ),
                ),
                (
                    "trig_units",
                    models.CharField(
                        blank=True,
                        choices=[("mmol/L", "mmol/L")],
                        max_length=15,
                        null=True,
                        verbose_name="units",
                    ),
                ),
                (
                    "trig_abnormal",
                    models.CharField(
                        blank=True,
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        null=True,
                        verbose_name="abnormal",
                    ),
                ),
                (
                    "trig_reportable",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("N/A", "Not applicable"),
                            ("3", "Yes, grade 3"),
                            ("4", "Yes, grade 4"),
                            ("No", "Not reportable"),
                            ("Already reported", "Already reported"),
                            ("present_at_baseline", "Present at baseline"),
                        ],
                        max_length=25,
                        null=True,
                        verbose_name="reportable",
                    ),
                ),
                (
                    "action_item",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "lipid_requisition",
                    models.ForeignKey(
                        blank=True,
                        help_text=
                        "Start typing the requisition identifier or select one from this visit",
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="lipid",
                        to="meta_subject.SubjectRequisition",
                        verbose_name="Requisition",
                    ),
                ),
                (
                    "parent_action_item",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "related_action_item",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="edc_action_item.ActionItem",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Blood Result: LIPID",
                "verbose_name_plural": "Blood Results: LIPID",
                "abstract": False,
            },
            managers=[
                ("on_site", edc_visit_tracking.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.AddIndex(
            model_name="bloodresultslipid",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="meta_subjec_subject_c41a0b_idx",
            ),
        ),
    ]
Exemplo n.º 9
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0099_auto_20200702_1537'),
    ]

    operations = [
        migrations.CreateModel(
            name='LicensedEnterpriseCourseEnrollment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('license_uuid', models.UUIDField(editable=False)),
                ('enterprise_course_enrollment',
                 models.OneToOneField(
                     help_text=
                     'The course enrollment the associated license is for.',
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='licensed_with',
                     to='enterprise.EnterpriseCourseEnrollment')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HistoricalLicensedEnterpriseCourseEnrollment',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('license_uuid', models.UUIDField(editable=False)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('enterprise_course_enrollment',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'The course enrollment the associated license is for.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCourseEnrollment')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name':
                'historical licensed enterprise course enrollment',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemplo n.º 10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0109_remove_use_enterprise_catalog_sample'),
    ]

    operations = [
        migrations.CreateModel(
            name='MoodleEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('moodle_base_url',
                 models.CharField(
                     help_text='The base URL used for API requests to Moodle',
                     max_length=255,
                     verbose_name='Moodle Base URL')),
                ('service_short_name',
                 models.CharField(
                     help_text='The short name for the Moodle webservice.',
                     max_length=255,
                     verbose_name='Webservice Short Name')),
                ('category_id',
                 models.IntegerField(
                     blank=True,
                     help_text=
                     'The category ID for what edX courses should be associated with.',
                     null=True,
                     verbose_name='Category ID')),
                ('username',
                 models.CharField(
                     blank=True,
                     help_text=
                     "The API user's username used to obtain new tokens.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice Username')),
                ('password',
                 models.CharField(
                     blank=True,
                     help_text=
                     "The API user's password used to obtain new tokens.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice Password')),
                ('token',
                 models.CharField(
                     blank=True,
                     help_text="The user's token for the Moodle webservice.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice User Token')),
                ('enterprise_customer',
                 models.OneToOneField(
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='enterprise.EnterpriseCustomer')),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalMoodleEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('moodle_base_url',
                 models.CharField(
                     help_text='The base URL used for API requests to Moodle',
                     max_length=255,
                     verbose_name='Moodle Base URL')),
                ('service_short_name',
                 models.CharField(
                     help_text='The short name for the Moodle webservice.',
                     max_length=255,
                     verbose_name='Webservice Short Name')),
                ('category_id',
                 models.IntegerField(
                     blank=True,
                     help_text=
                     'The category ID for what edX courses should be associated with.',
                     null=True,
                     verbose_name='Category ID')),
                ('username',
                 models.CharField(
                     blank=True,
                     help_text=
                     "The API user's username used to obtain new tokens.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice Username')),
                ('password',
                 models.CharField(
                     blank=True,
                     help_text=
                     "The API user's password used to obtain new tokens.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice Password')),
                ('token',
                 models.CharField(
                     blank=True,
                     help_text="The user's token for the Moodle webservice.",
                     max_length=255,
                     null=True,
                     verbose_name='Webservice User Token')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('enterprise_customer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCustomer')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name':
                'historical moodle enterprise customer configuration',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):
    dependencies = [
        ('accounts', '0018_auto_20191005_1744'),
    ]

    operations = [
        migrations.AlterField(
            model_name='historicaluser',
            name='account_type',
            field=models.CharField(choices=[('student', 'SchoolStudent'),
                                            ('aonestudent', 'AoneStudent'),
                                            ('teacher', 'Teacher'),
                                            ('school', 'School'),
                                            ('curator', 'Curator'),
                                            ('editor', 'Editor'),
                                            ('super admin', 'Super Admin'),
                                            ('marketer', 'Marketer'),
                                            ('admin', 'Admin')],
                                   max_length=11,
                                   verbose_name='Account Type'),
        ),
        migrations.AlterField(
            model_name='user',
            name='account_type',
            field=models.CharField(choices=[('student', 'SchoolStudent'),
                                            ('aonestudent', 'AoneStudent'),
                                            ('teacher', 'Teacher'),
                                            ('school', 'School'),
                                            ('curator', 'Curator'),
                                            ('editor', 'Editor'),
                                            ('super admin', 'Super Admin'),
                                            ('marketer', 'Marketer'),
                                            ('admin', 'Admin')],
                                   max_length=11,
                                   verbose_name='Account Type'),
        ),
        migrations.CreateModel(
            name='Marketer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('slug',
                 models.SlugField(max_length=200, null=True, unique=True)),
                ('admin',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='marketer',
                                   to='accounts.SuperAdmin')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='marketer_profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalMarketer',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('slug', models.SlugField(max_length=200, null=True)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.TextField(null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('admin',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='accounts.SuperAdmin')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical marketer',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemplo n.º 12
0
class Migration(migrations.Migration):

    dependencies = [
        ("inte_lists", "0007_auto_20200910_1742"),
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("inte_subject", "0053_auto_20200910_2201"),
    ]

    operations = [
        migrations.CreateModel(
            name="ComplicationsFollowup",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.models.validators.date.
                            datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text=
                        "If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name=
                        "Any comments related to status of this CRF",
                    ),
                ),
                (
                    "stroke",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Stroke",
                    ),
                ),
                (
                    "stroke_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "heart_attack",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Heart attack / heart failure",
                    ),
                ),
                (
                    "heart_attack_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "renal_disease",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Renal (kidney) disease",
                    ),
                ),
                (
                    "renal_disease_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "vision",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Vision problems (e.g. blurred vision)",
                    ),
                ),
                (
                    "vision_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "numbness",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Numbness / burning sensation",
                    ),
                ),
                (
                    "numbness_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "foot_ulcers",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Foot ulcers",
                    ),
                ),
                (
                    "foot_ulcers_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "complications",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        max_length=25,
                        verbose_name=
                        "Are there any other major complications to report?",
                    ),
                ),
                (
                    "complications_other",
                    models.TextField(blank=True,
                                     help_text="Please include dates",
                                     null=True),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name":
                "Complications: Followup",
                "verbose_name_plural":
                "Complications: Followup",
                "ordering": ("-modified", "-created"),
                "get_latest_by":
                "modified",
                "abstract":
                False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalComplicationsFollowup",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.models.validators.date.
                            datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "crf_status",
                    models.CharField(
                        choices=[
                            ("INCOMPLETE", "Incomplete (some data pending)"),
                            ("COMPLETE", "Complete"),
                        ],
                        default="INCOMPLETE",
                        help_text=
                        "If some data is still pending, flag this CRF as incomplete",
                        max_length=25,
                        verbose_name="CRF status",
                    ),
                ),
                (
                    "crf_status_comments",
                    models.TextField(
                        blank=True,
                        help_text="for example, why some data is still pending",
                        null=True,
                        verbose_name=
                        "Any comments related to status of this CRF",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "stroke",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Stroke",
                    ),
                ),
                (
                    "stroke_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "heart_attack",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Heart attack / heart failure",
                    ),
                ),
                (
                    "heart_attack_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "renal_disease",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Renal (kidney) disease",
                    ),
                ),
                (
                    "renal_disease_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "vision",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Vision problems (e.g. blurred vision)",
                    ),
                ),
                (
                    "vision_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "numbness",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Numbness / burning sensation",
                    ),
                ),
                (
                    "numbness_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "foot_ulcers",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=25,
                        verbose_name="Foot ulcers",
                    ),
                ),
                (
                    "foot_ulcers_date",
                    models.DateField(
                        blank=True,
                        help_text=
                        "If exact date not known, see SOP on how to estimate a date.",
                        null=True,
                        verbose_name="If yes, date",
                    ),
                ),
                (
                    "complications",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        default="No",
                        max_length=25,
                        verbose_name=
                        "Are there any other major complications to report?",
                    ),
                ),
                (
                    "complications_other",
                    models.TextField(blank=True,
                                     help_text="Please include dates",
                                     null=True),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Complications: Followup",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name="clinicalreview",
            name="complications",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="No",
                help_text="If Yes, complete the `Complications` CRF",
                max_length=15,
                verbose_name=
                "Since last seen, has the patient had any complications",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="historicalclinicalreview",
            name="complications",
            field=models.CharField(
                choices=[("Yes", "Yes"), ("No", "No")],
                default="No",
                help_text="If Yes, complete the `Complications` CRF",
                max_length=15,
                verbose_name=
                "Since last seen, has the patient had any complications",
            ),
            preserve_default=False,
        ),
        migrations.AddIndex(
            model_name="complicationsfollowup",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="inte_subjec_subject_c92cd4_idx",
            ),
        ),
    ]
Exemplo n.º 13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="EmailTemplate",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "title",
                    models.CharField(
                        help_text="The title of the template. This is not included in the template.",
                        max_length=128,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        help_text="The description of the template. This is not included in the template.",
                        null=True,
                    ),
                ),
                (
                    "plaintext_message",
                    models.TextField(
                        help_text="The plain-text alternative. It is important to have this as some e-mail clients won't render HTML e-mails.",
                        null=True,
                    ),
                ),
                (
                    "html_message_as_mjml",
                    models.TextField(
                        validators=[
                            hacktheback.messenger.validators.validate_mjml
                        ]
                    ),
                ),
            ],
            options={
                "ordering": ["-updated_at"],
            },
        ),
        migrations.CreateModel(
            name="Message",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("sender_note", models.TextField(null=True)),
                ("is_test", models.BooleanField(default=False)),
                (
                    "recipients",
                    models.ManyToManyField(
                        related_name="messages", to=settings.AUTH_USER_MODEL
                    ),
                ),
                (
                    "sender",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
        migrations.CreateModel(
            name="HistoricalEmailTemplate",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        db_index=True, default=uuid.uuid4, editable=False
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(blank=True, editable=False),
                ),
                (
                    "updated_at",
                    models.DateTimeField(blank=True, editable=False),
                ),
                (
                    "title",
                    models.CharField(
                        help_text="The title of the template. This is not included in the template.",
                        max_length=128,
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        help_text="The description of the template. This is not included in the template.",
                        null=True,
                    ),
                ),
                (
                    "plaintext_message",
                    models.TextField(
                        help_text="The plain-text alternative. It is important to have this as some e-mail clients won't render HTML e-mails.",
                        null=True,
                    ),
                ),
                (
                    "html_message_as_mjml",
                    models.TextField(
                        validators=[
                            hacktheback.messenger.validators.validate_mjml
                        ]
                    ),
                ),
                (
                    "history_id",
                    models.AutoField(primary_key=True, serialize=False),
                ),
                ("history_date", models.DateTimeField()),
                (
                    "history_change_reason",
                    models.CharField(max_length=100, null=True),
                ),
                (
                    "history_type",
                    models.CharField(
                        choices=[
                            ("+", "Created"),
                            ("~", "Changed"),
                            ("-", "Deleted"),
                        ],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical email template",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="EmailMessage",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("subject", models.CharField(max_length=256)),
                (
                    "metadata",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="email",
                        to="messenger.message",
                    ),
                ),
                (
                    "template",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="messenger.historicalemailtemplate",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
Exemplo n.º 14
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0107_remove_branding_config_banner_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalCanvasEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('canvas_account_id',
                 models.IntegerField(
                     help_text=
                     'Account number to use during api calls. Called account_id in canvas.  Required to create courses etc.',
                     null=True,
                     verbose_name='Canvas Account Number')),
                ('canvas_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Canvas, i.e. https://instructure.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Canvas Base URL')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('enterprise_customer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCustomer')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name':
                'historical canvas enterprise customer configuration',
                'get_latest_by': 'history_date',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='CanvasGlobalConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('change_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Change date')),
                ('enabled',
                 models.BooleanField(default=False, verbose_name='Enabled')),
                ('course_api_path',
                 models.CharField(
                     help_text=
                     'The API path for making course metadata POST/DELETE requests to Canvas.',
                     max_length=255,
                     verbose_name='Course Metadata API Path')),
                ('changed_by',
                 models.ForeignKey(editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Changed by')),
            ],
        ),
        migrations.CreateModel(
            name='CanvasEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('canvas_account_id',
                 models.IntegerField(
                     help_text=
                     'Account number to use during api calls. Called account_id in canvas.  Required to create courses etc.',
                     null=True,
                     verbose_name='Canvas Account Number')),
                ('canvas_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Canvas, i.e. https://instructure.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Canvas Base URL')),
                ('enterprise_customer',
                 models.OneToOneField(
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='enterprise.EnterpriseCustomer')),
            ],
        ),
    ]
Exemplo n.º 15
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("barriers", "0032_auto_20190722_0905"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("interactions", "0003_auto_20190322_1221"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalAssessment",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                (
                    "created_on",
                    models.DateTimeField(blank=True,
                                         db_index=True,
                                         editable=False,
                                         null=True),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False,
                                         null=True),
                ),
                ("archived", models.BooleanField(default=False)),
                ("archived_on", models.DateTimeField(blank=True, null=True)),
                ("archived_reason", models.TextField(blank=True, null=True)),
                (
                    "impact",
                    models.CharField(
                        choices=[
                            ("HIGH", "High"),
                            ("MEDIUMHIGH", "Medium High"),
                            ("MEDIUMLOW", "Medium Low"),
                            ("LOW", "Low"),
                        ],
                        max_length=25,
                    ),
                ),
                ("explanation", models.TextField()),
                ("value_to_economy", models.BigIntegerField(null=True)),
                ("import_market_size", models.BigIntegerField(null=True)),
                ("commercial_value", models.BigIntegerField(null=True)),
                ("is_active", models.BooleanField(default=True)),
                ("history_id",
                 models.AutoField(primary_key=True, serialize=False)),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                ("history_date", models.DateTimeField()),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "archived_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "barrier",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical assessment",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Assessment",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True,
                                         db_index=True,
                                         null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True,
                                                     null=True)),
                ("archived", models.BooleanField(default=False)),
                ("archived_on", models.DateTimeField(blank=True, null=True)),
                ("archived_reason", models.TextField(blank=True, null=True)),
                (
                    "impact",
                    models.CharField(
                        choices=[
                            ("HIGH", "High"),
                            ("MEDIUMHIGH", "Medium High"),
                            ("MEDIUMLOW", "Medium Low"),
                            ("LOW", "Low"),
                        ],
                        max_length=25,
                    ),
                ),
                ("explanation", models.TextField()),
                ("value_to_economy", models.BigIntegerField(null=True)),
                ("import_market_size", models.BigIntegerField(null=True)),
                ("commercial_value", models.BigIntegerField(null=True)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "archived_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "barrier",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "documents",
                    models.ManyToManyField(
                        help_text="assessment documents",
                        related_name="assessment_documents",
                        to="interactions.Document",
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
Exemplo n.º 16
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("barriers", "0020_auto_20181025_1545"),
        ("documents", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Document",
            fields=[
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True, null=True)),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4, primary_key=True, serialize=False
                    ),
                ),
                ("original_filename", models.CharField(max_length=255)),
                ("size", models.IntegerField(null=True)),
                ("mime_type", models.CharField(max_length=255, null=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "document",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="documents.Document",
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.CreateModel(
            name="HistoricalDocument",
            fields=[
                (
                    "created_on",
                    models.DateTimeField(
                        blank=True, db_index=True, editable=False, null=True
                    ),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4)),
                ("original_filename", models.CharField(max_length=255)),
                ("size", models.IntegerField(null=True)),
                ("mime_type", models.CharField(max_length=255, null=True)),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                ("history_date", models.DateTimeField()),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "document",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="documents.Document",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical document",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalInteraction",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(
                        blank=True, db_index=True, editable=False, null=True
                    ),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "kind",
                    models.CharField(choices=[("COMMENT", "Comment")], max_length=25),
                ),
                ("text", models.TextField(null=True)),
                ("pinned", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                ("history_date", models.DateTimeField()),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "barrier",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical interaction",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Interaction",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True, null=True)),
                (
                    "kind",
                    models.CharField(choices=[("COMMENT", "Comment")], max_length=25),
                ),
                ("text", models.TextField(null=True)),
                ("pinned", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "barrier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="interactions_documents",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "documents",
                    models.ManyToManyField(
                        help_text="Interaction documents",
                        related_name="documents",
                        to="interactions.Document",
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
    ]
Exemplo n.º 17
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("meta_subject", "0011_auto_20200118_1854"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalMalariaTest",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the malaria rapid test performed?",
                    ),
                ),
                (
                    "not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                (
                    "diagnostic_type",
                    models.CharField(
                        choices=[
                            ("rapid_test", "Rapid test"),
                            ("microscopy", "Microscopy"),
                        ],
                        max_length=15,
                        verbose_name="Diagnostic performed by ...",
                    ),
                ),
                (
                    "result",
                    models.CharField(
                        choices=[
                            ("present", "Present"),
                            ("absent", "Absent"),
                            ("N/A", "Not Applicable"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name="Result",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Malaria Test",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="MalariaTest",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.
                        utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text=
                        "If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.
                            datetime_not_before_study_start,
                            edc_model.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "performed",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Was the malaria rapid test performed?",
                    ),
                ),
                (
                    "not_performed_reason",
                    models.CharField(
                        blank=True,
                        max_length=150,
                        null=True,
                        verbose_name="If NO, provide reason",
                    ),
                ),
                (
                    "diagnostic_type",
                    models.CharField(
                        choices=[
                            ("rapid_test", "Rapid test"),
                            ("microscopy", "Microscopy"),
                        ],
                        max_length=15,
                        verbose_name="Diagnostic performed by ...",
                    ),
                ),
                (
                    "result",
                    models.CharField(
                        choices=[
                            ("present", "Present"),
                            ("absent", "Absent"),
                            ("N/A", "Not Applicable"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name="Result",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="meta_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Malaria Test",
                "abstract": False,
            },
            managers=[
                ("on_site",
                 django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.RemoveField(
            model_name="malariarapidtest",
            name="site",
        ),
        migrations.RemoveField(
            model_name="malariarapidtest",
            name="subject_visit",
        ),
        migrations.DeleteModel(name="HistoricalMalariaRapidTest", ),
        migrations.DeleteModel(name="MalariaRapidTest", ),
        migrations.AddIndex(
            model_name="malariatest",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="meta_subjec_subject_038dbe_idx",
            ),
        ),
    ]
Exemplo n.º 18
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("inte_subject", "0020_auto_20200729_2240"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalHealthEconomics",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "history_id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "occupation",
                    models.CharField(
                        max_length=50,
                        verbose_name="What is your occupation/profession?",
                    ),
                ),
                (
                    "education_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(30),
                        ],
                        verbose_name="How many years of education did you compete?",
                    ),
                ),
                (
                    "education_certificate",
                    models.CharField(
                        max_length=50,
                        verbose_name="What is your highest education certificate?",
                    ),
                ),
                (
                    "primary_school",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to primary/elementary school?",
                    ),
                ),
                (
                    "primary_school_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "secondary_school",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to secondary school?",
                    ),
                ),
                (
                    "secondary_school_in_years",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "higher_education",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to higher education?",
                    ),
                ),
                (
                    "higher_education_in_years",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "welfare",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Do you receive any welfare or social service support",
                    ),
                ),
                (
                    "income_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you earn (take home) per month?",
                    ),
                ),
                (
                    "household_income_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="What is the total income in your household per month?",
                    ),
                ),
                (
                    "is_highest_earner",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Are you the person who earns the highest income in your household?",
                    ),
                ),
                (
                    "highest_earner",
                    models.CharField(
                        blank=True,
                        max_length=50,
                        null=True,
                        verbose_name="If NO, what is the profession of the person who earns the highest income?",
                    ),
                ),
                (
                    "food_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you/your family spend on food in a month?",
                    ),
                ),
                (
                    "accomodation_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you/your family spend on rent and utilities in a month?",
                    ),
                ),
                (
                    "large_expenditure_year",
                    models.IntegerField(
                        help_text="e.g. furniture, electrical items, cars (in Shilling)",
                        verbose_name="How much have you spent on large items in the last year",
                    ),
                ),
                (
                    "buy_meds_month",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Over the last month, did you get any drugs or have a drug refill?",
                    ),
                ),
                (
                    "diabetic_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        editable=False,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Diabetic drugs",
                    ),
                ),
                (
                    "diabetic_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        editable=False,
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "hypertensive_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Hypertensive drugs",
                    ),
                ),
                (
                    "hypertensive_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "arv_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Antiretroviral drugs",
                    ),
                ),
                (
                    "arv_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "meds_other_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on 'other' drugs",
                    ),
                ),
                (
                    "meds_other_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "expenditure_other_month",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Over the last month, did you spend money on other activities (not drugs) relating to your health?",
                    ),
                ),
                (
                    "expenditure_other_detail",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="If YES, what was the activity",
                    ),
                ),
                (
                    "expenditure_other",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much was spent on other activities (not drugs) relating to your health?",
                    ),
                ),
                (
                    "expenditure_other_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these activities?",
                    ),
                ),
                (
                    "healthcare_expenditure_month",
                    models.IntegerField(
                        verbose_name="How much in total has been spent on your healthcare in the last month?"
                    ),
                ),
                (
                    "routine_activities",
                    models.CharField(
                        choices=[
                            ("working", "Working"),
                            ("studying", "Studying"),
                            ("caring_for_children", "Caring for children"),
                            ("OTHER", "Other, please specify"),
                        ],
                        max_length=25,
                        verbose_name="What would you be doing if you had not come to the hospital?",
                    ),
                ),
                (
                    "routine_activities_other",
                    models.CharField(
                        blank=True,
                        max_length=50,
                        null=True,
                        verbose_name="If OTHER, please specify",
                    ),
                ),
                (
                    "off_work_days",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in days. (1,2,3 etc. If half-day 0.5)",
                        max_digits=4,
                        verbose_name="How much time did you take off work?",
                    ),
                ),
                (
                    "travel_time",
                    models.CharField(
                        help_text="in hours and minutes (format HH:MM)",
                        max_length=5,
                        verbose_name="How long did it take you to reach here?",
                    ),
                ),
                (
                    "hospital_time",
                    models.CharField(
                        help_text="in hours and minutes (format HH:MM)",
                        max_length=5,
                        verbose_name="How much time did you spend at the hospital?",
                    ),
                ),
                (
                    "lost_income",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you lose earnings as a result? ",
                    ),
                ),
                (
                    "lost_income_amount",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        verbose_name="If Yes, how much did you lose?",
                    ),
                ),
                (
                    "childcare",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="Did you ask anyone else, such as your family member, friend to look after your child/children in order to come here?",
                    ),
                ),
                (
                    "childcare_source",
                    models.CharField(
                        choices=[
                            ("N/A", "Not applicable"),
                            ("working", "Working"),
                            ("studying", "Studying"),
                            ("caring_for_children", "Caring for children"),
                            ("house_maintenance", "House maintenance"),
                            ("nothing", "Nothing"),
                            ("OTHER", "Other, specify"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name="If Yes, what would they have been doing if they had not stayed to look after your child or children?",
                    ),
                ),
                (
                    "childcare_source_timeoff",
                    models.DecimalField(
                        blank=True,
                        decimal_places=1,
                        help_text="in days. (1,2,3 etc. If half-day 0.5)",
                        max_digits=4,
                        null=True,
                        verbose_name="How much time did a family member, friend take off work to look after your child or children?",
                    ),
                ),
                (
                    "transport_old",
                    models.CharField(
                        choices=[
                            ("bus", "Bus"),
                            ("train", "Train"),
                            ("ambulance", "Ambulance"),
                            ("private_taxi", "Private taxi"),
                            ("own_bicycle", "Own bicycle"),
                            ("hired_motorbike", "Hired motorbike"),
                            ("own_car", "Own car"),
                            ("own_motorbike", "Own motorbike"),
                            ("hired_bicycle", "Hired bicycle"),
                            ("foot", "Foot"),
                            ("OTHER", "Other, specify"),
                        ],
                        max_length=25,
                        verbose_name="Which form of transport did you take to get to the hospital today?",
                    ),
                ),
                (
                    "transport_cost",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much did you spend on transport in total?",
                    ),
                ),
                (
                    "transport_barter",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you sell anything to pay for your visit today?",
                    ),
                ),
                (
                    "transport_borrow",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you take any loans to pay for your visit?",
                    ),
                ),
                (
                    "health_insurance",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Do you have private healthcare insurance?",
                    ),
                ),
                (
                    "health_insurance_pay",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If Yes, how much do you pay towards your contributions to healthcare insurance every month?",
                    ),
                ),
                ("history_date", models.DateTimeField()),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Health Economics",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HealthEconomics",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django_audit_fields.models.audit_model_mixin.utcnow,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                ("device_created", models.CharField(blank=True, max_length=10)),
                ("device_modified", models.CharField(blank=True, max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "report_datetime",
                    models.DateTimeField(
                        default=edc_utils.date.get_utcnow,
                        help_text="If reporting today, use today's date/time, otherwise use the date/time this information was reported.",
                        validators=[
                            edc_protocol.validators.datetime_not_before_study_start,
                            edc_model.models.validators.date.datetime_not_future,
                        ],
                        verbose_name="Report Date",
                    ),
                ),
                (
                    "consent_model",
                    models.CharField(editable=False, max_length=50, null=True),
                ),
                (
                    "consent_version",
                    models.CharField(editable=False, max_length=10, null=True),
                ),
                (
                    "occupation",
                    models.CharField(
                        max_length=50,
                        verbose_name="What is your occupation/profession?",
                    ),
                ),
                (
                    "education_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(30),
                        ],
                        verbose_name="How many years of education did you compete?",
                    ),
                ),
                (
                    "education_certificate",
                    models.CharField(
                        max_length=50,
                        verbose_name="What is your highest education certificate?",
                    ),
                ),
                (
                    "primary_school",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to primary/elementary school?",
                    ),
                ),
                (
                    "primary_school_in_years",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "secondary_school",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to secondary school?",
                    ),
                ),
                (
                    "secondary_school_in_years",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "higher_education",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you go to higher education?",
                    ),
                ),
                (
                    "higher_education_in_years",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(0),
                            django.core.validators.MaxValueValidator(10),
                        ],
                        verbose_name="If YES, for how many years",
                    ),
                ),
                (
                    "welfare",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Do you receive any welfare or social service support",
                    ),
                ),
                (
                    "income_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you earn (take home) per month?",
                    ),
                ),
                (
                    "household_income_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="What is the total income in your household per month?",
                    ),
                ),
                (
                    "is_highest_earner",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Are you the person who earns the highest income in your household?",
                    ),
                ),
                (
                    "highest_earner",
                    models.CharField(
                        blank=True,
                        max_length=50,
                        null=True,
                        verbose_name="If NO, what is the profession of the person who earns the highest income?",
                    ),
                ),
                (
                    "food_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you/your family spend on food in a month?",
                    ),
                ),
                (
                    "accomodation_per_month",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much do you/your family spend on rent and utilities in a month?",
                    ),
                ),
                (
                    "large_expenditure_year",
                    models.IntegerField(
                        help_text="e.g. furniture, electrical items, cars (in Shilling)",
                        verbose_name="How much have you spent on large items in the last year",
                    ),
                ),
                (
                    "buy_meds_month",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Over the last month, did you get any drugs or have a drug refill?",
                    ),
                ),
                (
                    "diabetic_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        editable=False,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Diabetic drugs",
                    ),
                ),
                (
                    "diabetic_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        editable=False,
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "hypertensive_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Hypertensive drugs",
                    ),
                ),
                (
                    "hypertensive_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "arv_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on Antiretroviral drugs",
                    ),
                ),
                (
                    "arv_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "meds_other_expenditure_month",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much did you spend on 'other' drugs",
                    ),
                ),
                (
                    "meds_other_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these drugs",
                    ),
                ),
                (
                    "expenditure_other_month",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Over the last month, did you spend money on other activities (not drugs) relating to your health?",
                    ),
                ),
                (
                    "expenditure_other_detail",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="If YES, what was the activity",
                    ),
                ),
                (
                    "expenditure_other",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If YES, how much was spent on other activities (not drugs) relating to your health?",
                    ),
                ),
                (
                    "expenditure_other_payee",
                    models.CharField(
                        choices=[
                            ("own_cash", "Own cash"),
                            ("insurance", "Insurance"),
                            ("relative", "Relative of others paying"),
                            ("free", "Free drugs from the pharmacy"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="If YES, how did you pay or who paid for these activities?",
                    ),
                ),
                (
                    "healthcare_expenditure_month",
                    models.IntegerField(
                        verbose_name="How much in total has been spent on your healthcare in the last month?"
                    ),
                ),
                (
                    "routine_activities",
                    models.CharField(
                        choices=[
                            ("working", "Working"),
                            ("studying", "Studying"),
                            ("caring_for_children", "Caring for children"),
                            ("OTHER", "Other, please specify"),
                        ],
                        max_length=25,
                        verbose_name="What would you be doing if you had not come to the hospital?",
                    ),
                ),
                (
                    "routine_activities_other",
                    models.CharField(
                        blank=True,
                        max_length=50,
                        null=True,
                        verbose_name="If OTHER, please specify",
                    ),
                ),
                (
                    "off_work_days",
                    models.DecimalField(
                        decimal_places=1,
                        help_text="in days. (1,2,3 etc. If half-day 0.5)",
                        max_digits=4,
                        verbose_name="How much time did you take off work?",
                    ),
                ),
                (
                    "travel_time",
                    models.CharField(
                        help_text="in hours and minutes (format HH:MM)",
                        max_length=5,
                        verbose_name="How long did it take you to reach here?",
                    ),
                ),
                (
                    "hospital_time",
                    models.CharField(
                        help_text="in hours and minutes (format HH:MM)",
                        max_length=5,
                        verbose_name="How much time did you spend at the hospital?",
                    ),
                ),
                (
                    "lost_income",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you lose earnings as a result? ",
                    ),
                ),
                (
                    "lost_income_amount",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        verbose_name="If Yes, how much did you lose?",
                    ),
                ),
                (
                    "childcare",
                    models.CharField(
                        choices=[
                            ("Yes", "Yes"),
                            ("No", "No"),
                            ("N/A", "Not applicable"),
                        ],
                        max_length=15,
                        verbose_name="Did you ask anyone else, such as your family member, friend to look after your child/children in order to come here?",
                    ),
                ),
                (
                    "childcare_source",
                    models.CharField(
                        choices=[
                            ("N/A", "Not applicable"),
                            ("working", "Working"),
                            ("studying", "Studying"),
                            ("caring_for_children", "Caring for children"),
                            ("house_maintenance", "House maintenance"),
                            ("nothing", "Nothing"),
                            ("OTHER", "Other, specify"),
                        ],
                        default="N/A",
                        max_length=25,
                        verbose_name="If Yes, what would they have been doing if they had not stayed to look after your child or children?",
                    ),
                ),
                (
                    "childcare_source_timeoff",
                    models.DecimalField(
                        blank=True,
                        decimal_places=1,
                        help_text="in days. (1,2,3 etc. If half-day 0.5)",
                        max_digits=4,
                        null=True,
                        verbose_name="How much time did a family member, friend take off work to look after your child or children?",
                    ),
                ),
                (
                    "transport_old",
                    models.CharField(
                        choices=[
                            ("bus", "Bus"),
                            ("train", "Train"),
                            ("ambulance", "Ambulance"),
                            ("private_taxi", "Private taxi"),
                            ("own_bicycle", "Own bicycle"),
                            ("hired_motorbike", "Hired motorbike"),
                            ("own_car", "Own car"),
                            ("own_motorbike", "Own motorbike"),
                            ("hired_bicycle", "Hired bicycle"),
                            ("foot", "Foot"),
                            ("OTHER", "Other, specify"),
                        ],
                        max_length=25,
                        verbose_name="Which form of transport did you take to get to the hospital today?",
                    ),
                ),
                (
                    "transport_cost",
                    models.IntegerField(
                        help_text="in Shilling",
                        verbose_name="How much did you spend on transport in total?",
                    ),
                ),
                (
                    "transport_barter",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you sell anything to pay for your visit today?",
                    ),
                ),
                (
                    "transport_borrow",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Did you take any loans to pay for your visit?",
                    ),
                ),
                (
                    "health_insurance",
                    models.CharField(
                        choices=[("Yes", "Yes"), ("No", "No")],
                        max_length=15,
                        verbose_name="Do you have private healthcare insurance?",
                    ),
                ),
                (
                    "health_insurance_pay",
                    models.IntegerField(
                        blank=True,
                        help_text="in Shilling",
                        null=True,
                        verbose_name="If Yes, how much do you pay towards your contributions to healthcare insurance every month?",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="sites.Site",
                    ),
                ),
                (
                    "subject_visit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="inte_subject.SubjectVisit",
                    ),
                ),
            ],
            options={
                "verbose_name": "Health Economics",
                "verbose_name_plural": "Health Economics",
                "ordering": ("-modified", "-created"),
                "get_latest_by": "modified",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
            },
            managers=[
                ("on_site", django.contrib.sites.managers.CurrentSiteManager()),
                ("objects", edc_visit_tracking.managers.CrfModelManager()),
            ],
        ),
        migrations.AddIndex(
            model_name="healtheconomics",
            index=models.Index(
                fields=["subject_visit", "site", "id"],
                name="inte_subjec_subject_db3803_idx",
            ),
        ),
    ]
Exemplo n.º 19
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0113_auto_20200914_2054'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalBlackboardEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('blackboard_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Blackboard, i.e. https://blackboard.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Base URL')),
                ('refresh_token',
                 models.CharField(
                     blank=True,
                     help_text=
                     'The refresh token provided by Blackboard along with the access token request,used to re-request the access tokens over multiple client sessions.',
                     max_length=255,
                     verbose_name='Oauth2 Refresh Token')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('enterprise_customer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCustomer')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by':
                'history_date',
                'verbose_name':
                'historical blackboard enterprise customer configuration',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='BlackboardEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('blackboard_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Blackboard, i.e. https://blackboard.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Base URL')),
                ('refresh_token',
                 models.CharField(
                     blank=True,
                     help_text=
                     'The refresh token provided by Blackboard along with the access token request,used to re-request the access tokens over multiple client sessions.',
                     max_length=255,
                     verbose_name='Oauth2 Refresh Token')),
                ('enterprise_customer',
                 models.OneToOneField(
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='enterprise.EnterpriseCustomer')),
            ],
        ),
    ]
Exemplo n.º 20
0
class Migration(migrations.Migration):
    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("auth", "0011_update_proxy_permissions"),
        ("workstation_configs", "0001_squashed_0008_auto_20201001_0758"),
    ]

    operations = [
        migrations.CreateModel(
            name="Workstation",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="title"),
                ),
                (
                    "description",
                    models.TextField(blank=True,
                                     null=True,
                                     verbose_name="description"),
                ),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        populate_from="title",
                        verbose_name="slug",
                    ),
                ),
                (
                    "logo",
                    models.ImageField(
                        storage=grandchallenge.core.storage.PublicS3Storage(),
                        upload_to=grandchallenge.core.storage.get_logo_path,
                    ),
                ),
                (
                    "editors_group",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="editors_of_workstation",
                        to="auth.group",
                    ),
                ),
                (
                    "users_group",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="users_of_workstation",
                        to="auth.group",
                    ),
                ),
                (
                    "config",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="workstation_configs.workstationconfig",
                    ),
                ),
                (
                    "public",
                    models.BooleanField(
                        default=False,
                        help_text=
                        "If True, all logged in users can use this workstation, otherwise, only the users group can use this workstation.",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "title")
            },
        ),
        migrations.CreateModel(
            name="WorkstationImage",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "staged_image_uuid",
                    models.UUIDField(blank=True, editable=False, null=True),
                ),
                (
                    "image",
                    models.FileField(
                        blank=True,
                        help_text=
                        ".tar.xz archive of the container image produced from the command 'docker save IMAGE | xz -c > IMAGE.tar.xz'. See https://docs.docker.com/engine/reference/commandline/save/",
                        storage=grandchallenge.core.storage.PrivateS3Storage(),
                        upload_to=grandchallenge.components.models.
                        docker_image_path,
                        validators=[
                            grandchallenge.core.validators.ExtensionValidator(
                                allowed_extensions=(
                                    ".tar",
                                    ".tar.gz",
                                    ".tar.xz",
                                ))
                        ],
                    ),
                ),
                (
                    "image_sha256",
                    models.CharField(editable=False, max_length=71),
                ),
                (
                    "ready",
                    models.BooleanField(
                        default=False,
                        editable=False,
                        help_text="Is this image ready to be used?",
                    ),
                ),
                ("status", models.TextField(editable=False)),
                ("requires_gpu", models.BooleanField(default=False)),
                (
                    "requires_gpu_memory_gb",
                    models.PositiveIntegerField(default=4),
                ),
                ("requires_memory_gb", models.PositiveIntegerField(default=4)),
                (
                    "requires_cpu_cores",
                    models.DecimalField(decimal_places=2,
                                        default=Decimal("1.0"),
                                        max_digits=4),
                ),
                (
                    "http_port",
                    models.PositiveIntegerField(
                        default=8080,
                        validators=[
                            django.core.validators.MaxValueValidator(65535)
                        ],
                    ),
                ),
                (
                    "websocket_port",
                    models.PositiveIntegerField(
                        default=4114,
                        validators=[
                            django.core.validators.MaxValueValidator(65535)
                        ],
                    ),
                ),
                (
                    "initial_path",
                    models.CharField(
                        default="cirrus",
                        max_length=256,
                        validators=[
                            django.core.validators.RegexValidator(
                                message=
                                "This path is invalid, it must not start with a /",
                                regex="^(?:[^/][^\\s]*)\\Z",
                            )
                        ],
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="workstations.workstation",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "creator")
            },
        ),
        migrations.CreateModel(
            name="HistoricalSession",
            fields=[
                (
                    "id",
                    models.UUIDField(db_index=True,
                                     default=uuid.uuid4,
                                     editable=False),
                ),
                ("created", models.DateTimeField(blank=True, editable=False)),
                ("modified", models.DateTimeField(blank=True, editable=False)),
                (
                    "status",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Queued"),
                            (1, "Started"),
                            (2, "Running"),
                            (3, "Failed"),
                            (4, "Stopped"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "maximum_duration",
                    models.DurationField(default=datetime.timedelta(
                        seconds=600)),
                ),
                ("user_finished", models.BooleanField(default=False)),
                (
                    "history_id",
                    models.AutoField(primary_key=True, serialize=False),
                ),
                ("history_date", models.DateTimeField()),
                (
                    "history_change_reason",
                    models.CharField(max_length=100, null=True),
                ),
                (
                    "history_type",
                    models.CharField(
                        choices=[
                            ("+", "Created"),
                            ("~", "Changed"),
                            ("-", "Deleted"),
                        ],
                        max_length=1,
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation_image",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="workstations.workstationimage",
                    ),
                ),
                (
                    "region",
                    models.CharField(
                        choices=[
                            ("af-south-1", "Africa (Cape Town)"),
                            ("ap-east-1", "Asia Pacific (Hong Kong)"),
                            ("ap-northeast-1", "Asia Pacific (Tokyo)"),
                            ("ap-northeast-2", "Asia Pacific (Seoul)"),
                            ("ap-northeast-3", "Asia Pacific (Osaka-Local)"),
                            ("ap-south-1", "Asia Pacific (Mumbai)"),
                            ("ap-southeast-1", "Asia Pacific (Singapore)"),
                            ("ap-southeast-2", "Asia Pacific (Sydney)"),
                            ("ca-central-1", "Canada (Central)"),
                            ("eu-central-1", "Europe (Frankfurt)"),
                            ("eu-north-1", "Europe (Stockholm)"),
                            ("eu-south-1", "Europe (Milan)"),
                            ("eu-west-1", "Europe (Ireland)"),
                            ("eu-west-2", "Europe (London)"),
                            ("eu-west-3", "Europe (Paris)"),
                            ("me-south-1", "Middle East (Bahrain)"),
                            ("sa-east-1", "South America (São Paulo)"),
                            ("us-east-1", "US East (N. Virginia)"),
                            ("us-east-2", "US East (Ohio)"),
                            ("us-west-1", "US West (N. California)"),
                            ("us-west-2", "US West (Oregon)"),
                            ("eu-nl-1", "Netherlands (Nijmegen)"),
                            ("eu-nl-2", "Netherlands (Amsterdam)"),
                        ],
                        default="eu-nl-1",
                        help_text="Which region is this session available in?",
                        max_length=14,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical session",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Session",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "status",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Queued"),
                            (1, "Started"),
                            (2, "Running"),
                            (3, "Failed"),
                            (4, "Stopped"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "maximum_duration",
                    models.DurationField(default=datetime.timedelta(
                        seconds=600)),
                ),
                ("user_finished", models.BooleanField(default=False)),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation_image",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="workstations.workstationimage",
                    ),
                ),
                ("logs", models.TextField(blank=True, editable=False)),
                (
                    "region",
                    models.CharField(
                        choices=[
                            ("af-south-1", "Africa (Cape Town)"),
                            ("ap-east-1", "Asia Pacific (Hong Kong)"),
                            ("ap-northeast-1", "Asia Pacific (Tokyo)"),
                            ("ap-northeast-2", "Asia Pacific (Seoul)"),
                            ("ap-northeast-3", "Asia Pacific (Osaka-Local)"),
                            ("ap-south-1", "Asia Pacific (Mumbai)"),
                            ("ap-southeast-1", "Asia Pacific (Singapore)"),
                            ("ap-southeast-2", "Asia Pacific (Sydney)"),
                            ("ca-central-1", "Canada (Central)"),
                            ("eu-central-1", "Europe (Frankfurt)"),
                            ("eu-north-1", "Europe (Stockholm)"),
                            ("eu-south-1", "Europe (Milan)"),
                            ("eu-west-1", "Europe (Ireland)"),
                            ("eu-west-2", "Europe (London)"),
                            ("eu-west-3", "Europe (Paris)"),
                            ("me-south-1", "Middle East (Bahrain)"),
                            ("sa-east-1", "South America (São Paulo)"),
                            ("us-east-1", "US East (N. Virginia)"),
                            ("us-east-2", "US East (Ohio)"),
                            ("us-west-1", "US West (N. California)"),
                            ("us-west-2", "US West (Oregon)"),
                            ("eu-nl-1", "Netherlands (Nijmegen)"),
                            ("eu-nl-2", "Netherlands (Amsterdam)"),
                        ],
                        default="eu-nl-1",
                        help_text="Which region is this session available in?",
                        max_length=14,
                    ),
                ),
                ("ping_times", models.JSONField(default=None, null=True)),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "creator")
            },
        ),
    ]
Exemplo n.º 21
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('project', '0001_initial'),
        ('resources', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AttributeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalSubscription',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('quantity', models.IntegerField(default=1)),
                ('active_until', models.DateField(blank=True, null=True)),
                ('justification', models.TextField()),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('project', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project.Project')),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical subscription',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalSubscriptionAttribute',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('value', models.CharField(max_length=128)),
                ('is_private', models.BooleanField(default=True)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical subscription attribute',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalSubscriptionAttributeType',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=50)),
                ('has_usage', models.BooleanField(default=False)),
                ('is_required', models.BooleanField(default=False)),
                ('is_unique', models.BooleanField(default=False)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('attribute_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.AttributeType')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical subscription attribute type',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalSubscriptionAttributeUsage',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('value', models.FloatField(default=0)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical subscription attribute usage',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalSubscriptionUser',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical subscription user',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('quantity', models.IntegerField(default=1)),
                ('active_until', models.DateField(blank=True, null=True)),
                ('justification', models.TextField()),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='project.Project')),
                ('resources', models.ManyToManyField(to='resources.Resource')),
            ],
            options={
                'permissions': (('can_view_all_subscriptions', 'Can see all subscriptions'), ('can_review_subscription_requests', 'Can review subscription requests')),
                'ordering': ['active_until'],
            },
        ),
        migrations.CreateModel(
            name='SubscriptionAdminComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('comment', models.TextField()),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.Subscription')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SubscriptionAttribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('value', models.CharField(max_length=128)),
                ('is_private', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SubscriptionAttributeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=50)),
                ('has_usage', models.BooleanField(default=False)),
                ('is_required', models.BooleanField(default=False)),
                ('is_unique', models.BooleanField(default=False)),
                ('attribute_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.AttributeType')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SubscriptionStatusChoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SubscriptionUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
            ],
            options={
                'verbose_name_plural': 'Subscription User Status',
            },
        ),
        migrations.CreateModel(
            name='SubscriptionUserMessage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('message', models.TextField()),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.Subscription')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SubscriptionUserStatusChoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SubscriptionAttributeUsage',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('subscription_attribute', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='subscription.SubscriptionAttribute')),
                ('value', models.FloatField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='subscriptionuser',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.SubscriptionUserStatusChoice', verbose_name='Subscription User Status'),
        ),
        migrations.AddField(
            model_name='subscriptionuser',
            name='subscription',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.Subscription'),
        ),
        migrations.AddField(
            model_name='subscriptionuser',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='subscriptionattribute',
            name='subscription',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.Subscription'),
        ),
        migrations.AddField(
            model_name='subscriptionattribute',
            name='subscription_attribute_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.SubscriptionAttributeType'),
        ),
        migrations.AddField(
            model_name='subscription',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subscription.SubscriptionStatusChoice', verbose_name='Status'),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionuser',
            name='status',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.SubscriptionUserStatusChoice'),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionuser',
            name='subscription',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.Subscription'),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionuser',
            name='user',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionattributeusage',
            name='subscription_attribute',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.SubscriptionAttribute'),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionattribute',
            name='subscription',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.Subscription'),
        ),
        migrations.AddField(
            model_name='historicalsubscriptionattribute',
            name='subscription_attribute_type',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.SubscriptionAttributeType'),
        ),
        migrations.AddField(
            model_name='historicalsubscription',
            name='status',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscription.SubscriptionStatusChoice'),
        ),
        migrations.AlterUniqueTogether(
            name='subscriptionuser',
            unique_together={('user', 'subscription')},
        ),
    ]