# Generated by Django 5.0.14 on 2026-07-27 17:36 import uuid from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="AccessGrant", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "grant_scope", models.TextField( choices=[ ("global", "Global"), ("beneficiary", "Beneficiary"), ("care_period", "Care Period"), ("task", "Task"), ] ), ), ("granted_at", models.DateTimeField(auto_now_add=True)), ("revoked_at", models.DateTimeField(blank=True, null=True)), ], ), migrations.CreateModel( name="Beneficiary", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("first_name", models.TextField()), ("middle_name", models.TextField(blank=True, null=True)), ("last_name", models.TextField()), ("dob", models.DateField()), ( "sex", models.TextField( choices=[ ("male", "Male"), ("female", "Female"), ("other", "Other"), ("unknown", "Unknown"), ] ), ), ("is_synthetic", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name="BeneficiaryIdentifier", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "identifier_type", models.TextField( choices=[ ("email", "Email"), ("phone", "Phone"), ("address", "Address"), ("mbi", "MBI"), ("cms_id", "CMS ID"), ] ), ), ("identifier_value", models.TextField()), ("identifier_metadata", models.JSONField(blank=True, null=True)), ("is_primary", models.BooleanField(default=False)), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="ExternalSystemIdentifier", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "system_name", models.TextField( choices=[ ("healthie", "Healthie"), ("cognito", "Cognito"), ("cms", "CMS"), ("labcorp", "Labcorp"), ("quest", "Quest"), ] ), ), ("external_id", models.TextField()), ( "entity_type", models.TextField( choices=[ ("patient", "Patient"), ("account", "Account"), ("form_submission", "Form Submission"), ] ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="PatientConsent", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "consent_type", models.TextField( choices=[ ("data_sharing", "Data Sharing"), ("participation", "Participation"), ("withdrawal", "Withdrawal"), ("notice_acknowledgment", "Notice Acknowledgment"), ("cms_data_sharing", "CMS Data Sharing"), ] ), ), ( "status", models.TextField( choices=[ ("pending", "Pending"), ("granted", "Granted"), ("declined", "Declined"), ("withdrawn", "Withdrawn"), ], default="pending", ), ), ("granted_at", models.DateTimeField(blank=True, null=True)), ("withdrawn_at", models.DateTimeField(blank=True, null=True)), ("withdrawal_reason", models.TextField(blank=True, null=True)), ("notice_provided", models.BooleanField(default=False)), ("notice_provided_at", models.DateTimeField(blank=True, null=True)), ( "data_sharing_scope", models.TextField( blank=True, choices=[ ("cms_only", "CMS Only"), ("metaflow_only", "MetaFlow Only"), ("cms_and_metaflow", "CMS and MetaFlow"), ("all_providers", "All Providers"), ], null=True, ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="Role", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "role_name", models.TextField( choices=[ ("owner", "Owner"), ("contractor", "Contractor"), ("data_assistant", "Data Assistant"), ("clinical_reviewer", "Clinical Reviewer"), ("physician_reviewer", "Physician Reviewer"), ("offshore_reviewer", "Offshore Reviewer"), ("patient", "Patient"), ("admin", "Admin"), ("technical_tester", "Technical Tester"), ], unique=True, ), ), ("description", models.TextField(blank=True, null=True)), ("is_active", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="RolePermission", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("resource", models.TextField()), ( "permission", models.TextField( choices=[ ("view", "View"), ("create", "Create"), ("edit", "Edit"), ("approve", "Approve"), ("export", "Export"), ("delete", "Delete"), ] ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="User", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("email", models.TextField(unique=True)), ("full_name", models.TextField()), ("is_active", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("last_login_at", models.DateTimeField(blank=True, null=True)), ], options={ "ordering": ["created_at"], }, ), migrations.CreateModel( name="UserRole", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("assigned_at", models.DateTimeField(auto_now_add=True)), ("revoked_at", models.DateTimeField(blank=True, null=True)), ], ), ]