





















const db = require('../models');
const Users = db.users;






const Accounts = db.accounts;

const Patients = db.patients;

const PatientAccessGrants = db.patient_access_grants;

const Medications = db.medications;

const MedicationSchedules = db.medication_schedules;

const CalendarEvents = db.calendar_events;

const Reminders = db.reminders;

const CognitivePrograms = db.cognitive_programs;

const CognitiveExercises = db.cognitive_exercises;

const CognitiveSessions = db.cognitive_sessions;

const CognitiveAttempts = db.cognitive_attempts;

const StageAssessments = db.stage_assessments;

const VoiceAssistantSessions = db.voice_assistant_sessions;

const IotDevices = db.iot_devices;

const IotTelemetryEvents = db.iot_telemetry_events;

const Geofences = db.geofences;

const Alerts = db.alerts;

const AlertNotifications = db.alert_notifications;

const SharedDashboardPosts = db.shared_dashboard_posts;

const ScientificArticles = db.scientific_articles;

const ArticleRecommendations = db.article_recommendations;

const ClinicalReports = db.clinical_reports;

const AdminMetricsSnapshots = db.admin_metrics_snapshots;







const AccountsData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
];



const PatientsData = [
    
    {
    
        
        
            
                "patient_code": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Ada Lovelace",
            
        
    
        
        
            
                "last_name": "Alan Turing",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "sex": "unknown",
            
        
    
        
        
            
                "disease_stage": "moderate",
            
        
    
        
        
            
                "diagnosis_date": new Date(Date.now()),
            
        
    
        
        
            
                "medical_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "patient_code": "Grace Hopper",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Alan Turing",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "sex": "female",
            
        
    
        
        
            
                "disease_stage": "moderate",
            
        
    
        
        
            
                "diagnosis_date": new Date(Date.now()),
            
        
    
        
        
            
                "medical_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "patient_code": "Grace Hopper",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Ada Lovelace",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "sex": "male",
            
        
    
        
        
            
                "disease_stage": "mild",
            
        
    
        
        
            
                "diagnosis_date": new Date(Date.now()),
            
        
    
        
        
            
                "medical_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "patient_code": "Alan Turing",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Alan Turing",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "sex": "unknown",
            
        
    
        
        
            
                "disease_stage": "severe",
            
        
    
        
        
            
                "diagnosis_date": new Date(Date.now()),
            
        
    
        
        
            
                "medical_notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "patient_code": "Marie Curie",
            
        
    
        
        
            
                "first_name": "Marie Curie",
            
        
    
        
        
            
                "last_name": "Ada Lovelace",
            
        
    
        
        
            
                "date_of_birth": new Date(Date.now()),
            
        
    
        
        
            
                "sex": "unknown",
            
        
    
        
        
            
                "disease_stage": "moderate",
            
        
    
        
        
            
                "diagnosis_date": new Date(Date.now()),
            
        
    
        
        
            
                "medical_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PatientAccessGrantsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "access_level": "clinician",
            
        
    
        
        
            
                "can_view_iot_location": true,
            
        
    
        
        
            
                "can_manage_medications": true,
            
        
    
        
        
            
                "can_manage_calendar": false,
            
        
    
        
        
            
                "can_view_health_data": false,
            
        
    
        
        
            
                "granted_at": new Date(Date.now()),
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "access_level": "clinician",
            
        
    
        
        
            
                "can_view_iot_location": false,
            
        
    
        
        
            
                "can_manage_medications": false,
            
        
    
        
        
            
                "can_manage_calendar": false,
            
        
    
        
        
            
                "can_view_health_data": true,
            
        
    
        
        
            
                "granted_at": new Date(Date.now()),
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "access_level": "owner",
            
        
    
        
        
            
                "can_view_iot_location": false,
            
        
    
        
        
            
                "can_manage_medications": false,
            
        
    
        
        
            
                "can_manage_calendar": false,
            
        
    
        
        
            
                "can_view_health_data": false,
            
        
    
        
        
            
                "granted_at": new Date(Date.now()),
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "access_level": "owner",
            
        
    
        
        
            
                "can_view_iot_location": false,
            
        
    
        
        
            
                "can_manage_medications": true,
            
        
    
        
        
            
                "can_manage_calendar": false,
            
        
    
        
        
            
                "can_view_health_data": false,
            
        
    
        
        
            
                "granted_at": new Date(Date.now()),
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "access_level": "clinician",
            
        
    
        
        
            
                "can_view_iot_location": false,
            
        
    
        
        
            
                "can_manage_medications": false,
            
        
    
        
        
            
                "can_manage_calendar": true,
            
        
    
        
        
            
                "can_view_health_data": true,
            
        
    
        
        
            
                "granted_at": new Date(Date.now()),
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MedicationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medication_name": "Grace Hopper",
            
        
    
        
        
            
                "dosage": "Ada Lovelace",
            
        
    
        
        
            
                "route": "Marie Curie",
            
        
    
        
        
            
                "instructions": "Grace Hopper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medication_name": "Ada Lovelace",
            
        
    
        
        
            
                "dosage": "Marie Curie",
            
        
    
        
        
            
                "route": "Ada Lovelace",
            
        
    
        
        
            
                "instructions": "Ada Lovelace",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medication_name": "Grace Hopper",
            
        
    
        
        
            
                "dosage": "Grace Hopper",
            
        
    
        
        
            
                "route": "Ada Lovelace",
            
        
    
        
        
            
                "instructions": "Grace Hopper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medication_name": "Ada Lovelace",
            
        
    
        
        
            
                "dosage": "Ada Lovelace",
            
        
    
        
        
            
                "route": "Grace Hopper",
            
        
    
        
        
            
                "instructions": "Grace Hopper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "medication_name": "Alan Turing",
            
        
    
        
        
            
                "dosage": "Grace Hopper",
            
        
    
        
        
            
                "route": "Ada Lovelace",
            
        
    
        
        
            
                "instructions": "Ada Lovelace",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MedicationSchedulesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "frequency_type": "daily",
            
        
    
        
        
            
                "time_of_day": "Marie Curie",
            
        
    
        
        
            
                "days_of_week": "Alan Turing",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_until": new Date(Date.now()),
            
        
    
        
        
            
                "requires_confirmation": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "frequency_type": "weekly",
            
        
    
        
        
            
                "time_of_day": "Alan Turing",
            
        
    
        
        
            
                "days_of_week": "Ada Lovelace",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_until": new Date(Date.now()),
            
        
    
        
        
            
                "requires_confirmation": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "frequency_type": "custom",
            
        
    
        
        
            
                "time_of_day": "Ada Lovelace",
            
        
    
        
        
            
                "days_of_week": "Alan Turing",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_until": new Date(Date.now()),
            
        
    
        
        
            
                "requires_confirmation": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "frequency_type": "weekly",
            
        
    
        
        
            
                "time_of_day": "Marie Curie",
            
        
    
        
        
            
                "days_of_week": "Alan Turing",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_until": new Date(Date.now()),
            
        
    
        
        
            
                "requires_confirmation": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "frequency_type": "weekly",
            
        
    
        
        
            
                "time_of_day": "Alan Turing",
            
        
    
        
        
            
                "days_of_week": "Alan Turing",
            
        
    
        
        
            
                "effective_from": new Date(Date.now()),
            
        
    
        
        
            
                "effective_until": new Date(Date.now()),
            
        
    
        
        
            
                "requires_confirmation": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CalendarEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "other",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "location_text": "Grace Hopper",
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                "has_reminder": false,
            
        
    
        
        
            
                "reminder_minutes_before": 6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "appointment",
            
        
    
        
        
            
                "title_text": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "location_text": "Marie Curie",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "has_reminder": false,
            
        
    
        
        
            
                "reminder_minutes_before": 4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "care_task",
            
        
    
        
        
            
                "title_text": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "location_text": "Ada Lovelace",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "has_reminder": true,
            
        
    
        
        
            
                "reminder_minutes_before": 3,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "other",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "location_text": "Grace Hopper",
            
        
    
        
        
            
                "status": "scheduled",
            
        
    
        
        
            
                "has_reminder": false,
            
        
    
        
        
            
                "reminder_minutes_before": 5,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "appointment",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "location_text": "Marie Curie",
            
        
    
        
        
            
                "status": "cancelled",
            
        
    
        
        
            
                "has_reminder": false,
            
        
    
        
        
            
                "reminder_minutes_before": 7,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const RemindersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "voice",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "state": "pending",
            
        
    
        
        
            
                "message": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "voice",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "state": "pending",
            
        
    
        
        
            
                "message": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "state": "failed",
            
        
    
        
        
            
                "message": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "push",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "state": "pending",
            
        
    
        
        
            
                "message": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "scheduled_at": new Date(Date.now()),
            
        
    
        
        
            
                "state": "failed",
            
        
    
        
        
            
                "message": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CognitiveProgramsData = [
    
    {
    
        
        
            
                "program_name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "target_stage": "mild",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "estimated_minutes": 4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "target_stage": "moderate",
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "estimated_minutes": 8,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "target_stage": "mild",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "estimated_minutes": 8,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "target_stage": "mild",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "estimated_minutes": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "program_name": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "target_stage": "mild",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "estimated_minutes": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CognitiveExercisesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "exercise_name": "Marie Curie",
            
        
    
        
        
            
                "exercise_type": "attention",
            
        
    
        
        
            
                "instructions": "Ada Lovelace",
            
        
    
        
        
            
                "difficulty_level": "adaptive",
            
        
    
        
        
            
                "max_score": 5,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "exercise_name": "Alan Turing",
            
        
    
        
        
            
                "exercise_type": "orientation",
            
        
    
        
        
            
                "instructions": "Marie Curie",
            
        
    
        
        
            
                "difficulty_level": "hard",
            
        
    
        
        
            
                "max_score": 4,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "exercise_name": "Marie Curie",
            
        
    
        
        
            
                "exercise_type": "language",
            
        
    
        
        
            
                "instructions": "Grace Hopper",
            
        
    
        
        
            
                "difficulty_level": "hard",
            
        
    
        
        
            
                "max_score": 9,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "exercise_name": "Marie Curie",
            
        
    
        
        
            
                "exercise_type": "language",
            
        
    
        
        
            
                "instructions": "Grace Hopper",
            
        
    
        
        
            
                "difficulty_level": "adaptive",
            
        
    
        
        
            
                "max_score": 8,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "exercise_name": "Ada Lovelace",
            
        
    
        
        
            
                "exercise_type": "memory",
            
        
    
        
        
            
                "instructions": "Marie Curie",
            
        
    
        
        
            
                "difficulty_level": "medium",
            
        
    
        
        
            
                "max_score": 9,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CognitiveSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "completion_status": "completed",
            
        
    
        
        
            
                "total_score": 4.55,
            
        
    
        
        
            
                "session_notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "completion_status": "completed",
            
        
    
        
        
            
                "total_score": 1.15,
            
        
    
        
        
            
                "session_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "completion_status": "completed",
            
        
    
        
        
            
                "total_score": 1.18,
            
        
    
        
        
            
                "session_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "completion_status": "abandoned",
            
        
    
        
        
            
                "total_score": 5.74,
            
        
    
        
        
            
                "session_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "completion_status": "in_progress",
            
        
    
        
        
            
                "total_score": 5.63,
            
        
    
        
        
            
                "session_notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CognitiveAttemptsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attempted_at": new Date(Date.now()),
            
        
    
        
        
            
                "score": 4.26,
            
        
    
        
        
            
                "accuracy": 0.05,
            
        
    
        
        
            
                "duration_seconds": 8,
            
        
    
        
        
            
                "result": "failed",
            
        
    
        
        
            
                "raw_response": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attempted_at": new Date(Date.now()),
            
        
    
        
        
            
                "score": 2.04,
            
        
    
        
        
            
                "accuracy": 9.57,
            
        
    
        
        
            
                "duration_seconds": 5,
            
        
    
        
        
            
                "result": "partial",
            
        
    
        
        
            
                "raw_response": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attempted_at": new Date(Date.now()),
            
        
    
        
        
            
                "score": 9.58,
            
        
    
        
        
            
                "accuracy": 7.05,
            
        
    
        
        
            
                "duration_seconds": 2,
            
        
    
        
        
            
                "result": "partial",
            
        
    
        
        
            
                "raw_response": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attempted_at": new Date(Date.now()),
            
        
    
        
        
            
                "score": 8.06,
            
        
    
        
        
            
                "accuracy": 3.72,
            
        
    
        
        
            
                "duration_seconds": 7,
            
        
    
        
        
            
                "result": "failed",
            
        
    
        
        
            
                "raw_response": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attempted_at": new Date(Date.now()),
            
        
    
        
        
            
                "score": 9.89,
            
        
    
        
        
            
                "accuracy": 2.33,
            
        
    
        
        
            
                "duration_seconds": 1,
            
        
    
        
        
            
                "result": "failed",
            
        
    
        
        
            
                "raw_response": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StageAssessmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assessed_at": new Date(Date.now()),
            
        
    
        
        
            
                "predicted_stage": "moderate",
            
        
    
        
        
            
                "confidence_score": 6.93,
            
        
    
        
        
            
                "method": "clinician",
            
        
    
        
        
            
                "model_version": "Marie Curie",
            
        
    
        
        
            
                "explanation": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assessed_at": new Date(Date.now()),
            
        
    
        
        
            
                "predicted_stage": "unknown",
            
        
    
        
        
            
                "confidence_score": 9.97,
            
        
    
        
        
            
                "method": "cognitive_model",
            
        
    
        
        
            
                "model_version": "Ada Lovelace",
            
        
    
        
        
            
                "explanation": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assessed_at": new Date(Date.now()),
            
        
    
        
        
            
                "predicted_stage": "severe",
            
        
    
        
        
            
                "confidence_score": 1.29,
            
        
    
        
        
            
                "method": "questionnaire",
            
        
    
        
        
            
                "model_version": "Alan Turing",
            
        
    
        
        
            
                "explanation": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assessed_at": new Date(Date.now()),
            
        
    
        
        
            
                "predicted_stage": "severe",
            
        
    
        
        
            
                "confidence_score": 7.17,
            
        
    
        
        
            
                "method": "clinician",
            
        
    
        
        
            
                "model_version": "Ada Lovelace",
            
        
    
        
        
            
                "explanation": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "assessed_at": new Date(Date.now()),
            
        
    
        
        
            
                "predicted_stage": "mild",
            
        
    
        
        
            
                "confidence_score": 6.69,
            
        
    
        
        
            
                "method": "questionnaire",
            
        
    
        
        
            
                "model_version": "Grace Hopper",
            
        
    
        
        
            
                "explanation": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const VoiceAssistantSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "channel": "web",
            
        
    
        
        
            
                "transcript": "Marie Curie",
            
        
    
        
        
            
                "assistant_summary": "Ada Lovelace",
            
        
    
        
        
            
                "outcome": "reminder_created",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "channel": "smart_speaker",
            
        
    
        
        
            
                "transcript": "Alan Turing",
            
        
    
        
        
            
                "assistant_summary": "Grace Hopper",
            
        
    
        
        
            
                "outcome": "other",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "channel": "smart_speaker",
            
        
    
        
        
            
                "transcript": "Ada Lovelace",
            
        
    
        
        
            
                "assistant_summary": "Marie Curie",
            
        
    
        
        
            
                "outcome": "other",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "channel": "mobile",
            
        
    
        
        
            
                "transcript": "Marie Curie",
            
        
    
        
        
            
                "assistant_summary": "Marie Curie",
            
        
    
        
        
            
                "outcome": "alert_created",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "ended_at": new Date(Date.now()),
            
        
    
        
        
            
                "channel": "web",
            
        
    
        
        
            
                "transcript": "Alan Turing",
            
        
    
        
        
            
                "assistant_summary": "Ada Lovelace",
            
        
    
        
        
            
                "outcome": "other",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const IotDevicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "device_type": "other",
            
        
    
        
        
            
                "device_label": "Marie Curie",
            
        
    
        
        
            
                "serial_number": "Alan Turing",
            
        
    
        
        
            
                "status": "lost",
            
        
    
        
        
            
                "paired_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_seen_at": new Date(Date.now()),
            
        
    
        
        
            
                "battery_level": 6.38,
            
        
    
        
        
            
                "firmware_version": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "device_type": "other",
            
        
    
        
        
            
                "device_label": "Grace Hopper",
            
        
    
        
        
            
                "serial_number": "Alan Turing",
            
        
    
        
        
            
                "status": "maintenance",
            
        
    
        
        
            
                "paired_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_seen_at": new Date(Date.now()),
            
        
    
        
        
            
                "battery_level": 3.8,
            
        
    
        
        
            
                "firmware_version": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "device_type": "phone",
            
        
    
        
        
            
                "device_label": "Marie Curie",
            
        
    
        
        
            
                "serial_number": "Grace Hopper",
            
        
    
        
        
            
                "status": "inactive",
            
        
    
        
        
            
                "paired_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_seen_at": new Date(Date.now()),
            
        
    
        
        
            
                "battery_level": 0.97,
            
        
    
        
        
            
                "firmware_version": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "device_type": "phone",
            
        
    
        
        
            
                "device_label": "Alan Turing",
            
        
    
        
        
            
                "serial_number": "Marie Curie",
            
        
    
        
        
            
                "status": "lost",
            
        
    
        
        
            
                "paired_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_seen_at": new Date(Date.now()),
            
        
    
        
        
            
                "battery_level": 3.39,
            
        
    
        
        
            
                "firmware_version": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "device_type": "gps_bracelet",
            
        
    
        
        
            
                "device_label": "Marie Curie",
            
        
    
        
        
            
                "serial_number": "Alan Turing",
            
        
    
        
        
            
                "status": "maintenance",
            
        
    
        
        
            
                "paired_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_seen_at": new Date(Date.now()),
            
        
    
        
        
            
                "battery_level": 6.01,
            
        
    
        
        
            
                "firmware_version": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const IotTelemetryEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recorded_at": new Date(Date.now()),
            
        
    
        
        
            
                "latitude": 8.7,
            
        
    
        
        
            
                "longitude": 0.69,
            
        
    
        
        
            
                "speed": 8.11,
            
        
    
        
        
            
                "accuracy_meters": 6.8,
            
        
    
        
        
            
                "battery_level": 1.79,
            
        
    
        
        
            
                "event_kind": "geofence_exit",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recorded_at": new Date(Date.now()),
            
        
    
        
        
            
                "latitude": 1.43,
            
        
    
        
        
            
                "longitude": 5.25,
            
        
    
        
        
            
                "speed": 0.77,
            
        
    
        
        
            
                "accuracy_meters": 6.51,
            
        
    
        
        
            
                "battery_level": 3.1,
            
        
    
        
        
            
                "event_kind": "device_offline",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recorded_at": new Date(Date.now()),
            
        
    
        
        
            
                "latitude": 1.39,
            
        
    
        
        
            
                "longitude": 1.35,
            
        
    
        
        
            
                "speed": 1.61,
            
        
    
        
        
            
                "accuracy_meters": 3.31,
            
        
    
        
        
            
                "battery_level": 9.46,
            
        
    
        
        
            
                "event_kind": "panic",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recorded_at": new Date(Date.now()),
            
        
    
        
        
            
                "latitude": 5.37,
            
        
    
        
        
            
                "longitude": 3.05,
            
        
    
        
        
            
                "speed": 3.79,
            
        
    
        
        
            
                "accuracy_meters": 0.93,
            
        
    
        
        
            
                "battery_level": 7.37,
            
        
    
        
        
            
                "event_kind": "location_update",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recorded_at": new Date(Date.now()),
            
        
    
        
        
            
                "latitude": 4.06,
            
        
    
        
        
            
                "longitude": 5.31,
            
        
    
        
        
            
                "speed": 9.04,
            
        
    
        
        
            
                "accuracy_meters": 0.04,
            
        
    
        
        
            
                "battery_level": 8.94,
            
        
    
        
        
            
                "event_kind": "location_update",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GeofencesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "geofence_name": "Alan Turing",
            
        
    
        
        
            
                "shape_type": "circle",
            
        
    
        
        
            
                "center_latitude": 7.55,
            
        
    
        
        
            
                "center_longitude": 6.49,
            
        
    
        
        
            
                "radius_meters": 1.92,
            
        
    
        
        
            
                "polygon_points": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "alert_on": "enter",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "geofence_name": "Ada Lovelace",
            
        
    
        
        
            
                "shape_type": "polygon",
            
        
    
        
        
            
                "center_latitude": 6.01,
            
        
    
        
        
            
                "center_longitude": 6.2,
            
        
    
        
        
            
                "radius_meters": 9.07,
            
        
    
        
        
            
                "polygon_points": "Alan Turing",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "alert_on": "enter_or_exit",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "geofence_name": "Alan Turing",
            
        
    
        
        
            
                "shape_type": "circle",
            
        
    
        
        
            
                "center_latitude": 6.37,
            
        
    
        
        
            
                "center_longitude": 2.5,
            
        
    
        
        
            
                "radius_meters": 4.69,
            
        
    
        
        
            
                "polygon_points": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "alert_on": "enter_or_exit",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "geofence_name": "Alan Turing",
            
        
    
        
        
            
                "shape_type": "polygon",
            
        
    
        
        
            
                "center_latitude": 9.64,
            
        
    
        
        
            
                "center_longitude": 1.34,
            
        
    
        
        
            
                "radius_meters": 7.96,
            
        
    
        
        
            
                "polygon_points": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "alert_on": "enter_or_exit",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "geofence_name": "Marie Curie",
            
        
    
        
        
            
                "shape_type": "polygon",
            
        
    
        
        
            
                "center_latitude": 8.88,
            
        
    
        
        
            
                "center_longitude": 0.77,
            
        
    
        
        
            
                "radius_meters": 9.61,
            
        
    
        
        
            
                "polygon_points": "Grace Hopper",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "alert_on": "enter",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AlertsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "panic",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "details": "Marie Curie",
            
        
    
        
        
            
                "triggered_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "acknowledged_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "other",
            
        
    
        
        
            
                "severity": "low",
            
        
    
        
        
            
                "title_text": "Ada Lovelace",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                "triggered_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "acknowledged_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "wandering",
            
        
    
        
        
            
                "severity": "medium",
            
        
    
        
        
            
                "title_text": "Ada Lovelace",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                "triggered_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                "acknowledged_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "device_offline",
            
        
    
        
        
            
                "severity": "high",
            
        
    
        
        
            
                "title_text": "Grace Hopper",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                "triggered_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                "acknowledged_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "alert_type": "device_offline",
            
        
    
        
        
            
                "severity": "medium",
            
        
    
        
        
            
                "title_text": "Marie Curie",
            
        
    
        
        
            
                "details": "Marie Curie",
            
        
    
        
        
            
                "triggered_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "open",
            
        
    
        
        
            
                "acknowledged_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AlertNotificationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "voice",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "delivery_status": "pending",
            
        
    
        
        
            
                "provider_message_id": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "provider_message_id": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "voice",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "provider_message_id": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "delivery_status": "sent",
            
        
    
        
        
            
                "provider_message_id": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "delivery_status": "failed",
            
        
    
        
        
            
                "provider_message_id": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SharedDashboardPostsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "post_type": "photo",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "all_authorized",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "post_type": "photo",
            
        
    
        
        
            
                "title_text": "Grace Hopper",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "care_team",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "post_type": "update",
            
        
    
        
        
            
                "title_text": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "family_only",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "post_type": "question",
            
        
    
        
        
            
                "title_text": "Marie Curie",
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "family_only",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "post_type": "document",
            
        
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                "visibility": "family_only",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ScientificArticlesData = [
    
    {
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "abstract_text": "Marie Curie",
            
        
    
        
        
            
                "journal": "Grace Hopper",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "doi": "Marie Curie",
            
        
    
        
        
            
                "url": "Ada Lovelace",
            
        
    
        
        
            
                "keywords": "Marie Curie",
            
        
    
        
        
            
                "validation_status": "rejected",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "validation_notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title_text": "Alan Turing",
            
        
    
        
        
            
                "abstract_text": "Alan Turing",
            
        
    
        
        
            
                "journal": "Ada Lovelace",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "doi": "Marie Curie",
            
        
    
        
        
            
                "url": "Marie Curie",
            
        
    
        
        
            
                "keywords": "Marie Curie",
            
        
    
        
        
            
                "validation_status": "validated",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "validation_notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title_text": "Grace Hopper",
            
        
    
        
        
            
                "abstract_text": "Alan Turing",
            
        
    
        
        
            
                "journal": "Grace Hopper",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "doi": "Marie Curie",
            
        
    
        
        
            
                "url": "Alan Turing",
            
        
    
        
        
            
                "keywords": "Marie Curie",
            
        
    
        
        
            
                "validation_status": "validated",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "validation_notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title_text": "Marie Curie",
            
        
    
        
        
            
                "abstract_text": "Alan Turing",
            
        
    
        
        
            
                "journal": "Grace Hopper",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "doi": "Marie Curie",
            
        
    
        
        
            
                "url": "Grace Hopper",
            
        
    
        
        
            
                "keywords": "Marie Curie",
            
        
    
        
        
            
                "validation_status": "validated",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "validation_notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "title_text": "Ada Lovelace",
            
        
    
        
        
            
                "abstract_text": "Alan Turing",
            
        
    
        
        
            
                "journal": "Marie Curie",
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
        
        
            
                "doi": "Grace Hopper",
            
        
    
        
        
            
                "url": "Alan Turing",
            
        
    
        
        
            
                "keywords": "Ada Lovelace",
            
        
    
        
        
            
                "validation_status": "pending",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "validation_notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ArticleRecommendationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommended_at": new Date(Date.now()),
            
        
    
        
        
            
                "reason_type": "stage_based",
            
        
    
        
        
            
                "reason_text": "Alan Turing",
            
        
    
        
        
            
                "state": "saved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommended_at": new Date(Date.now()),
            
        
    
        
        
            
                "reason_type": "stage_based",
            
        
    
        
        
            
                "reason_text": "Alan Turing",
            
        
    
        
        
            
                "state": "new",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommended_at": new Date(Date.now()),
            
        
    
        
        
            
                "reason_type": "trending",
            
        
    
        
        
            
                "reason_text": "Marie Curie",
            
        
    
        
        
            
                "state": "dismissed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommended_at": new Date(Date.now()),
            
        
    
        
        
            
                "reason_type": "caregiver_interest",
            
        
    
        
        
            
                "reason_text": "Alan Turing",
            
        
    
        
        
            
                "state": "viewed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "recommended_at": new Date(Date.now()),
            
        
    
        
        
            
                "reason_type": "trending",
            
        
    
        
        
            
                "reason_text": "Marie Curie",
            
        
    
        
        
            
                "state": "dismissed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ClinicalReportsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_start_at": new Date(Date.now()),
            
        
    
        
        
            
                "period_end_at": new Date(Date.now()),
            
        
    
        
        
            
                "report_title": "Marie Curie",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "share_scope": "clinicians",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_start_at": new Date(Date.now()),
            
        
    
        
        
            
                "period_end_at": new Date(Date.now()),
            
        
    
        
        
            
                "report_title": "Ada Lovelace",
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "share_scope": "admin",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_start_at": new Date(Date.now()),
            
        
    
        
        
            
                "period_end_at": new Date(Date.now()),
            
        
    
        
        
            
                "report_title": "Ada Lovelace",
            
        
    
        
        
            
                "summary": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "share_scope": "clinicians",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_start_at": new Date(Date.now()),
            
        
    
        
        
            
                "period_end_at": new Date(Date.now()),
            
        
    
        
        
            
                "report_title": "Ada Lovelace",
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "share_scope": "clinicians",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "period_start_at": new Date(Date.now()),
            
        
    
        
        
            
                "period_end_at": new Date(Date.now()),
            
        
    
        
        
            
                "report_title": "Marie Curie",
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "share_scope": "admin",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AdminMetricsSnapshotsData = [
    
    {
    
        
        
            
                "snapshot_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_accounts": 2,
            
        
    
        
        
            
                "total_users": 3,
            
        
    
        
        
            
                "total_patients": 8,
            
        
    
        
        
            
                "active_devices": 4,
            
        
    
        
        
            
                "alerts_last_24h": 9,
            
        
    
        
        
            
                "cognitive_sessions_last_7d": 8,
            
        
    
        
        
            
                "reminders_sent_last_24h": 1,
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "snapshot_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_accounts": 3,
            
        
    
        
        
            
                "total_users": 2,
            
        
    
        
        
            
                "total_patients": 3,
            
        
    
        
        
            
                "active_devices": 3,
            
        
    
        
        
            
                "alerts_last_24h": 3,
            
        
    
        
        
            
                "cognitive_sessions_last_7d": 4,
            
        
    
        
        
            
                "reminders_sent_last_24h": 2,
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "snapshot_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_accounts": 9,
            
        
    
        
        
            
                "total_users": 8,
            
        
    
        
        
            
                "total_patients": 5,
            
        
    
        
        
            
                "active_devices": 1,
            
        
    
        
        
            
                "alerts_last_24h": 2,
            
        
    
        
        
            
                "cognitive_sessions_last_7d": 1,
            
        
    
        
        
            
                "reminders_sent_last_24h": 5,
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "snapshot_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_accounts": 5,
            
        
    
        
        
            
                "total_users": 2,
            
        
    
        
        
            
                "total_patients": 7,
            
        
    
        
        
            
                "active_devices": 8,
            
        
    
        
        
            
                "alerts_last_24h": 2,
            
        
    
        
        
            
                "cognitive_sessions_last_7d": 6,
            
        
    
        
        
            
                "reminders_sent_last_24h": 6,
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "snapshot_at": new Date(Date.now()),
            
        
    
        
        
            
                "total_accounts": 3,
            
        
    
        
        
            
                "total_users": 1,
            
        
    
        
        
            
                "total_patients": 1,
            
        
    
        
        
            
                "active_devices": 8,
            
        
    
        
        
            
                "alerts_last_24h": 8,
            
        
    
        
        
            
                "cognitive_sessions_last_7d": 5,
            
        
    
        
        
            
                "reminders_sent_last_24h": 9,
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateUserWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const User0 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (User0?.setAccount)
                {
                    await
                    User0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const User1 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (User1?.setAccount)
                {
                    await
                    User1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const User2 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (User2?.setAccount)
                {
                    await
                    User2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const User3 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (User3?.setAccount)
                {
                    await
                    User3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const User4 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (User4?.setAccount)
                {
                    await
                    User4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePatientWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Patient0 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Patient0?.setAccount)
                {
                    await
                    Patient0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Patient1 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Patient1?.setAccount)
                {
                    await
                    Patient1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Patient2 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Patient2?.setAccount)
                {
                    await
                    Patient2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Patient3 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Patient3?.setAccount)
                {
                    await
                    Patient3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Patient4 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Patient4?.setAccount)
                {
                    await
                    Patient4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    
        
            
            async function associatePatientWithPrimary_physician() {
            
                const relatedPrimary_physician0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient0 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Patient0?.setPrimary_physician)
                {
                    await
                    Patient0.
                    setPrimary_physician(relatedPrimary_physician0);
                }
            
                const relatedPrimary_physician1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient1 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Patient1?.setPrimary_physician)
                {
                    await
                    Patient1.
                    setPrimary_physician(relatedPrimary_physician1);
                }
            
                const relatedPrimary_physician2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient2 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Patient2?.setPrimary_physician)
                {
                    await
                    Patient2.
                    setPrimary_physician(relatedPrimary_physician2);
                }
            
                const relatedPrimary_physician3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient3 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Patient3?.setPrimary_physician)
                {
                    await
                    Patient3.
                    setPrimary_physician(relatedPrimary_physician3);
                }
            
                const relatedPrimary_physician4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Patient4 = await Patients.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Patient4?.setPrimary_physician)
                {
                    await
                    Patient4.
                    setPrimary_physician(relatedPrimary_physician4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePatientAccessGrantWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const PatientAccessGrant0 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PatientAccessGrant0?.setPatient)
                {
                    await
                    PatientAccessGrant0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const PatientAccessGrant1 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PatientAccessGrant1?.setPatient)
                {
                    await
                    PatientAccessGrant1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const PatientAccessGrant2 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PatientAccessGrant2?.setPatient)
                {
                    await
                    PatientAccessGrant2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const PatientAccessGrant3 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PatientAccessGrant3?.setPatient)
                {
                    await
                    PatientAccessGrant3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const PatientAccessGrant4 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PatientAccessGrant4?.setPatient)
                {
                    await
                    PatientAccessGrant4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associatePatientAccessGrantWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PatientAccessGrant0 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PatientAccessGrant0?.setUser)
                {
                    await
                    PatientAccessGrant0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PatientAccessGrant1 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PatientAccessGrant1?.setUser)
                {
                    await
                    PatientAccessGrant1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PatientAccessGrant2 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PatientAccessGrant2?.setUser)
                {
                    await
                    PatientAccessGrant2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PatientAccessGrant3 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PatientAccessGrant3?.setUser)
                {
                    await
                    PatientAccessGrant3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const PatientAccessGrant4 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PatientAccessGrant4?.setUser)
                {
                    await
                    PatientAccessGrant4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePatientAccessGrantWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const PatientAccessGrant0 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PatientAccessGrant0?.setAccount)
                {
                    await
                    PatientAccessGrant0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const PatientAccessGrant1 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PatientAccessGrant1?.setAccount)
                {
                    await
                    PatientAccessGrant1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const PatientAccessGrant2 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PatientAccessGrant2?.setAccount)
                {
                    await
                    PatientAccessGrant2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const PatientAccessGrant3 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PatientAccessGrant3?.setAccount)
                {
                    await
                    PatientAccessGrant3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const PatientAccessGrant4 = await PatientAccessGrants.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PatientAccessGrant4?.setAccount)
                {
                    await
                    PatientAccessGrant4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMedicationWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Medication0 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Medication0?.setPatient)
                {
                    await
                    Medication0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Medication1 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Medication1?.setPatient)
                {
                    await
                    Medication1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Medication2 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Medication2?.setPatient)
                {
                    await
                    Medication2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Medication3 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Medication3?.setPatient)
                {
                    await
                    Medication3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Medication4 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Medication4?.setPatient)
                {
                    await
                    Medication4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMedicationWithPrescribed_by() {
            
                const relatedPrescribed_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Medication0 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Medication0?.setPrescribed_by)
                {
                    await
                    Medication0.
                    setPrescribed_by(relatedPrescribed_by0);
                }
            
                const relatedPrescribed_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Medication1 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Medication1?.setPrescribed_by)
                {
                    await
                    Medication1.
                    setPrescribed_by(relatedPrescribed_by1);
                }
            
                const relatedPrescribed_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Medication2 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Medication2?.setPrescribed_by)
                {
                    await
                    Medication2.
                    setPrescribed_by(relatedPrescribed_by2);
                }
            
                const relatedPrescribed_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Medication3 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Medication3?.setPrescribed_by)
                {
                    await
                    Medication3.
                    setPrescribed_by(relatedPrescribed_by3);
                }
            
                const relatedPrescribed_by4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Medication4 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Medication4?.setPrescribed_by)
                {
                    await
                    Medication4.
                    setPrescribed_by(relatedPrescribed_by4);
                }
            
        }
        
    
        
            
            async function associateMedicationWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Medication0 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Medication0?.setAccount)
                {
                    await
                    Medication0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Medication1 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Medication1?.setAccount)
                {
                    await
                    Medication1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Medication2 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Medication2?.setAccount)
                {
                    await
                    Medication2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Medication3 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Medication3?.setAccount)
                {
                    await
                    Medication3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Medication4 = await Medications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Medication4?.setAccount)
                {
                    await
                    Medication4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMedicationScheduleWithMedication() {
            
                const relatedMedication0 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const MedicationSchedule0 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicationSchedule0?.setMedication)
                {
                    await
                    MedicationSchedule0.
                    setMedication(relatedMedication0);
                }
            
                const relatedMedication1 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const MedicationSchedule1 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicationSchedule1?.setMedication)
                {
                    await
                    MedicationSchedule1.
                    setMedication(relatedMedication1);
                }
            
                const relatedMedication2 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const MedicationSchedule2 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicationSchedule2?.setMedication)
                {
                    await
                    MedicationSchedule2.
                    setMedication(relatedMedication2);
                }
            
                const relatedMedication3 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const MedicationSchedule3 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MedicationSchedule3?.setMedication)
                {
                    await
                    MedicationSchedule3.
                    setMedication(relatedMedication3);
                }
            
                const relatedMedication4 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const MedicationSchedule4 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (MedicationSchedule4?.setMedication)
                {
                    await
                    MedicationSchedule4.
                    setMedication(relatedMedication4);
                }
            
        }
        
    
        
            
            async function associateMedicationScheduleWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicationSchedule0 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicationSchedule0?.setPatient)
                {
                    await
                    MedicationSchedule0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicationSchedule1 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicationSchedule1?.setPatient)
                {
                    await
                    MedicationSchedule1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicationSchedule2 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicationSchedule2?.setPatient)
                {
                    await
                    MedicationSchedule2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicationSchedule3 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MedicationSchedule3?.setPatient)
                {
                    await
                    MedicationSchedule3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const MedicationSchedule4 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (MedicationSchedule4?.setPatient)
                {
                    await
                    MedicationSchedule4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateMedicationScheduleWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const MedicationSchedule0 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MedicationSchedule0?.setAccount)
                {
                    await
                    MedicationSchedule0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const MedicationSchedule1 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MedicationSchedule1?.setAccount)
                {
                    await
                    MedicationSchedule1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const MedicationSchedule2 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MedicationSchedule2?.setAccount)
                {
                    await
                    MedicationSchedule2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const MedicationSchedule3 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MedicationSchedule3?.setAccount)
                {
                    await
                    MedicationSchedule3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const MedicationSchedule4 = await MedicationSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (MedicationSchedule4?.setAccount)
                {
                    await
                    MedicationSchedule4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCalendarEventWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CalendarEvent0 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CalendarEvent0?.setPatient)
                {
                    await
                    CalendarEvent0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CalendarEvent1 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CalendarEvent1?.setPatient)
                {
                    await
                    CalendarEvent1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CalendarEvent2 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CalendarEvent2?.setPatient)
                {
                    await
                    CalendarEvent2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CalendarEvent3 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CalendarEvent3?.setPatient)
                {
                    await
                    CalendarEvent3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CalendarEvent4 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CalendarEvent4?.setPatient)
                {
                    await
                    CalendarEvent4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateCalendarEventWithCreated_by_user() {
            
                const relatedCreated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CalendarEvent0 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CalendarEvent0?.setCreated_by_user)
                {
                    await
                    CalendarEvent0.
                    setCreated_by_user(relatedCreated_by_user0);
                }
            
                const relatedCreated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CalendarEvent1 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CalendarEvent1?.setCreated_by_user)
                {
                    await
                    CalendarEvent1.
                    setCreated_by_user(relatedCreated_by_user1);
                }
            
                const relatedCreated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CalendarEvent2 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CalendarEvent2?.setCreated_by_user)
                {
                    await
                    CalendarEvent2.
                    setCreated_by_user(relatedCreated_by_user2);
                }
            
                const relatedCreated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CalendarEvent3 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CalendarEvent3?.setCreated_by_user)
                {
                    await
                    CalendarEvent3.
                    setCreated_by_user(relatedCreated_by_user3);
                }
            
                const relatedCreated_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CalendarEvent4 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CalendarEvent4?.setCreated_by_user)
                {
                    await
                    CalendarEvent4.
                    setCreated_by_user(relatedCreated_by_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCalendarEventWithLinked_medication() {
            
                const relatedLinked_medication0 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const CalendarEvent0 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CalendarEvent0?.setLinked_medication)
                {
                    await
                    CalendarEvent0.
                    setLinked_medication(relatedLinked_medication0);
                }
            
                const relatedLinked_medication1 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const CalendarEvent1 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CalendarEvent1?.setLinked_medication)
                {
                    await
                    CalendarEvent1.
                    setLinked_medication(relatedLinked_medication1);
                }
            
                const relatedLinked_medication2 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const CalendarEvent2 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CalendarEvent2?.setLinked_medication)
                {
                    await
                    CalendarEvent2.
                    setLinked_medication(relatedLinked_medication2);
                }
            
                const relatedLinked_medication3 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const CalendarEvent3 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CalendarEvent3?.setLinked_medication)
                {
                    await
                    CalendarEvent3.
                    setLinked_medication(relatedLinked_medication3);
                }
            
                const relatedLinked_medication4 = await Medications.findOne({
                    offset: Math.floor(Math.random() * (await Medications.count())),
                });
                const CalendarEvent4 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CalendarEvent4?.setLinked_medication)
                {
                    await
                    CalendarEvent4.
                    setLinked_medication(relatedLinked_medication4);
                }
            
        }
        
    
        
            
            async function associateCalendarEventWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CalendarEvent0 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CalendarEvent0?.setAccount)
                {
                    await
                    CalendarEvent0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CalendarEvent1 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CalendarEvent1?.setAccount)
                {
                    await
                    CalendarEvent1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CalendarEvent2 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CalendarEvent2?.setAccount)
                {
                    await
                    CalendarEvent2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CalendarEvent3 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CalendarEvent3?.setAccount)
                {
                    await
                    CalendarEvent3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CalendarEvent4 = await CalendarEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CalendarEvent4?.setAccount)
                {
                    await
                    CalendarEvent4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateReminderWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Reminder0 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reminder0?.setPatient)
                {
                    await
                    Reminder0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Reminder1 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reminder1?.setPatient)
                {
                    await
                    Reminder1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Reminder2 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reminder2?.setPatient)
                {
                    await
                    Reminder2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Reminder3 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reminder3?.setPatient)
                {
                    await
                    Reminder3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Reminder4 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Reminder4?.setPatient)
                {
                    await
                    Reminder4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateReminderWithEvent() {
            
                const relatedEvent0 = await CalendarEvents.findOne({
                    offset: Math.floor(Math.random() * (await CalendarEvents.count())),
                });
                const Reminder0 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reminder0?.setEvent)
                {
                    await
                    Reminder0.
                    setEvent(relatedEvent0);
                }
            
                const relatedEvent1 = await CalendarEvents.findOne({
                    offset: Math.floor(Math.random() * (await CalendarEvents.count())),
                });
                const Reminder1 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reminder1?.setEvent)
                {
                    await
                    Reminder1.
                    setEvent(relatedEvent1);
                }
            
                const relatedEvent2 = await CalendarEvents.findOne({
                    offset: Math.floor(Math.random() * (await CalendarEvents.count())),
                });
                const Reminder2 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reminder2?.setEvent)
                {
                    await
                    Reminder2.
                    setEvent(relatedEvent2);
                }
            
                const relatedEvent3 = await CalendarEvents.findOne({
                    offset: Math.floor(Math.random() * (await CalendarEvents.count())),
                });
                const Reminder3 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reminder3?.setEvent)
                {
                    await
                    Reminder3.
                    setEvent(relatedEvent3);
                }
            
                const relatedEvent4 = await CalendarEvents.findOne({
                    offset: Math.floor(Math.random() * (await CalendarEvents.count())),
                });
                const Reminder4 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Reminder4?.setEvent)
                {
                    await
                    Reminder4.
                    setEvent(relatedEvent4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateReminderWithRecipient_user() {
            
                const relatedRecipient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reminder0 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reminder0?.setRecipient_user)
                {
                    await
                    Reminder0.
                    setRecipient_user(relatedRecipient_user0);
                }
            
                const relatedRecipient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reminder1 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reminder1?.setRecipient_user)
                {
                    await
                    Reminder1.
                    setRecipient_user(relatedRecipient_user1);
                }
            
                const relatedRecipient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reminder2 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reminder2?.setRecipient_user)
                {
                    await
                    Reminder2.
                    setRecipient_user(relatedRecipient_user2);
                }
            
                const relatedRecipient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reminder3 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reminder3?.setRecipient_user)
                {
                    await
                    Reminder3.
                    setRecipient_user(relatedRecipient_user3);
                }
            
                const relatedRecipient_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reminder4 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Reminder4?.setRecipient_user)
                {
                    await
                    Reminder4.
                    setRecipient_user(relatedRecipient_user4);
                }
            
        }
        
    
        
            
            async function associateReminderWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Reminder0 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reminder0?.setAccount)
                {
                    await
                    Reminder0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Reminder1 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reminder1?.setAccount)
                {
                    await
                    Reminder1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Reminder2 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reminder2?.setAccount)
                {
                    await
                    Reminder2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Reminder3 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reminder3?.setAccount)
                {
                    await
                    Reminder3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Reminder4 = await Reminders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Reminder4?.setAccount)
                {
                    await
                    Reminder4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCognitiveProgramWithCreated_by_user() {
            
                const relatedCreated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveProgram0 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveProgram0?.setCreated_by_user)
                {
                    await
                    CognitiveProgram0.
                    setCreated_by_user(relatedCreated_by_user0);
                }
            
                const relatedCreated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveProgram1 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveProgram1?.setCreated_by_user)
                {
                    await
                    CognitiveProgram1.
                    setCreated_by_user(relatedCreated_by_user1);
                }
            
                const relatedCreated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveProgram2 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveProgram2?.setCreated_by_user)
                {
                    await
                    CognitiveProgram2.
                    setCreated_by_user(relatedCreated_by_user2);
                }
            
                const relatedCreated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveProgram3 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveProgram3?.setCreated_by_user)
                {
                    await
                    CognitiveProgram3.
                    setCreated_by_user(relatedCreated_by_user3);
                }
            
                const relatedCreated_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveProgram4 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveProgram4?.setCreated_by_user)
                {
                    await
                    CognitiveProgram4.
                    setCreated_by_user(relatedCreated_by_user4);
                }
            
        }
        
    
        
            
            async function associateCognitiveProgramWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveProgram0 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveProgram0?.setAccount)
                {
                    await
                    CognitiveProgram0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveProgram1 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveProgram1?.setAccount)
                {
                    await
                    CognitiveProgram1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveProgram2 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveProgram2?.setAccount)
                {
                    await
                    CognitiveProgram2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveProgram3 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveProgram3?.setAccount)
                {
                    await
                    CognitiveProgram3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveProgram4 = await CognitivePrograms.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveProgram4?.setAccount)
                {
                    await
                    CognitiveProgram4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCognitiveExercisWithProgram() {
            
                const relatedProgram0 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveExercis0 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveExercis0?.setProgram)
                {
                    await
                    CognitiveExercis0.
                    setProgram(relatedProgram0);
                }
            
                const relatedProgram1 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveExercis1 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveExercis1?.setProgram)
                {
                    await
                    CognitiveExercis1.
                    setProgram(relatedProgram1);
                }
            
                const relatedProgram2 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveExercis2 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveExercis2?.setProgram)
                {
                    await
                    CognitiveExercis2.
                    setProgram(relatedProgram2);
                }
            
                const relatedProgram3 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveExercis3 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveExercis3?.setProgram)
                {
                    await
                    CognitiveExercis3.
                    setProgram(relatedProgram3);
                }
            
                const relatedProgram4 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveExercis4 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveExercis4?.setProgram)
                {
                    await
                    CognitiveExercis4.
                    setProgram(relatedProgram4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCognitiveExercisWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveExercis0 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveExercis0?.setAccount)
                {
                    await
                    CognitiveExercis0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveExercis1 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveExercis1?.setAccount)
                {
                    await
                    CognitiveExercis1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveExercis2 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveExercis2?.setAccount)
                {
                    await
                    CognitiveExercis2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveExercis3 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveExercis3?.setAccount)
                {
                    await
                    CognitiveExercis3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveExercis4 = await CognitiveExercises.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveExercis4?.setAccount)
                {
                    await
                    CognitiveExercis4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCognitiveSessionWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CognitiveSession0 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveSession0?.setPatient)
                {
                    await
                    CognitiveSession0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CognitiveSession1 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveSession1?.setPatient)
                {
                    await
                    CognitiveSession1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CognitiveSession2 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveSession2?.setPatient)
                {
                    await
                    CognitiveSession2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CognitiveSession3 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveSession3?.setPatient)
                {
                    await
                    CognitiveSession3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const CognitiveSession4 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveSession4?.setPatient)
                {
                    await
                    CognitiveSession4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateCognitiveSessionWithProgram() {
            
                const relatedProgram0 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveSession0 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveSession0?.setProgram)
                {
                    await
                    CognitiveSession0.
                    setProgram(relatedProgram0);
                }
            
                const relatedProgram1 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveSession1 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveSession1?.setProgram)
                {
                    await
                    CognitiveSession1.
                    setProgram(relatedProgram1);
                }
            
                const relatedProgram2 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveSession2 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveSession2?.setProgram)
                {
                    await
                    CognitiveSession2.
                    setProgram(relatedProgram2);
                }
            
                const relatedProgram3 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveSession3 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveSession3?.setProgram)
                {
                    await
                    CognitiveSession3.
                    setProgram(relatedProgram3);
                }
            
                const relatedProgram4 = await CognitivePrograms.findOne({
                    offset: Math.floor(Math.random() * (await CognitivePrograms.count())),
                });
                const CognitiveSession4 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveSession4?.setProgram)
                {
                    await
                    CognitiveSession4.
                    setProgram(relatedProgram4);
                }
            
        }
        
    
        
            
            async function associateCognitiveSessionWithStarted_by_user() {
            
                const relatedStarted_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveSession0 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveSession0?.setStarted_by_user)
                {
                    await
                    CognitiveSession0.
                    setStarted_by_user(relatedStarted_by_user0);
                }
            
                const relatedStarted_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveSession1 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveSession1?.setStarted_by_user)
                {
                    await
                    CognitiveSession1.
                    setStarted_by_user(relatedStarted_by_user1);
                }
            
                const relatedStarted_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveSession2 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveSession2?.setStarted_by_user)
                {
                    await
                    CognitiveSession2.
                    setStarted_by_user(relatedStarted_by_user2);
                }
            
                const relatedStarted_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveSession3 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveSession3?.setStarted_by_user)
                {
                    await
                    CognitiveSession3.
                    setStarted_by_user(relatedStarted_by_user3);
                }
            
                const relatedStarted_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CognitiveSession4 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveSession4?.setStarted_by_user)
                {
                    await
                    CognitiveSession4.
                    setStarted_by_user(relatedStarted_by_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCognitiveSessionWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveSession0 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveSession0?.setAccount)
                {
                    await
                    CognitiveSession0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveSession1 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveSession1?.setAccount)
                {
                    await
                    CognitiveSession1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveSession2 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveSession2?.setAccount)
                {
                    await
                    CognitiveSession2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveSession3 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveSession3?.setAccount)
                {
                    await
                    CognitiveSession3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveSession4 = await CognitiveSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveSession4?.setAccount)
                {
                    await
                    CognitiveSession4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCognitiveAttemptWithSession() {
            
                const relatedSession0 = await CognitiveSessions.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveSessions.count())),
                });
                const CognitiveAttempt0 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveAttempt0?.setSession)
                {
                    await
                    CognitiveAttempt0.
                    setSession(relatedSession0);
                }
            
                const relatedSession1 = await CognitiveSessions.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveSessions.count())),
                });
                const CognitiveAttempt1 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveAttempt1?.setSession)
                {
                    await
                    CognitiveAttempt1.
                    setSession(relatedSession1);
                }
            
                const relatedSession2 = await CognitiveSessions.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveSessions.count())),
                });
                const CognitiveAttempt2 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveAttempt2?.setSession)
                {
                    await
                    CognitiveAttempt2.
                    setSession(relatedSession2);
                }
            
                const relatedSession3 = await CognitiveSessions.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveSessions.count())),
                });
                const CognitiveAttempt3 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveAttempt3?.setSession)
                {
                    await
                    CognitiveAttempt3.
                    setSession(relatedSession3);
                }
            
                const relatedSession4 = await CognitiveSessions.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveSessions.count())),
                });
                const CognitiveAttempt4 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveAttempt4?.setSession)
                {
                    await
                    CognitiveAttempt4.
                    setSession(relatedSession4);
                }
            
        }
        
    
        
            
            async function associateCognitiveAttemptWithExercise() {
            
                const relatedExercise0 = await CognitiveExercises.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveExercises.count())),
                });
                const CognitiveAttempt0 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveAttempt0?.setExercise)
                {
                    await
                    CognitiveAttempt0.
                    setExercise(relatedExercise0);
                }
            
                const relatedExercise1 = await CognitiveExercises.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveExercises.count())),
                });
                const CognitiveAttempt1 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveAttempt1?.setExercise)
                {
                    await
                    CognitiveAttempt1.
                    setExercise(relatedExercise1);
                }
            
                const relatedExercise2 = await CognitiveExercises.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveExercises.count())),
                });
                const CognitiveAttempt2 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveAttempt2?.setExercise)
                {
                    await
                    CognitiveAttempt2.
                    setExercise(relatedExercise2);
                }
            
                const relatedExercise3 = await CognitiveExercises.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveExercises.count())),
                });
                const CognitiveAttempt3 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveAttempt3?.setExercise)
                {
                    await
                    CognitiveAttempt3.
                    setExercise(relatedExercise3);
                }
            
                const relatedExercise4 = await CognitiveExercises.findOne({
                    offset: Math.floor(Math.random() * (await CognitiveExercises.count())),
                });
                const CognitiveAttempt4 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveAttempt4?.setExercise)
                {
                    await
                    CognitiveAttempt4.
                    setExercise(relatedExercise4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCognitiveAttemptWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveAttempt0 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CognitiveAttempt0?.setAccount)
                {
                    await
                    CognitiveAttempt0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveAttempt1 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CognitiveAttempt1?.setAccount)
                {
                    await
                    CognitiveAttempt1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveAttempt2 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CognitiveAttempt2?.setAccount)
                {
                    await
                    CognitiveAttempt2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveAttempt3 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CognitiveAttempt3?.setAccount)
                {
                    await
                    CognitiveAttempt3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const CognitiveAttempt4 = await CognitiveAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CognitiveAttempt4?.setAccount)
                {
                    await
                    CognitiveAttempt4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStageAssessmentWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const StageAssessment0 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StageAssessment0?.setPatient)
                {
                    await
                    StageAssessment0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const StageAssessment1 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StageAssessment1?.setPatient)
                {
                    await
                    StageAssessment1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const StageAssessment2 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StageAssessment2?.setPatient)
                {
                    await
                    StageAssessment2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const StageAssessment3 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StageAssessment3?.setPatient)
                {
                    await
                    StageAssessment3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const StageAssessment4 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (StageAssessment4?.setPatient)
                {
                    await
                    StageAssessment4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateStageAssessmentWithReviewed_by_user() {
            
                const relatedReviewed_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StageAssessment0 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StageAssessment0?.setReviewed_by_user)
                {
                    await
                    StageAssessment0.
                    setReviewed_by_user(relatedReviewed_by_user0);
                }
            
                const relatedReviewed_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StageAssessment1 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StageAssessment1?.setReviewed_by_user)
                {
                    await
                    StageAssessment1.
                    setReviewed_by_user(relatedReviewed_by_user1);
                }
            
                const relatedReviewed_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StageAssessment2 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StageAssessment2?.setReviewed_by_user)
                {
                    await
                    StageAssessment2.
                    setReviewed_by_user(relatedReviewed_by_user2);
                }
            
                const relatedReviewed_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StageAssessment3 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StageAssessment3?.setReviewed_by_user)
                {
                    await
                    StageAssessment3.
                    setReviewed_by_user(relatedReviewed_by_user3);
                }
            
                const relatedReviewed_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StageAssessment4 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (StageAssessment4?.setReviewed_by_user)
                {
                    await
                    StageAssessment4.
                    setReviewed_by_user(relatedReviewed_by_user4);
                }
            
        }
        
    
        
            
            async function associateStageAssessmentWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const StageAssessment0 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StageAssessment0?.setAccount)
                {
                    await
                    StageAssessment0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const StageAssessment1 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StageAssessment1?.setAccount)
                {
                    await
                    StageAssessment1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const StageAssessment2 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StageAssessment2?.setAccount)
                {
                    await
                    StageAssessment2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const StageAssessment3 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StageAssessment3?.setAccount)
                {
                    await
                    StageAssessment3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const StageAssessment4 = await StageAssessments.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (StageAssessment4?.setAccount)
                {
                    await
                    StageAssessment4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateVoiceAssistantSessionWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VoiceAssistantSession0 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VoiceAssistantSession0?.setPatient)
                {
                    await
                    VoiceAssistantSession0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VoiceAssistantSession1 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VoiceAssistantSession1?.setPatient)
                {
                    await
                    VoiceAssistantSession1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VoiceAssistantSession2 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VoiceAssistantSession2?.setPatient)
                {
                    await
                    VoiceAssistantSession2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VoiceAssistantSession3 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VoiceAssistantSession3?.setPatient)
                {
                    await
                    VoiceAssistantSession3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const VoiceAssistantSession4 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VoiceAssistantSession4?.setPatient)
                {
                    await
                    VoiceAssistantSession4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateVoiceAssistantSessionWithInitiated_by_user() {
            
                const relatedInitiated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const VoiceAssistantSession0 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VoiceAssistantSession0?.setInitiated_by_user)
                {
                    await
                    VoiceAssistantSession0.
                    setInitiated_by_user(relatedInitiated_by_user0);
                }
            
                const relatedInitiated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const VoiceAssistantSession1 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VoiceAssistantSession1?.setInitiated_by_user)
                {
                    await
                    VoiceAssistantSession1.
                    setInitiated_by_user(relatedInitiated_by_user1);
                }
            
                const relatedInitiated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const VoiceAssistantSession2 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VoiceAssistantSession2?.setInitiated_by_user)
                {
                    await
                    VoiceAssistantSession2.
                    setInitiated_by_user(relatedInitiated_by_user2);
                }
            
                const relatedInitiated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const VoiceAssistantSession3 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VoiceAssistantSession3?.setInitiated_by_user)
                {
                    await
                    VoiceAssistantSession3.
                    setInitiated_by_user(relatedInitiated_by_user3);
                }
            
                const relatedInitiated_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const VoiceAssistantSession4 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VoiceAssistantSession4?.setInitiated_by_user)
                {
                    await
                    VoiceAssistantSession4.
                    setInitiated_by_user(relatedInitiated_by_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateVoiceAssistantSessionWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const VoiceAssistantSession0 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (VoiceAssistantSession0?.setAccount)
                {
                    await
                    VoiceAssistantSession0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const VoiceAssistantSession1 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (VoiceAssistantSession1?.setAccount)
                {
                    await
                    VoiceAssistantSession1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const VoiceAssistantSession2 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (VoiceAssistantSession2?.setAccount)
                {
                    await
                    VoiceAssistantSession2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const VoiceAssistantSession3 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (VoiceAssistantSession3?.setAccount)
                {
                    await
                    VoiceAssistantSession3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const VoiceAssistantSession4 = await VoiceAssistantSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (VoiceAssistantSession4?.setAccount)
                {
                    await
                    VoiceAssistantSession4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateIotDeviceWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotDevice0 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IotDevice0?.setPatient)
                {
                    await
                    IotDevice0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotDevice1 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IotDevice1?.setPatient)
                {
                    await
                    IotDevice1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotDevice2 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IotDevice2?.setPatient)
                {
                    await
                    IotDevice2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotDevice3 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IotDevice3?.setPatient)
                {
                    await
                    IotDevice3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotDevice4 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (IotDevice4?.setPatient)
                {
                    await
                    IotDevice4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateIotDeviceWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotDevice0 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IotDevice0?.setAccount)
                {
                    await
                    IotDevice0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotDevice1 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IotDevice1?.setAccount)
                {
                    await
                    IotDevice1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotDevice2 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IotDevice2?.setAccount)
                {
                    await
                    IotDevice2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotDevice3 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IotDevice3?.setAccount)
                {
                    await
                    IotDevice3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotDevice4 = await IotDevices.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (IotDevice4?.setAccount)
                {
                    await
                    IotDevice4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateIotTelemetryEventWithDevice() {
            
                const relatedDevice0 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const IotTelemetryEvent0 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IotTelemetryEvent0?.setDevice)
                {
                    await
                    IotTelemetryEvent0.
                    setDevice(relatedDevice0);
                }
            
                const relatedDevice1 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const IotTelemetryEvent1 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IotTelemetryEvent1?.setDevice)
                {
                    await
                    IotTelemetryEvent1.
                    setDevice(relatedDevice1);
                }
            
                const relatedDevice2 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const IotTelemetryEvent2 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IotTelemetryEvent2?.setDevice)
                {
                    await
                    IotTelemetryEvent2.
                    setDevice(relatedDevice2);
                }
            
                const relatedDevice3 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const IotTelemetryEvent3 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IotTelemetryEvent3?.setDevice)
                {
                    await
                    IotTelemetryEvent3.
                    setDevice(relatedDevice3);
                }
            
                const relatedDevice4 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const IotTelemetryEvent4 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (IotTelemetryEvent4?.setDevice)
                {
                    await
                    IotTelemetryEvent4.
                    setDevice(relatedDevice4);
                }
            
        }
        
    
        
            
            async function associateIotTelemetryEventWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotTelemetryEvent0 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IotTelemetryEvent0?.setPatient)
                {
                    await
                    IotTelemetryEvent0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotTelemetryEvent1 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IotTelemetryEvent1?.setPatient)
                {
                    await
                    IotTelemetryEvent1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotTelemetryEvent2 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IotTelemetryEvent2?.setPatient)
                {
                    await
                    IotTelemetryEvent2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotTelemetryEvent3 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IotTelemetryEvent3?.setPatient)
                {
                    await
                    IotTelemetryEvent3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const IotTelemetryEvent4 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (IotTelemetryEvent4?.setPatient)
                {
                    await
                    IotTelemetryEvent4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateIotTelemetryEventWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotTelemetryEvent0 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (IotTelemetryEvent0?.setAccount)
                {
                    await
                    IotTelemetryEvent0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotTelemetryEvent1 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (IotTelemetryEvent1?.setAccount)
                {
                    await
                    IotTelemetryEvent1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotTelemetryEvent2 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (IotTelemetryEvent2?.setAccount)
                {
                    await
                    IotTelemetryEvent2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotTelemetryEvent3 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (IotTelemetryEvent3?.setAccount)
                {
                    await
                    IotTelemetryEvent3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const IotTelemetryEvent4 = await IotTelemetryEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (IotTelemetryEvent4?.setAccount)
                {
                    await
                    IotTelemetryEvent4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateGeofenceWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Geofence0 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Geofence0?.setPatient)
                {
                    await
                    Geofence0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Geofence1 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Geofence1?.setPatient)
                {
                    await
                    Geofence1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Geofence2 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Geofence2?.setPatient)
                {
                    await
                    Geofence2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Geofence3 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Geofence3?.setPatient)
                {
                    await
                    Geofence3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Geofence4 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Geofence4?.setPatient)
                {
                    await
                    Geofence4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGeofenceWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Geofence0 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Geofence0?.setAccount)
                {
                    await
                    Geofence0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Geofence1 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Geofence1?.setAccount)
                {
                    await
                    Geofence1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Geofence2 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Geofence2?.setAccount)
                {
                    await
                    Geofence2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Geofence3 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Geofence3?.setAccount)
                {
                    await
                    Geofence3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Geofence4 = await Geofences.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Geofence4?.setAccount)
                {
                    await
                    Geofence4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAlertWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setPatient)
                {
                    await
                    Alert0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setPatient)
                {
                    await
                    Alert1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setPatient)
                {
                    await
                    Alert2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setPatient)
                {
                    await
                    Alert3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const Alert4 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Alert4?.setPatient)
                {
                    await
                    Alert4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateAlertWithDevice() {
            
                const relatedDevice0 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setDevice)
                {
                    await
                    Alert0.
                    setDevice(relatedDevice0);
                }
            
                const relatedDevice1 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setDevice)
                {
                    await
                    Alert1.
                    setDevice(relatedDevice1);
                }
            
                const relatedDevice2 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setDevice)
                {
                    await
                    Alert2.
                    setDevice(relatedDevice2);
                }
            
                const relatedDevice3 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setDevice)
                {
                    await
                    Alert3.
                    setDevice(relatedDevice3);
                }
            
                const relatedDevice4 = await IotDevices.findOne({
                    offset: Math.floor(Math.random() * (await IotDevices.count())),
                });
                const Alert4 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Alert4?.setDevice)
                {
                    await
                    Alert4.
                    setDevice(relatedDevice4);
                }
            
        }
        
    
        
            
            async function associateAlertWithTrigger_event() {
            
                const relatedTrigger_event0 = await IotTelemetryEvents.findOne({
                    offset: Math.floor(Math.random() * (await IotTelemetryEvents.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setTrigger_event)
                {
                    await
                    Alert0.
                    setTrigger_event(relatedTrigger_event0);
                }
            
                const relatedTrigger_event1 = await IotTelemetryEvents.findOne({
                    offset: Math.floor(Math.random() * (await IotTelemetryEvents.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setTrigger_event)
                {
                    await
                    Alert1.
                    setTrigger_event(relatedTrigger_event1);
                }
            
                const relatedTrigger_event2 = await IotTelemetryEvents.findOne({
                    offset: Math.floor(Math.random() * (await IotTelemetryEvents.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setTrigger_event)
                {
                    await
                    Alert2.
                    setTrigger_event(relatedTrigger_event2);
                }
            
                const relatedTrigger_event3 = await IotTelemetryEvents.findOne({
                    offset: Math.floor(Math.random() * (await IotTelemetryEvents.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setTrigger_event)
                {
                    await
                    Alert3.
                    setTrigger_event(relatedTrigger_event3);
                }
            
                const relatedTrigger_event4 = await IotTelemetryEvents.findOne({
                    offset: Math.floor(Math.random() * (await IotTelemetryEvents.count())),
                });
                const Alert4 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Alert4?.setTrigger_event)
                {
                    await
                    Alert4.
                    setTrigger_event(relatedTrigger_event4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAlertWithAssigned_to_user() {
            
                const relatedAssigned_to_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setAssigned_to_user)
                {
                    await
                    Alert0.
                    setAssigned_to_user(relatedAssigned_to_user0);
                }
            
                const relatedAssigned_to_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setAssigned_to_user)
                {
                    await
                    Alert1.
                    setAssigned_to_user(relatedAssigned_to_user1);
                }
            
                const relatedAssigned_to_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setAssigned_to_user)
                {
                    await
                    Alert2.
                    setAssigned_to_user(relatedAssigned_to_user2);
                }
            
                const relatedAssigned_to_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setAssigned_to_user)
                {
                    await
                    Alert3.
                    setAssigned_to_user(relatedAssigned_to_user3);
                }
            
                const relatedAssigned_to_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Alert4 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Alert4?.setAssigned_to_user)
                {
                    await
                    Alert4.
                    setAssigned_to_user(relatedAssigned_to_user4);
                }
            
        }
        
    
        
            
            async function associateAlertWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Alert0 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Alert0?.setAccount)
                {
                    await
                    Alert0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Alert1 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Alert1?.setAccount)
                {
                    await
                    Alert1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Alert2 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Alert2?.setAccount)
                {
                    await
                    Alert2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Alert3 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Alert3?.setAccount)
                {
                    await
                    Alert3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const Alert4 = await Alerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Alert4?.setAccount)
                {
                    await
                    Alert4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAlertNotificationWithAlert() {
            
                const relatedAlert0 = await Alerts.findOne({
                    offset: Math.floor(Math.random() * (await Alerts.count())),
                });
                const AlertNotification0 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlertNotification0?.setAlert)
                {
                    await
                    AlertNotification0.
                    setAlert(relatedAlert0);
                }
            
                const relatedAlert1 = await Alerts.findOne({
                    offset: Math.floor(Math.random() * (await Alerts.count())),
                });
                const AlertNotification1 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlertNotification1?.setAlert)
                {
                    await
                    AlertNotification1.
                    setAlert(relatedAlert1);
                }
            
                const relatedAlert2 = await Alerts.findOne({
                    offset: Math.floor(Math.random() * (await Alerts.count())),
                });
                const AlertNotification2 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlertNotification2?.setAlert)
                {
                    await
                    AlertNotification2.
                    setAlert(relatedAlert2);
                }
            
                const relatedAlert3 = await Alerts.findOne({
                    offset: Math.floor(Math.random() * (await Alerts.count())),
                });
                const AlertNotification3 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AlertNotification3?.setAlert)
                {
                    await
                    AlertNotification3.
                    setAlert(relatedAlert3);
                }
            
                const relatedAlert4 = await Alerts.findOne({
                    offset: Math.floor(Math.random() * (await Alerts.count())),
                });
                const AlertNotification4 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AlertNotification4?.setAlert)
                {
                    await
                    AlertNotification4.
                    setAlert(relatedAlert4);
                }
            
        }
        
    
        
            
            async function associateAlertNotificationWithRecipient_user() {
            
                const relatedRecipient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlertNotification0 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlertNotification0?.setRecipient_user)
                {
                    await
                    AlertNotification0.
                    setRecipient_user(relatedRecipient_user0);
                }
            
                const relatedRecipient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlertNotification1 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlertNotification1?.setRecipient_user)
                {
                    await
                    AlertNotification1.
                    setRecipient_user(relatedRecipient_user1);
                }
            
                const relatedRecipient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlertNotification2 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlertNotification2?.setRecipient_user)
                {
                    await
                    AlertNotification2.
                    setRecipient_user(relatedRecipient_user2);
                }
            
                const relatedRecipient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlertNotification3 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AlertNotification3?.setRecipient_user)
                {
                    await
                    AlertNotification3.
                    setRecipient_user(relatedRecipient_user3);
                }
            
                const relatedRecipient_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlertNotification4 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AlertNotification4?.setRecipient_user)
                {
                    await
                    AlertNotification4.
                    setRecipient_user(relatedRecipient_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAlertNotificationWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AlertNotification0 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlertNotification0?.setAccount)
                {
                    await
                    AlertNotification0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AlertNotification1 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlertNotification1?.setAccount)
                {
                    await
                    AlertNotification1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AlertNotification2 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlertNotification2?.setAccount)
                {
                    await
                    AlertNotification2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AlertNotification3 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AlertNotification3?.setAccount)
                {
                    await
                    AlertNotification3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AlertNotification4 = await AlertNotifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AlertNotification4?.setAccount)
                {
                    await
                    AlertNotification4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSharedDashboardPostWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const SharedDashboardPost0 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SharedDashboardPost0?.setPatient)
                {
                    await
                    SharedDashboardPost0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const SharedDashboardPost1 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SharedDashboardPost1?.setPatient)
                {
                    await
                    SharedDashboardPost1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const SharedDashboardPost2 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SharedDashboardPost2?.setPatient)
                {
                    await
                    SharedDashboardPost2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const SharedDashboardPost3 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SharedDashboardPost3?.setPatient)
                {
                    await
                    SharedDashboardPost3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const SharedDashboardPost4 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (SharedDashboardPost4?.setPatient)
                {
                    await
                    SharedDashboardPost4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateSharedDashboardPostWithAuthor_user() {
            
                const relatedAuthor_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SharedDashboardPost0 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SharedDashboardPost0?.setAuthor_user)
                {
                    await
                    SharedDashboardPost0.
                    setAuthor_user(relatedAuthor_user0);
                }
            
                const relatedAuthor_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SharedDashboardPost1 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SharedDashboardPost1?.setAuthor_user)
                {
                    await
                    SharedDashboardPost1.
                    setAuthor_user(relatedAuthor_user1);
                }
            
                const relatedAuthor_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SharedDashboardPost2 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SharedDashboardPost2?.setAuthor_user)
                {
                    await
                    SharedDashboardPost2.
                    setAuthor_user(relatedAuthor_user2);
                }
            
                const relatedAuthor_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SharedDashboardPost3 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SharedDashboardPost3?.setAuthor_user)
                {
                    await
                    SharedDashboardPost3.
                    setAuthor_user(relatedAuthor_user3);
                }
            
                const relatedAuthor_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SharedDashboardPost4 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (SharedDashboardPost4?.setAuthor_user)
                {
                    await
                    SharedDashboardPost4.
                    setAuthor_user(relatedAuthor_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSharedDashboardPostWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const SharedDashboardPost0 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SharedDashboardPost0?.setAccount)
                {
                    await
                    SharedDashboardPost0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const SharedDashboardPost1 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SharedDashboardPost1?.setAccount)
                {
                    await
                    SharedDashboardPost1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const SharedDashboardPost2 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SharedDashboardPost2?.setAccount)
                {
                    await
                    SharedDashboardPost2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const SharedDashboardPost3 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SharedDashboardPost3?.setAccount)
                {
                    await
                    SharedDashboardPost3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const SharedDashboardPost4 = await SharedDashboardPosts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (SharedDashboardPost4?.setAccount)
                {
                    await
                    SharedDashboardPost4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateScientificArticleWithValidated_by_user() {
            
                const relatedValidated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScientificArticle0 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScientificArticle0?.setValidated_by_user)
                {
                    await
                    ScientificArticle0.
                    setValidated_by_user(relatedValidated_by_user0);
                }
            
                const relatedValidated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScientificArticle1 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScientificArticle1?.setValidated_by_user)
                {
                    await
                    ScientificArticle1.
                    setValidated_by_user(relatedValidated_by_user1);
                }
            
                const relatedValidated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScientificArticle2 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScientificArticle2?.setValidated_by_user)
                {
                    await
                    ScientificArticle2.
                    setValidated_by_user(relatedValidated_by_user2);
                }
            
                const relatedValidated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScientificArticle3 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScientificArticle3?.setValidated_by_user)
                {
                    await
                    ScientificArticle3.
                    setValidated_by_user(relatedValidated_by_user3);
                }
            
                const relatedValidated_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ScientificArticle4 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ScientificArticle4?.setValidated_by_user)
                {
                    await
                    ScientificArticle4.
                    setValidated_by_user(relatedValidated_by_user4);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateScientificArticleWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ScientificArticle0 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ScientificArticle0?.setAccount)
                {
                    await
                    ScientificArticle0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ScientificArticle1 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ScientificArticle1?.setAccount)
                {
                    await
                    ScientificArticle1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ScientificArticle2 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ScientificArticle2?.setAccount)
                {
                    await
                    ScientificArticle2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ScientificArticle3 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ScientificArticle3?.setAccount)
                {
                    await
                    ScientificArticle3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ScientificArticle4 = await ScientificArticles.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ScientificArticle4?.setAccount)
                {
                    await
                    ScientificArticle4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateArticleRecommendationWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ArticleRecommendation0 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArticleRecommendation0?.setPatient)
                {
                    await
                    ArticleRecommendation0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ArticleRecommendation1 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArticleRecommendation1?.setPatient)
                {
                    await
                    ArticleRecommendation1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ArticleRecommendation2 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArticleRecommendation2?.setPatient)
                {
                    await
                    ArticleRecommendation2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ArticleRecommendation3 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArticleRecommendation3?.setPatient)
                {
                    await
                    ArticleRecommendation3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ArticleRecommendation4 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ArticleRecommendation4?.setPatient)
                {
                    await
                    ArticleRecommendation4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateArticleRecommendationWithArticle() {
            
                const relatedArticle0 = await ScientificArticles.findOne({
                    offset: Math.floor(Math.random() * (await ScientificArticles.count())),
                });
                const ArticleRecommendation0 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArticleRecommendation0?.setArticle)
                {
                    await
                    ArticleRecommendation0.
                    setArticle(relatedArticle0);
                }
            
                const relatedArticle1 = await ScientificArticles.findOne({
                    offset: Math.floor(Math.random() * (await ScientificArticles.count())),
                });
                const ArticleRecommendation1 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArticleRecommendation1?.setArticle)
                {
                    await
                    ArticleRecommendation1.
                    setArticle(relatedArticle1);
                }
            
                const relatedArticle2 = await ScientificArticles.findOne({
                    offset: Math.floor(Math.random() * (await ScientificArticles.count())),
                });
                const ArticleRecommendation2 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArticleRecommendation2?.setArticle)
                {
                    await
                    ArticleRecommendation2.
                    setArticle(relatedArticle2);
                }
            
                const relatedArticle3 = await ScientificArticles.findOne({
                    offset: Math.floor(Math.random() * (await ScientificArticles.count())),
                });
                const ArticleRecommendation3 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArticleRecommendation3?.setArticle)
                {
                    await
                    ArticleRecommendation3.
                    setArticle(relatedArticle3);
                }
            
                const relatedArticle4 = await ScientificArticles.findOne({
                    offset: Math.floor(Math.random() * (await ScientificArticles.count())),
                });
                const ArticleRecommendation4 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ArticleRecommendation4?.setArticle)
                {
                    await
                    ArticleRecommendation4.
                    setArticle(relatedArticle4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateArticleRecommendationWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ArticleRecommendation0 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArticleRecommendation0?.setAccount)
                {
                    await
                    ArticleRecommendation0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ArticleRecommendation1 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArticleRecommendation1?.setAccount)
                {
                    await
                    ArticleRecommendation1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ArticleRecommendation2 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArticleRecommendation2?.setAccount)
                {
                    await
                    ArticleRecommendation2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ArticleRecommendation3 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArticleRecommendation3?.setAccount)
                {
                    await
                    ArticleRecommendation3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ArticleRecommendation4 = await ArticleRecommendations.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ArticleRecommendation4?.setAccount)
                {
                    await
                    ArticleRecommendation4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateClinicalReportWithPatient() {
            
                const relatedPatient0 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ClinicalReport0 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClinicalReport0?.setPatient)
                {
                    await
                    ClinicalReport0.
                    setPatient(relatedPatient0);
                }
            
                const relatedPatient1 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ClinicalReport1 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClinicalReport1?.setPatient)
                {
                    await
                    ClinicalReport1.
                    setPatient(relatedPatient1);
                }
            
                const relatedPatient2 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ClinicalReport2 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClinicalReport2?.setPatient)
                {
                    await
                    ClinicalReport2.
                    setPatient(relatedPatient2);
                }
            
                const relatedPatient3 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ClinicalReport3 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClinicalReport3?.setPatient)
                {
                    await
                    ClinicalReport3.
                    setPatient(relatedPatient3);
                }
            
                const relatedPatient4 = await Patients.findOne({
                    offset: Math.floor(Math.random() * (await Patients.count())),
                });
                const ClinicalReport4 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ClinicalReport4?.setPatient)
                {
                    await
                    ClinicalReport4.
                    setPatient(relatedPatient4);
                }
            
        }
        
    
        
            
            async function associateClinicalReportWithGenerated_by_user() {
            
                const relatedGenerated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClinicalReport0 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClinicalReport0?.setGenerated_by_user)
                {
                    await
                    ClinicalReport0.
                    setGenerated_by_user(relatedGenerated_by_user0);
                }
            
                const relatedGenerated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClinicalReport1 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClinicalReport1?.setGenerated_by_user)
                {
                    await
                    ClinicalReport1.
                    setGenerated_by_user(relatedGenerated_by_user1);
                }
            
                const relatedGenerated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClinicalReport2 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClinicalReport2?.setGenerated_by_user)
                {
                    await
                    ClinicalReport2.
                    setGenerated_by_user(relatedGenerated_by_user2);
                }
            
                const relatedGenerated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClinicalReport3 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClinicalReport3?.setGenerated_by_user)
                {
                    await
                    ClinicalReport3.
                    setGenerated_by_user(relatedGenerated_by_user3);
                }
            
                const relatedGenerated_by_user4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClinicalReport4 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ClinicalReport4?.setGenerated_by_user)
                {
                    await
                    ClinicalReport4.
                    setGenerated_by_user(relatedGenerated_by_user4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateClinicalReportWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ClinicalReport0 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClinicalReport0?.setAccount)
                {
                    await
                    ClinicalReport0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ClinicalReport1 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClinicalReport1?.setAccount)
                {
                    await
                    ClinicalReport1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ClinicalReport2 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClinicalReport2?.setAccount)
                {
                    await
                    ClinicalReport2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ClinicalReport3 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ClinicalReport3?.setAccount)
                {
                    await
                    ClinicalReport3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const ClinicalReport4 = await ClinicalReports.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ClinicalReport4?.setAccount)
                {
                    await
                    ClinicalReport4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAdminMetricsSnapshotWithAccount() {
            
                const relatedAccount0 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AdminMetricsSnapshot0 = await AdminMetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AdminMetricsSnapshot0?.setAccount)
                {
                    await
                    AdminMetricsSnapshot0.
                    setAccount(relatedAccount0);
                }
            
                const relatedAccount1 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AdminMetricsSnapshot1 = await AdminMetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AdminMetricsSnapshot1?.setAccount)
                {
                    await
                    AdminMetricsSnapshot1.
                    setAccount(relatedAccount1);
                }
            
                const relatedAccount2 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AdminMetricsSnapshot2 = await AdminMetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AdminMetricsSnapshot2?.setAccount)
                {
                    await
                    AdminMetricsSnapshot2.
                    setAccount(relatedAccount2);
                }
            
                const relatedAccount3 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AdminMetricsSnapshot3 = await AdminMetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AdminMetricsSnapshot3?.setAccount)
                {
                    await
                    AdminMetricsSnapshot3.
                    setAccount(relatedAccount3);
                }
            
                const relatedAccount4 = await Accounts.findOne({
                    offset: Math.floor(Math.random() * (await Accounts.count())),
                });
                const AdminMetricsSnapshot4 = await AdminMetricsSnapshots.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AdminMetricsSnapshot4?.setAccount)
                {
                    await
                    AdminMetricsSnapshot4.
                    setAccount(relatedAccount4);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Accounts.bulkCreate(AccountsData);
                
            
            
                
                await Patients.bulkCreate(PatientsData);
                
            
            
                
                await PatientAccessGrants.bulkCreate(PatientAccessGrantsData);
                
            
            
                
                await Medications.bulkCreate(MedicationsData);
                
            
            
                
                await MedicationSchedules.bulkCreate(MedicationSchedulesData);
                
            
            
                
                await CalendarEvents.bulkCreate(CalendarEventsData);
                
            
            
                
                await Reminders.bulkCreate(RemindersData);
                
            
            
                
                await CognitivePrograms.bulkCreate(CognitiveProgramsData);
                
            
            
                
                await CognitiveExercises.bulkCreate(CognitiveExercisesData);
                
            
            
                
                await CognitiveSessions.bulkCreate(CognitiveSessionsData);
                
            
            
                
                await CognitiveAttempts.bulkCreate(CognitiveAttemptsData);
                
            
            
                
                await StageAssessments.bulkCreate(StageAssessmentsData);
                
            
            
                
                await VoiceAssistantSessions.bulkCreate(VoiceAssistantSessionsData);
                
            
            
                
                await IotDevices.bulkCreate(IotDevicesData);
                
            
            
                
                await IotTelemetryEvents.bulkCreate(IotTelemetryEventsData);
                
            
            
                
                await Geofences.bulkCreate(GeofencesData);
                
            
            
                
                await Alerts.bulkCreate(AlertsData);
                
            
            
                
                await AlertNotifications.bulkCreate(AlertNotificationsData);
                
            
            
                
                await SharedDashboardPosts.bulkCreate(SharedDashboardPostsData);
                
            
            
                
                await ScientificArticles.bulkCreate(ScientificArticlesData);
                
            
            
                
                await ArticleRecommendations.bulkCreate(ArticleRecommendationsData);
                
            
            
                
                await ClinicalReports.bulkCreate(ClinicalReportsData);
                
            
            
                
                await AdminMetricsSnapshots.bulkCreate(AdminMetricsSnapshotsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithAccount(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePatientWithAccount(),
                    
                
                    
                        
                        await associatePatientWithPrimary_physician(),
                    
                
            
                
                
                    
                        
                        await associatePatientAccessGrantWithPatient(),
                    
                
                    
                        
                        await associatePatientAccessGrantWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePatientAccessGrantWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateMedicationWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMedicationWithPrescribed_by(),
                    
                
                    
                        
                        await associateMedicationWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateMedicationScheduleWithMedication(),
                    
                
                    
                        
                        await associateMedicationScheduleWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMedicationScheduleWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateCalendarEventWithPatient(),
                    
                
                    
                        
                        await associateCalendarEventWithCreated_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCalendarEventWithLinked_medication(),
                    
                
                    
                        
                        await associateCalendarEventWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateReminderWithPatient(),
                    
                
                    
                        
                        await associateReminderWithEvent(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateReminderWithRecipient_user(),
                    
                
                    
                        
                        await associateReminderWithAccount(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCognitiveProgramWithCreated_by_user(),
                    
                
                    
                        
                        await associateCognitiveProgramWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateCognitiveExercisWithProgram(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCognitiveExercisWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateCognitiveSessionWithPatient(),
                    
                
                    
                        
                        await associateCognitiveSessionWithProgram(),
                    
                
                    
                        
                        await associateCognitiveSessionWithStarted_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCognitiveSessionWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateCognitiveAttemptWithSession(),
                    
                
                    
                        
                        await associateCognitiveAttemptWithExercise(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCognitiveAttemptWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateStageAssessmentWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStageAssessmentWithReviewed_by_user(),
                    
                
                    
                        
                        await associateStageAssessmentWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateVoiceAssistantSessionWithPatient(),
                    
                
                    
                        
                        await associateVoiceAssistantSessionWithInitiated_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateVoiceAssistantSessionWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateIotDeviceWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateIotDeviceWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateIotTelemetryEventWithDevice(),
                    
                
                    
                        
                        await associateIotTelemetryEventWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateIotTelemetryEventWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateGeofenceWithPatient(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGeofenceWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateAlertWithPatient(),
                    
                
                    
                        
                        await associateAlertWithDevice(),
                    
                
                    
                        
                        await associateAlertWithTrigger_event(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAlertWithAssigned_to_user(),
                    
                
                    
                        
                        await associateAlertWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateAlertNotificationWithAlert(),
                    
                
                    
                        
                        await associateAlertNotificationWithRecipient_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAlertNotificationWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateSharedDashboardPostWithPatient(),
                    
                
                    
                        
                        await associateSharedDashboardPostWithAuthor_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSharedDashboardPostWithAccount(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateScientificArticleWithValidated_by_user(),
                    
                
                    
                
                    
                
                    
                        
                        await associateScientificArticleWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateArticleRecommendationWithPatient(),
                    
                
                    
                        
                        await associateArticleRecommendationWithArticle(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateArticleRecommendationWithAccount(),
                    
                
            
                
                
                    
                        
                        await associateClinicalReportWithPatient(),
                    
                
                    
                        
                        await associateClinicalReportWithGenerated_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateClinicalReportWithAccount(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAdminMetricsSnapshotWithAccount(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('accounts', null, {});
            
            
            await queryInterface.bulkDelete('patients', null, {});
            
            
            await queryInterface.bulkDelete('patient_access_grants', null, {});
            
            
            await queryInterface.bulkDelete('medications', null, {});
            
            
            await queryInterface.bulkDelete('medication_schedules', null, {});
            
            
            await queryInterface.bulkDelete('calendar_events', null, {});
            
            
            await queryInterface.bulkDelete('reminders', null, {});
            
            
            await queryInterface.bulkDelete('cognitive_programs', null, {});
            
            
            await queryInterface.bulkDelete('cognitive_exercises', null, {});
            
            
            await queryInterface.bulkDelete('cognitive_sessions', null, {});
            
            
            await queryInterface.bulkDelete('cognitive_attempts', null, {});
            
            
            await queryInterface.bulkDelete('stage_assessments', null, {});
            
            
            await queryInterface.bulkDelete('voice_assistant_sessions', null, {});
            
            
            await queryInterface.bulkDelete('iot_devices', null, {});
            
            
            await queryInterface.bulkDelete('iot_telemetry_events', null, {});
            
            
            await queryInterface.bulkDelete('geofences', null, {});
            
            
            await queryInterface.bulkDelete('alerts', null, {});
            
            
            await queryInterface.bulkDelete('alert_notifications', null, {});
            
            
            await queryInterface.bulkDelete('shared_dashboard_posts', null, {});
            
            
            await queryInterface.bulkDelete('scientific_articles', null, {});
            
            
            await queryInterface.bulkDelete('article_recommendations', null, {});
            
            
            await queryInterface.bulkDelete('clinical_reports', null, {});
            
            
            await queryInterface.bulkDelete('admin_metrics_snapshots', null, {});
            
        
    },
};