# Generated by Django 5.0.14 on 2026-07-27 17:36 import uuid import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("identity", "0001_initial"), ] operations = [ migrations.CreateModel( name="IntakeRecord", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("external_form_id", models.TextField()), ("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)), ( "status", models.TextField( choices=[ ("prospective", "Prospective"), ("intake_in_progress", "Intake In Progress"), ("pending_clinical_review", "Pending Clinical Review"), ("pending_cms_eligibility", "Pending CMS Eligibility"), ("pending_consent", "Pending Consent"), ("pending_alignment", "Pending Alignment"), ("active_access_beneficiary", "Active ACCESS Beneficiary"), ("rejected", "Rejected"), ("withdrawn", "Withdrawn"), ("inactive", "Inactive"), ], default="prospective", ), ), ("submitted_at", models.DateTimeField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ], options={ "ordering": ["-created_at"], }, ), migrations.CreateModel( name="IntakeIdentifier", 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"), ] ), ), ("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)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="identifiers", to="intake.intakerecord", ), ), ], ), migrations.CreateModel( name="IntakeReviewStatus", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "status", models.TextField( choices=[ ("new", "New"), ("under_review", "Under Review"), ("approved", "Approved"), ("rejected", "Rejected"), ("needs_more_info", "Needs More Info"), ], default="new", ), ), ("reviewed_at", models.DateTimeField(blank=True, null=True)), ("notes", models.TextField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="review_statuses", to="intake.intakerecord", ), ), ( "reviewed_by", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="identity.user", ), ), ], ), migrations.CreateModel( name="ParticipationReadiness", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("acknowledged", models.BooleanField(default=False)), ( "status", models.TextField( choices=[ ("acknowledged", "Acknowledged"), ("pending", "Pending"), ("declined", "Declined"), ], default="pending", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, related_name="participation_readiness", to="intake.intakerecord", ), ), ], ), migrations.CreateModel( name="RawIngestionRecord", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ( "source_system", models.TextField( choices=[ ("cognito", "Cognito"), ("healthie", "Healthie"), ("lab_feed", "Lab Feed"), ("patient_upload", "Patient Upload"), ("prom_form", "PROM Form"), ("cms_api", "CMS API"), ("webhook", "Webhook"), ("polling_reconciliation", "Polling Reconciliation"), ] ), ), ("source_record_id", models.TextField(unique=True)), ("raw_payload", models.JSONField()), ("webhook_signature_valid", models.BooleanField(blank=True, null=True)), ( "processing_status", models.TextField( choices=[ ("received", "Received"), ("queued", "Queued"), ("processing", "Processing"), ("normalized", "Normalized"), ("failed", "Failed"), ("dead_letter", "Dead Letter"), ], default="received", ), ), ("form_version", models.TextField(blank=True, null=True)), ("ingested_at", models.DateTimeField(auto_now_add=True)), ( "beneficiary", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="beneficiary_raw_ingestions", to="identity.beneficiary", ), ), ( "intake_record", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="raw_ingestions", to="intake.intakerecord", ), ), ], options={ "ordering": ["-ingested_at"], }, ), migrations.CreateModel( name="IntakeMSK", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("pain_locations", models.TextField(blank=True, null=True)), ("msk_diagnoses", models.TextField(blank=True, null=True)), ("injury_history", models.TextField(blank=True, null=True)), ("functional_impact", models.TextField(blank=True, null=True)), ("pain_quality", models.TextField(blank=True, null=True)), ("pain_duration", models.TextField(blank=True, null=True)), ("pain_severity", models.FloatField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="msk", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="msk", to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="IntakeMaleHealth", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("prostate_conditions", models.TextField(blank=True, null=True)), ("sexual_function", models.TextField(blank=True, null=True)), ("ejaculation_concerns", models.TextField(blank=True, null=True)), ( "perineal_testicular_symptoms", models.TextField(blank=True, null=True), ), ("pelvic_surgery", models.TextField(blank=True, null=True)), ("fertility_status", models.TextField(blank=True, null=True)), ("free_text", models.TextField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="male_health", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="male_health", to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="IntakeLifestyle", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("weight_lbs", models.FloatField(blank=True, null=True)), ( "waist_circumference_inches", models.FloatField(blank=True, null=True), ), ("height_inches", models.FloatField(blank=True, null=True)), ("bmi", models.FloatField(blank=True, null=True)), ("weight_change_6mo", models.TextField(blank=True, null=True)), ("weight_control_patterns", models.TextField(blank=True, null=True)), ("activity_level", models.TextField(blank=True, null=True)), ("activity_types", models.TextField(blank=True, null=True)), ("post_activity_response", models.TextField(blank=True, null=True)), ("digestive_patterns", models.TextField(blank=True, null=True)), ("diet_patterns", models.TextField(blank=True, null=True)), ("digestive_conditions", models.TextField(blank=True, null=True)), ("bowel_patterns", models.TextField(blank=True, null=True)), ("urination_patterns", models.TextField(blank=True, null=True)), ("hemorrhoids", models.TextField(blank=True, null=True)), ("sleep_quality", models.TextField(blank=True, null=True)), ("stress_emotional_state", models.TextField(blank=True, null=True)), ("sweating_patterns", models.TextField(blank=True, null=True)), ("skin_patterns", models.TextField(blank=True, null=True)), ("skin_longterm_meds", models.TextField(blank=True, null=True)), ( "mouth_throat_ear_eye_symptoms", models.JSONField(blank=True, null=True), ), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="lifestyle", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="intake_lifestyle", to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="IntakeFemaleHealth", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("menstrual_status", models.TextField(blank=True, null=True)), ("menstrual_flow", models.TextField(blank=True, null=True)), ("menstrual_blood_color", models.TextField(blank=True, null=True)), ("menstrual_clots_cramps", models.TextField(blank=True, null=True)), ("discharge_discomfort", models.TextField(blank=True, null=True)), ("diagnosed_conditions", models.TextField(blank=True, null=True)), ("free_text", models.TextField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="female_health", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="female_health", to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="IntakeAssessment", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("primary_concerns", models.TextField(blank=True, null=True)), ("other_concerns", models.TextField(blank=True, null=True)), ("symptom_duration", models.TextField(blank=True, null=True)), ("primary_symptoms", models.TextField(blank=True, null=True)), ("medical_conditions", models.TextField(blank=True, null=True)), ( "infection_immune_conditions", models.TextField(blank=True, null=True), ), ("autoimmune_conditions", models.TextField(blank=True, null=True)), ("conditions_active", models.BooleanField(blank=True, null=True)), ("medications", models.TextField(blank=True, null=True)), ("medication_details", models.TextField(blank=True, null=True)), ("medications_list", models.TextField(blank=True, null=True)), ("allergies", models.TextField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="assessments", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="intake_assessments", to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="FormSubmissionEvent", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("submitted_at", models.DateTimeField(blank=True, null=True)), ("form_version", models.TextField(blank=True, null=True)), ( "source_system", models.TextField( choices=[ ("cognito", "Cognito"), ("healthie", "Healthie"), ("manual", "Manual"), ] ), ), ( "status", models.TextField( choices=[ ("submitted", "Submitted"), ("processing", "Processing"), ("normalized", "Normalized"), ("failed", "Failed"), ], default="submitted", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="form_submission_events", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to="intake.rawingestionrecord", ), ), ], ), migrations.CreateModel( name="SafetyScreening", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("safety_stop_applies", models.BooleanField(default=False)), ("exclusion_flags", models.TextField(blank=True, null=True)), ( "screening_status", models.TextField( choices=[ ("passed", "Passed"), ("failed", "Failed"), ("flagged", "Flagged"), ("needs_review", "Needs Review"), ], default="needs_review", ), ), ("free_text", models.TextField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "intake_record", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="safety_screening", to="intake.intakerecord", ), ), ( "raw_ingestion", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name="safety_screening", to="intake.rawingestionrecord", ), ), ], ), ]