<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use App\Models\SelfPaced\Course;
use App\Models\SelfPaced\CourseCategory;
use App\Models\SelfPaced\CourseTopic;
use App\Models\SelfPaced\CourseSubTopic;
use App\Models\SelfPaced\ExamQuestion;
use App\Models\SelfPaced\CourseDownload;
use App\Models\User;

/**
 * LeadershipDigitalHealthCourseSeeder
 *
 * Seeds the "Professional Certificate in Leadership in Digital Health" course
 * with 8 topics, 4 subtopics each (32 total), 40 exam questions, and 2 downloads.
 * All fees in South Sudanese Pound (SSP). Fully idempotent via firstOrCreate.
 *
 * Run individually:
 *   php artisan db:seed --class=LeadershipDigitalHealthCourseSeeder
 *
 * Requirements: 2.1–2.12, 3.1–3.5, 4.1–4.6, 5.1–5.9, 6.1–6.6, 7.1–7.5, 10.1–10.4
 */
class LeadershipDigitalHealthCourseSeeder extends Seeder
{
    private int $createdById  = 1;
    private int $instructorId = 1;

    // -------------------------------------------------------------------------
    // ENTRY POINT
    // -------------------------------------------------------------------------

    public function run(): void
    {
        DB::transaction(function () {
            $this->resolveUsers();
            $course = $this->makeCourse();
            $this->seedTopics($course);
            $this->seedQuestions($course);
            $this->seedDownloads($course);
        });

        $this->command->info('LeadershipDigitalHealthCourseSeeder: course seeded successfully.');
    }

    // -------------------------------------------------------------------------
    // HELPERS
    // -------------------------------------------------------------------------

    private function resolveUsers(): void
    {
        $admin   = User::whereHas('roles', fn ($q) => $q->where('name', 'Super Manager'))->first();
        $trainer = User::whereHas('roles', fn ($q) => $q->where('name', 'Trainers'))->first();
        $this->createdById  = $admin?->id ?? 1;
        $this->instructorId = $trainer?->id ?? $admin?->id ?? 1;
    }

    private function makeCourse(): Course
    {
        $category = CourseCategory::where('slug', 'digital-health')->first();

        return Course::firstOrCreate(
            ['slug' => 'professional-certificate-leadership-digital-health'],
            [
                'title'                      => 'Professional Certificate in Leadership in Digital Health',
                'description'                => 'This Professional Certificate prepares health leaders and managers in South Sudan to drive digital transformation in the health sector. Participants will develop competencies in health information systems, electronic medical records, telemedicine, cybersecurity, mHealth, and digital health policy. The course equips graduates to lead digital health initiatives that improve health service delivery, data quality, and health outcomes across South Sudan\'s diverse health system.',
                'objectives'                 => "By the end of this course, participants will be able to:\n- Explain the foundations and global landscape of digital health\n- Evaluate and implement health information systems including EMR platforms\n- Design and manage telemedicine and remote care programmes\n- Apply data management principles to digital health data\n- Implement cybersecurity measures to protect health information\n- Lead digital transformation initiatives in health organisations\n- Develop and evaluate mHealth applications for South Sudan contexts\n- Analyse digital health policies and contribute to their development",
                'prerequisites'              => 'Basic computer literacy and familiarity with health service delivery. Experience in a health management, clinical, or public health role is recommended. No prior IT or programming knowledge is required.',
                'category_id'                => $category?->id,
                'instructor_id'              => $this->instructorId,
                'fee_amount'                 => 90000.00,
                'currency'                   => 'SSP',
                'duration_hours'             => 45,
                'passing_score'              => 70,
                'exam_attempts_allowed'      => 3,
                'exam_time_limit'            => 90,
                'exam_questions_per_attempt' => 20,
                'status'                     => 'published',
                'created_by'                 => $this->createdById,
                'updated_by'                 => $this->createdById,
            ]
        );
    }

    private function makeTopic(Course $course, string $title, string $description, int $order): CourseTopic
    {
        return CourseTopic::firstOrCreate(
            ['course_id' => $course->id, 'title' => $title],
            [
                'description'  => $description,
                'sort_order'   => $order,
                'is_published' => true,
            ]
        );
    }

    private function makeSub(CourseTopic $topic, string $title, string $html, int $order): void
    {
        CourseSubTopic::firstOrCreate(
            ['topic_id' => $topic->id, 'title' => $title],
            [
                'content'      => $html,
                'sort_order'   => $order,
                'is_published' => true,
            ]
        );
    }

    private function makeQuestion(Course $course, array $q, int $order): void
    {
        ExamQuestion::firstOrCreate(
            ['course_id' => $course->id, 'question_text' => $q['question']],
            [
                'option_a'               => $q['a'],
                'option_b'               => $q['b'],
                'option_c'               => $q['c'],
                'option_d'               => $q['d'],
                'correct_answer'         => $q['answer'],
                'explanation'            => $q['explanation'],
                'allow_multiple_answers' => false,
                'correct_answers_json'   => null,
                'sort_order'             => $order,
                'is_active'              => true,
            ]
        );
    }

    private function makeDownload(Course $course, string $title, string $fileName, string $mimeType, int $fileSize): void
    {
        $slug = $course->slug;
        CourseDownload::firstOrCreate(
            ['course_id' => $course->id, 'title' => $title],
            [
                'topic_id'  => null,
                'file_path' => "downloads/courses/{$slug}/{$fileName}",
                'file_name' => $fileName,
                'file_size' => $fileSize,
                'mime_type' => $mimeType,
            ]
        );
    }

    // -------------------------------------------------------------------------
    // TOPICS & SUBTOPICS
    // -------------------------------------------------------------------------

    private function seedTopics(Course $course): void
    {
        $this->seedTopic1($course);
        $this->seedTopic2($course);
        $this->seedTopic3($course);
        $this->seedTopic4($course);
        $this->seedTopic5($course);
        $this->seedTopic6($course);
        $this->seedTopic7($course);
        $this->seedTopic8($course);
    }

    // =========================================================================
    // TOPIC 1 — Foundations of Digital Health
    // =========================================================================
    private function seedTopic1(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Foundations of Digital Health',
            'An introduction to digital health concepts, the global digital health landscape, and the state of digital health in South Sudan.',
            1
        );

        $this->makeSub($topic, 'Defining Digital Health and Its Scope', <<<HTML
<h3>What is Digital Health?</h3>
<p>Digital health is a broad term encompassing the use of information and communication technologies (ICT) to improve health and health care. It includes electronic health records, telemedicine, mobile health applications, wearable devices, artificial intelligence in diagnostics, and health information systems. The World Health Organization (WHO) defines digital health as the field of knowledge and practice associated with the development and use of digital technologies to improve health.</p>
<p>The scope of digital health extends across the entire health system — from individual patient care to population health management, from clinical decision support to health system administration. In South Sudan, digital health has the potential to address some of the most pressing health system challenges, including weak health information systems, limited access to specialist care, and poor supply chain management.</p>
<h3>Key Digital Health Domains</h3>
<ul>
  <li><strong>Health Information Systems (HIS):</strong> Systems for collecting, storing, managing, and transmitting health data.</li>
  <li><strong>Electronic Medical Records (EMR):</strong> Digital versions of patient health records.</li>
  <li><strong>Telemedicine:</strong> Remote delivery of health services using telecommunications technology.</li>
  <li><strong>mHealth:</strong> Health services and information delivered through mobile devices.</li>
  <li><strong>Artificial Intelligence (AI) in Health:</strong> Machine learning and AI applications for diagnosis, treatment, and health system management.</li>
  <li><strong>Digital Health Analytics:</strong> Using data analytics to generate insights for health decision-making.</li>
</ul>
<p>Understanding the full scope of digital health is essential for leaders who must make strategic decisions about which digital technologies to adopt, how to implement them effectively, and how to measure their impact on health outcomes in the South Sudan context.</p>
HTML, 1);

        $this->makeSub($topic, 'Global Digital Health Landscape and Frameworks', <<<HTML
<h3>The Global Digital Health Strategy</h3>
<p>The WHO Global Strategy on Digital Health 2020–2025 provides a framework for countries to harness digital technologies to achieve universal health coverage and the Sustainable Development Goals (SDGs). The strategy identifies four strategic objectives: promoting global collaboration, advancing the transfer of digital health knowledge, implementing digital health solutions at scale, and fostering an ecosystem for digital health innovation.</p>
<p>Key global digital health frameworks and initiatives include:</p>
<ul>
  <li><strong>WHO SMART Guidelines:</strong> A framework for developing and implementing evidence-based digital health guidelines.</li>
  <li><strong>OpenHIE (Open Health Information Exchange):</strong> A community-driven framework for health information exchange architecture.</li>
  <li><strong>Digital Square:</strong> A USAID-funded initiative that supports the development and adoption of global digital health goods.</li>
  <li><strong>DHIS2:</strong> The world's largest health management information system platform, used in over 70 countries including South Sudan.</li>
</ul>
<h3>Digital Health Maturity Models</h3>
<p>Digital health maturity models provide a framework for assessing an organisation's or country's current level of digital health adoption and identifying a pathway for advancement. The WHO-ITU National eHealth Strategy Toolkit and the HIMSS Electronic Medical Record Adoption Model (EMRAM) are widely used maturity frameworks. Understanding where South Sudan sits on the digital health maturity spectrum is essential for setting realistic goals and prioritising investments in digital health infrastructure and capacity.</p>
HTML, 2);

        $this->makeSub($topic, 'Digital Health in South Sudan: Context and Challenges', <<<HTML
<h3>The Digital Health Landscape in South Sudan</h3>
<p>South Sudan faces significant challenges in digital health adoption, but also has important opportunities. The country has made progress in implementing DHIS2 for routine health data collection, and mobile phone penetration has increased significantly, creating a foundation for mHealth interventions. However, major barriers remain:</p>
<ul>
  <li><strong>Infrastructure gaps:</strong> Unreliable electricity supply, limited internet connectivity (particularly in rural areas), and poor road networks constrain digital health deployment.</li>
  <li><strong>Human resource capacity:</strong> Limited numbers of health workers with digital literacy skills, and very few ICT specialists in the health sector.</li>
  <li><strong>Financial constraints:</strong> Limited government budget for health ICT investment, with most digital health initiatives dependent on donor funding.</li>
  <li><strong>Data governance:</strong> Weak legal and regulatory frameworks for health data privacy and security.</li>
  <li><strong>Fragmentation:</strong> Multiple parallel digital health systems implemented by different donors and NGOs, with limited interoperability.</li>
</ul>
<h3>Opportunities for Digital Health in South Sudan</h3>
<p>Despite these challenges, South Sudan has significant opportunities to leapfrog traditional health system development through digital innovation. Mobile phone penetration provides a platform for mHealth interventions. The young population is increasingly digitally literate. International partners are investing in digital health infrastructure. And the relatively underdeveloped state of the health system means there is less legacy infrastructure to replace — South Sudan can build digital systems from the ground up using modern, interoperable architectures.</p>
HTML, 3);

        $this->makeSub($topic, 'Digital Health Leadership Competencies', <<<HTML
<h3>What Makes an Effective Digital Health Leader?</h3>
<p>Leading digital health transformation requires a unique combination of technical knowledge, management skills, and leadership competencies. Digital health leaders in South Sudan must be able to bridge the gap between the technical world of ICT and the operational world of health service delivery. Key competencies include:</p>
<ul>
  <li><strong>Digital literacy:</strong> Understanding of core digital health technologies, their capabilities, and their limitations.</li>
  <li><strong>Strategic thinking:</strong> Ability to develop a digital health vision and strategy aligned with national health priorities.</li>
  <li><strong>Change management:</strong> Skills to lead organisational change and overcome resistance to digital transformation.</li>
  <li><strong>Stakeholder engagement:</strong> Ability to build coalitions of support among clinicians, administrators, government officials, and technology vendors.</li>
  <li><strong>Data literacy:</strong> Ability to interpret and use health data to inform decisions.</li>
  <li><strong>Ethical reasoning:</strong> Understanding of the ethical implications of digital health, including data privacy, equity, and algorithmic bias.</li>
</ul>
<h3>The Digital Health Leader's Role in South Sudan</h3>
<p>In the South Sudan context, digital health leaders must also be advocates — making the case for digital health investment to government officials and donors, building the evidence base for digital health impact, and championing the development of national digital health policies and standards. They must navigate complex multi-stakeholder environments and manage the tension between the desire for rapid digital innovation and the need for sustainable, locally-owned solutions.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 2 — Health Information Systems and EMR
    // =========================================================================
    private function seedTopic2(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Health Information Systems and Electronic Medical Records',
            'Understanding, implementing, and managing health information systems and electronic medical record platforms in the South Sudan health sector.',
            2
        );

        $this->makeSub($topic, 'Health Information System Architecture', <<<HTML
<h3>Components of a Health Information System</h3>
<p>A Health Information System (HIS) is an integrated set of components and procedures organised with the objective of generating information that will improve health management decisions at all levels of the health system. A comprehensive HIS includes:</p>
<ul>
  <li><strong>Data sources:</strong> Health facilities, community health workers, laboratories, pharmacies, vital registration systems.</li>
  <li><strong>Data collection tools:</strong> Paper registers, electronic forms, mobile applications.</li>
  <li><strong>Data transmission:</strong> Networks, internet connectivity, mobile data.</li>
  <li><strong>Data storage:</strong> Databases, servers, cloud storage.</li>
  <li><strong>Data processing and analysis:</strong> Software for aggregating, analysing, and visualising health data.</li>
  <li><strong>Information dissemination:</strong> Reports, dashboards, alerts.</li>
  <li><strong>Data use:</strong> Decision-making at facility, district, state, and national levels.</li>
</ul>
<h3>The OpenHIE Architecture in South Sudan</h3>
<p>The OpenHIE (Open Health Information Exchange) architecture provides a blueprint for building an interoperable national health information system. It defines a set of health system components — including a client registry, facility registry, terminology service, and shared health record — that can exchange data using standard protocols. South Sudan's national HIS architecture is being developed in alignment with OpenHIE principles, with DHIS2 serving as the primary aggregate data repository and OpenMRS being piloted as an EMR platform in selected facilities.</p>
HTML, 1);

        $this->makeSub($topic, 'DHIS2 Implementation and Management', <<<HTML
<h3>DHIS2 in South Sudan</h3>
<p>DHIS2 (District Health Information Software 2) is the national health management information system used by the South Sudan Ministry of Health. It collects aggregate health data from all health facilities across the country, enabling analysis of health trends, monitoring of health programme performance, and generation of reports for national and international stakeholders.</p>
<p>Key DHIS2 functions used in South Sudan include:</p>
<ul>
  <li><strong>Data entry:</strong> Facility staff enter monthly aggregate data on service delivery indicators (e.g., number of ANC visits, immunisations given, malaria cases treated).</li>
  <li><strong>Data validation:</strong> Automated validation rules flag data entry errors and inconsistencies.</li>
  <li><strong>Data analysis:</strong> Built-in analytics tools generate charts, maps, and pivot tables for data visualisation.</li>
  <li><strong>Dashboard creation:</strong> Custom dashboards display key health indicators for different user groups.</li>
  <li><strong>Report generation:</strong> Standard and custom reports for national and donor reporting.</li>
</ul>
<h3>Challenges and Solutions for DHIS2 in South Sudan</h3>
<p>Common challenges in DHIS2 implementation in South Sudan include: poor internet connectivity limiting real-time data entry; limited staff capacity for data entry and analysis; data quality issues due to incomplete or inaccurate reporting; and limited use of DHIS2 data for decision-making at facility and district levels. Solutions include offline data entry capabilities, regular data quality audits, targeted training for data managers, and data review meetings that demonstrate the value of DHIS2 data for local decision-making.</p>
HTML, 2);

        $this->makeSub($topic, 'Electronic Medical Records: Selection and Implementation', <<<HTML
<h3>What is an Electronic Medical Record?</h3>
<p>An Electronic Medical Record (EMR) is a digital version of a patient's paper chart. It contains the medical and treatment history of patients in one practice and is primarily used by providers for diagnosis and treatment. An Electronic Health Record (EHR) is a broader concept that includes data from multiple providers and can be shared across different health care settings.</p>
<p>Key features of a good EMR system for South Sudan include:</p>
<ul>
  <li><strong>Offline functionality:</strong> Ability to work without internet connectivity, with data synchronisation when connectivity is available.</li>
  <li><strong>Low hardware requirements:</strong> Ability to run on low-cost devices given budget constraints.</li>
  <li><strong>Local language support:</strong> Interface available in English and ideally local languages.</li>
  <li><strong>Interoperability:</strong> Ability to exchange data with DHIS2 and other national health systems.</li>
  <li><strong>Open source:</strong> Preference for open-source platforms to avoid vendor lock-in and reduce licensing costs.</li>
</ul>
<h3>EMR Implementation Process</h3>
<p>Implementing an EMR in a South Sudan health facility involves: needs assessment and system selection; infrastructure preparation (hardware, power, connectivity); system configuration and customisation; staff training; data migration (if applicable); pilot testing; go-live; and ongoing support and maintenance. Each phase requires careful planning and stakeholder engagement to ensure successful adoption. Change management — addressing staff resistance and building digital literacy — is often the most challenging aspect of EMR implementation.</p>
HTML, 3);

        $this->makeSub($topic, 'Data Quality Management in Health Information Systems', <<<HTML
<h3>Why Data Quality Matters</h3>
<p>The value of a health information system depends entirely on the quality of the data it contains. Poor data quality — characterised by incompleteness, inaccuracy, inconsistency, or timeliness failures — leads to poor decisions, misallocation of resources, and ultimately worse health outcomes. In South Sudan, data quality is a persistent challenge across all levels of the health system.</p>
<h3>Dimensions of Data Quality</h3>
<p>Data quality has multiple dimensions that must be assessed and managed:</p>
<ul>
  <li><strong>Completeness:</strong> Are all required data elements recorded? Are all facilities reporting?</li>
  <li><strong>Accuracy:</strong> Does the data correctly reflect the actual health events it represents?</li>
  <li><strong>Consistency:</strong> Is the data consistent across different data sources and time periods?</li>
  <li><strong>Timeliness:</strong> Is the data available when it is needed for decision-making?</li>
  <li><strong>Integrity:</strong> Has the data been protected from unauthorised modification?</li>
</ul>
<h3>Data Quality Improvement Strategies</h3>
<p>Practical strategies for improving data quality in South Sudan health information systems include:</p>
<ul>
  <li>Regular data quality audits comparing HIS data with source registers</li>
  <li>Automated validation rules in DHIS2 to flag implausible values</li>
  <li>Targeted training for data entry staff on correct recording and reporting procedures</li>
  <li>Supervisory visits that include data quality review as a standard component</li>
  <li>Data review meetings at facility and district level that create accountability for data quality</li>
  <li>Feedback mechanisms that show facilities how their data compares with district and national averages</li>
</ul>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 3 — Telemedicine and Remote Care
    // =========================================================================
    private function seedTopic3(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Telemedicine and Remote Care',
            'Designing, implementing, and managing telemedicine programmes to extend health service reach in South Sudan\'s remote and underserved areas.',
            3
        );

        $this->makeSub($topic, 'Introduction to Telemedicine', <<<HTML
<h3>What is Telemedicine?</h3>
<p>Telemedicine is the delivery of health care services using telecommunications technology, allowing health professionals to evaluate, diagnose, and treat patients at a distance. It encompasses a wide range of services including teleconsultation, telediagnosis, telemonitoring, and telerehabilitation. The WHO defines telemedicine as the delivery of health care services where distance is a critical factor, by all health care professionals using ICT for the exchange of valid information for diagnosis, treatment, and prevention of disease.</p>
<p>Telemedicine modalities include:</p>
<ul>
  <li><strong>Synchronous telemedicine:</strong> Real-time interaction between patient and provider using video conferencing or telephone.</li>
  <li><strong>Asynchronous telemedicine (store-and-forward):</strong> Medical data (images, videos, patient records) are collected and transmitted to a specialist for review at a later time.</li>
  <li><strong>Remote patient monitoring:</strong> Continuous or periodic collection of patient health data using digital devices, transmitted to health providers for review.</li>
</ul>
<h3>Telemedicine in the South Sudan Context</h3>
<p>South Sudan has enormous potential for telemedicine given the vast distances between communities and health facilities, the severe shortage of specialists, and the increasing mobile phone penetration. Telemedicine can connect community health workers in remote areas with clinical officers and doctors in district hospitals, enabling better case management and reducing unnecessary referrals. It can also connect South Sudan health workers with regional and international specialists for complex cases.</p>
HTML, 1);

        $this->makeSub($topic, 'Telemedicine Programme Design and Implementation', <<<HTML
<h3>Designing a Telemedicine Programme</h3>
<p>Designing an effective telemedicine programme for South Sudan requires careful consideration of the local context, including infrastructure constraints, user capacity, and clinical needs. Key design considerations include:</p>
<ul>
  <li><strong>Use case definition:</strong> What specific clinical problems will the telemedicine programme address? (e.g., dermatology consultations, mental health support, maternal health monitoring)</li>
  <li><strong>Technology selection:</strong> What platform will be used? Options range from simple SMS-based systems to sophisticated video conferencing platforms. The choice must be appropriate for available connectivity and user digital literacy.</li>
  <li><strong>Workflow integration:</strong> How will telemedicine be integrated into existing clinical workflows? Who will initiate consultations, and how will responses be communicated?</li>
  <li><strong>Training requirements:</strong> What training do health workers need to use the telemedicine system effectively?</li>
  <li><strong>Quality assurance:</strong> How will the quality of telemedicine consultations be monitored and maintained?</li>
</ul>
<h3>Implementation Challenges</h3>
<p>Common challenges in telemedicine implementation in South Sudan include: unreliable electricity and internet connectivity; limited digital literacy among health workers; resistance from clinicians concerned about liability and quality of care; lack of regulatory frameworks for telemedicine; and sustainability concerns after initial donor funding ends. Addressing these challenges requires a phased implementation approach, strong change management, and advocacy for supportive policies and regulations.</p>
HTML, 2);

        $this->makeSub($topic, 'Regulatory and Ethical Considerations in Telemedicine', <<<HTML
<h3>Regulatory Framework for Telemedicine</h3>
<p>Telemedicine raises important regulatory questions that health leaders must address. In South Sudan, the regulatory framework for telemedicine is still developing. Key regulatory considerations include:</p>
<ul>
  <li><strong>Licensure:</strong> Are health professionals licensed to practice telemedicine across state boundaries? What are the requirements for cross-border telemedicine?</li>
  <li><strong>Liability:</strong> Who is responsible if a telemedicine consultation results in a poor patient outcome?</li>
  <li><strong>Prescribing:</strong> Can health professionals prescribe medications based on a telemedicine consultation without a physical examination?</li>
  <li><strong>Data privacy:</strong> How is patient data protected during telemedicine consultations?</li>
  <li><strong>Reimbursement:</strong> How are telemedicine services paid for? Are they covered by health insurance or government health financing schemes?</li>
</ul>
<h3>Ethical Considerations</h3>
<p>Telemedicine raises ethical issues including: equity of access (ensuring telemedicine benefits reach the most vulnerable populations, not just those with better connectivity); informed consent (ensuring patients understand the nature and limitations of telemedicine); confidentiality (protecting patient privacy in telemedicine consultations); and the risk of depersonalising care. Health leaders must ensure that telemedicine programmes are designed and implemented in ways that uphold ethical principles and do not exacerbate existing health inequities.</p>
HTML, 3);

        $this->makeSub($topic, 'Evaluating Telemedicine Programme Effectiveness', <<<HTML
<h3>Measuring Telemedicine Impact</h3>
<p>Evaluating the effectiveness of telemedicine programmes requires a clear framework for measuring outcomes across multiple dimensions. The WHO framework for evaluating digital health interventions identifies four evaluation domains: feasibility, usability, effectiveness, and scale-up potential.</p>
<p>Key indicators for telemedicine programme evaluation include:</p>
<ul>
  <li><strong>Access indicators:</strong> Number of consultations conducted, geographic reach, proportion of target population served.</li>
  <li><strong>Quality indicators:</strong> Diagnostic accuracy, adherence to clinical guidelines, patient satisfaction.</li>
  <li><strong>Efficiency indicators:</strong> Cost per consultation, reduction in unnecessary referrals, time saved for patients and providers.</li>
  <li><strong>Health outcome indicators:</strong> Changes in clinical outcomes for conditions managed through telemedicine.</li>
</ul>
<h3>Cost-Effectiveness of Telemedicine</h3>
<p>Demonstrating cost-effectiveness is essential for securing continued investment in telemedicine programmes. Cost-effectiveness analysis should compare the cost of telemedicine consultations with the cost of equivalent in-person consultations, including travel costs for patients and providers. In South Sudan, where travel to health facilities can involve long distances and significant costs, telemedicine can be highly cost-effective even with relatively high technology costs. Documenting and communicating cost-effectiveness evidence is a key responsibility of digital health leaders.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 4 — Digital Health Data Management
    // =========================================================================
    private function seedTopic4(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Digital Health Data Management',
            'Principles and practices for managing health data in digital systems, including data standards, interoperability, and analytics.',
            4
        );

        $this->makeSub($topic, 'Health Data Standards and Interoperability', <<<HTML
<h3>Why Standards Matter in Digital Health</h3>
<p>Health data standards are agreed-upon specifications for how health information should be structured, coded, and exchanged. Without standards, different digital health systems cannot communicate with each other, leading to data silos, duplication of effort, and inability to generate comprehensive health intelligence. In South Sudan, the proliferation of different digital health systems implemented by various donors and NGOs has created significant interoperability challenges.</p>
<h3>Key Health Data Standards</h3>
<ul>
  <li><strong>HL7 FHIR (Fast Healthcare Interoperability Resources):</strong> The leading modern standard for exchanging health information electronically. FHIR defines a set of resources (data elements) and APIs for health data exchange.</li>
  <li><strong>ICD-10/ICD-11:</strong> The International Classification of Diseases, used for coding diagnoses and health conditions.</li>
  <li><strong>SNOMED CT:</strong> A comprehensive clinical terminology system for coding clinical concepts.</li>
  <li><strong>LOINC:</strong> A standard for identifying laboratory and clinical observations.</li>
  <li><strong>ADX (Aggregate Data Exchange):</strong> A standard for exchanging aggregate health data, used by DHIS2.</li>
</ul>
<h3>Interoperability in Practice</h3>
<p>Achieving interoperability between digital health systems in South Sudan requires: adoption of common data standards; implementation of health information exchange (HIE) infrastructure; use of unique patient identifiers; and governance mechanisms to manage data sharing agreements. The OpenHIE architecture provides a practical framework for building interoperable national health information systems that can be adapted to the South Sudan context.</p>
HTML, 1);

        $this->makeSub($topic, 'Health Data Analytics and Visualisation', <<<HTML
<h3>From Data to Decisions</h3>
<p>Health data analytics is the process of examining health data to draw conclusions, identify patterns, and support decision-making. Effective analytics transforms raw health data into actionable intelligence that can improve health service delivery, resource allocation, and health outcomes. In South Sudan, improving the use of health data for decision-making at all levels of the health system is a critical priority.</p>
<h3>Types of Health Data Analytics</h3>
<ul>
  <li><strong>Descriptive analytics:</strong> Summarises what has happened (e.g., monthly malaria case counts by county).</li>
  <li><strong>Diagnostic analytics:</strong> Explains why something happened (e.g., analysis of factors associated with high maternal mortality in specific counties).</li>
  <li><strong>Predictive analytics:</strong> Forecasts what is likely to happen (e.g., predicting disease outbreak risk based on environmental and epidemiological data).</li>
  <li><strong>Prescriptive analytics:</strong> Recommends actions to achieve desired outcomes (e.g., optimising health worker deployment based on disease burden data).</li>
</ul>
<h3>Data Visualisation Tools</h3>
<p>Effective data visualisation makes complex health data accessible to decision-makers who may not have statistical expertise. Tools used in South Sudan health programmes include DHIS2 dashboards, Power BI, Tableau, and simple Excel charts. The choice of visualisation tool should be guided by the technical capacity of users, the complexity of the data, and the availability of software licences. Regardless of the tool used, good data visualisation principles — clarity, accuracy, and appropriate chart type selection — are essential for communicating health data effectively.</p>
HTML, 2);

        $this->makeSub($topic, 'Big Data and Artificial Intelligence in Health', <<<HTML
<h3>Big Data in Health</h3>
<p>Big data refers to extremely large datasets that cannot be processed using traditional data management tools. In health, big data sources include electronic health records, genomic data, medical imaging, wearable device data, social media, and environmental sensors. Big data analytics has the potential to transform health care by enabling more precise diagnosis, personalised treatment, and population health management.</p>
<p>While South Sudan is not yet generating health big data at scale, health leaders need to understand the concept and its implications for future health system development. As digital health systems mature and data volumes grow, big data analytics will become increasingly relevant for South Sudan's health sector.</p>
<h3>Artificial Intelligence Applications in Health</h3>
<p>AI applications in health include:</p>
<ul>
  <li><strong>Medical imaging analysis:</strong> AI algorithms that can detect diseases (e.g., tuberculosis, malaria, diabetic retinopathy) from medical images with accuracy comparable to specialist clinicians.</li>
  <li><strong>Clinical decision support:</strong> AI systems that provide real-time recommendations to clinicians based on patient data.</li>
  <li><strong>Natural language processing:</strong> AI that can extract structured information from unstructured clinical notes.</li>
  <li><strong>Predictive modelling:</strong> AI models that predict patient outcomes, disease outbreaks, or health system demand.</li>
</ul>
<p>For South Sudan, the most immediately relevant AI applications are those that can work with limited data and infrastructure, such as AI-powered diagnostic tools for community health workers and AI-assisted analysis of DHIS2 data for outbreak detection. Health leaders must understand both the potential and the limitations of AI in health, including issues of algorithmic bias, data quality requirements, and the need for human oversight.</p>
HTML, 3);

        $this->makeSub($topic, 'Health Data Governance and Privacy', <<<HTML
<h3>Health Data Governance Framework</h3>
<p>Health data governance refers to the policies, processes, and structures that ensure health data is managed responsibly, securely, and in accordance with legal and ethical requirements. A comprehensive health data governance framework addresses:</p>
<ul>
  <li><strong>Data ownership:</strong> Who owns health data — the patient, the health facility, the government?</li>
  <li><strong>Data access:</strong> Who can access health data, under what conditions, and for what purposes?</li>
  <li><strong>Data quality:</strong> What standards must health data meet, and who is responsible for ensuring data quality?</li>
  <li><strong>Data security:</strong> How is health data protected from unauthorised access, modification, or loss?</li>
  <li><strong>Data retention:</strong> How long should health data be retained, and how should it be disposed of?</li>
</ul>
<h3>Patient Privacy in Digital Health Systems</h3>
<p>Protecting patient privacy is a fundamental ethical and legal obligation in digital health. In South Sudan, the legal framework for health data privacy is still developing, but health leaders must apply international best practices including: obtaining informed consent for data collection and use; implementing technical safeguards (encryption, access controls) to protect patient data; training staff on data privacy obligations; and establishing clear procedures for responding to data breaches. The principle of data minimisation — collecting only the data that is necessary for the stated purpose — is a key privacy protection measure.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 5 — Cybersecurity in Health Systems
    // =========================================================================
    private function seedTopic5(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Cybersecurity in Health Systems',
            'Understanding and implementing cybersecurity measures to protect health information systems and patient data in South Sudan.',
            5
        );

        $this->makeSub($topic, 'Cybersecurity Threats in Health Systems', <<<HTML
<h3>Why Health Systems Are Targeted</h3>
<p>Health systems are increasingly targeted by cybercriminals because they hold large volumes of sensitive personal data, often have weaker cybersecurity defences than other sectors, and are critical infrastructure where disruptions can have life-threatening consequences. Common cybersecurity threats facing health systems include:</p>
<ul>
  <li><strong>Ransomware:</strong> Malicious software that encrypts health system data and demands payment for decryption. Ransomware attacks on hospitals have disrupted patient care globally.</li>
  <li><strong>Phishing:</strong> Fraudulent emails or messages that trick health workers into revealing passwords or installing malware.</li>
  <li><strong>Data breaches:</strong> Unauthorised access to patient health records, which can be sold on the dark web or used for identity theft.</li>
  <li><strong>Insider threats:</strong> Malicious or negligent actions by health system employees that compromise data security.</li>
  <li><strong>Supply chain attacks:</strong> Compromising health system software or hardware through vulnerabilities in the supply chain.</li>
</ul>
<h3>Cybersecurity in the South Sudan Context</h3>
<p>South Sudan faces specific cybersecurity challenges including: limited cybersecurity expertise in the health sector; use of outdated software and hardware; weak password management practices; limited awareness of cybersecurity risks among health workers; and inadequate incident response capabilities. As South Sudan's health system becomes increasingly digital, addressing these vulnerabilities is a critical priority for health leaders.</p>
HTML, 1);

        $this->makeSub($topic, 'Cybersecurity Frameworks and Best Practices', <<<HTML
<h3>Cybersecurity Frameworks</h3>
<p>Several internationally recognised frameworks provide guidance for managing cybersecurity risks in health systems:</p>
<ul>
  <li><strong>NIST Cybersecurity Framework:</strong> A widely used framework that organises cybersecurity activities into five functions: Identify, Protect, Detect, Respond, and Recover.</li>
  <li><strong>ISO 27001:</strong> An international standard for information security management systems.</li>
  <li><strong>HIPAA Security Rule:</strong> US regulations for protecting electronic health information, widely referenced as a best practice standard internationally.</li>
  <li><strong>WHO Digital Health Security Guidelines:</strong> WHO guidance specifically for health sector cybersecurity.</li>
</ul>
<h3>Cybersecurity Best Practices for Health Organisations</h3>
<p>Practical cybersecurity measures for South Sudan health organisations include:</p>
<ul>
  <li><strong>Strong password policies:</strong> Requiring complex passwords and regular password changes.</li>
  <li><strong>Multi-factor authentication:</strong> Requiring a second form of verification in addition to a password.</li>
  <li><strong>Regular software updates:</strong> Keeping operating systems and applications patched to address known vulnerabilities.</li>
  <li><strong>Data backup:</strong> Regular backups of health data stored in a separate, secure location.</li>
  <li><strong>Staff training:</strong> Regular cybersecurity awareness training for all health system staff.</li>
  <li><strong>Access controls:</strong> Limiting access to health data to those who need it for their work.</li>
  <li><strong>Incident response plan:</strong> A documented plan for responding to cybersecurity incidents.</li>
</ul>
HTML, 2);

        $this->makeSub($topic, 'Data Encryption and Access Control', <<<HTML
<h3>Encryption in Health Systems</h3>
<p>Encryption is the process of converting data into a coded format that can only be read by authorised parties with the correct decryption key. Encryption is a fundamental cybersecurity measure for protecting health data, both in transit (when data is being transmitted over networks) and at rest (when data is stored on servers or devices).</p>
<p>Key encryption concepts for health leaders include:</p>
<ul>
  <li><strong>Transport Layer Security (TLS):</strong> The standard protocol for encrypting data in transit over the internet. All health information systems should use HTTPS (which uses TLS) for web-based access.</li>
  <li><strong>End-to-end encryption:</strong> Encryption that ensures only the sender and recipient can read a message, used in secure messaging applications.</li>
  <li><strong>Full disk encryption:</strong> Encrypting all data on a device's storage, protecting data if the device is lost or stolen.</li>
  <li><strong>Database encryption:</strong> Encrypting health data stored in databases to protect against unauthorised access.</li>
</ul>
<h3>Access Control Systems</h3>
<p>Access control systems ensure that only authorised users can access health information systems and that each user can only access the data they need for their work. Role-based access control (RBAC) assigns permissions based on a user's role (e.g., nurse, doctor, administrator), ensuring that each role has access only to the data and functions required for that role. Implementing strong access controls in South Sudan health information systems is essential for protecting patient privacy and preventing data breaches.</p>
HTML, 3);

        $this->makeSub($topic, 'Incident Response and Business Continuity', <<<HTML
<h3>Cybersecurity Incident Response</h3>
<p>Despite best efforts at prevention, cybersecurity incidents will occur. Having a well-prepared incident response plan is essential for minimising the impact of incidents and restoring normal operations as quickly as possible. A cybersecurity incident response plan for a South Sudan health organisation should include:</p>
<ul>
  <li><strong>Incident identification:</strong> Procedures for detecting and reporting cybersecurity incidents.</li>
  <li><strong>Incident classification:</strong> A framework for assessing the severity of incidents and prioritising response.</li>
  <li><strong>Containment:</strong> Immediate steps to limit the spread of the incident (e.g., isolating affected systems).</li>
  <li><strong>Eradication:</strong> Removing the cause of the incident (e.g., removing malware, patching vulnerabilities).</li>
  <li><strong>Recovery:</strong> Restoring affected systems and data from backups.</li>
  <li><strong>Post-incident review:</strong> Analysing the incident to identify lessons learned and improve future defences.</li>
</ul>
<h3>Business Continuity Planning</h3>
<p>Business continuity planning ensures that critical health services can continue during and after a cybersecurity incident. For South Sudan health organisations, this includes maintaining paper-based backup systems for critical clinical processes, ensuring that patient care can continue even if digital systems are unavailable, and having clear communication protocols for informing staff, patients, and stakeholders about system outages. Regular testing of business continuity plans through tabletop exercises and simulations is essential for ensuring they will work when needed.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 6 — Leading Digital Transformation in Health
    // =========================================================================
    private function seedTopic6(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Leading Digital Transformation in Health',
            'Strategies and competencies for leading organisational digital transformation in health settings, including change management and building digital culture.',
            6
        );

        $this->makeSub($topic, 'Digital Transformation Strategy Development', <<<HTML
<h3>What is Digital Transformation?</h3>
<p>Digital transformation in health is the process of integrating digital technology into all areas of a health organisation, fundamentally changing how it operates and delivers value to patients and communities. It is not simply about adopting new technologies — it requires a fundamental rethinking of processes, culture, and ways of working. For South Sudan health organisations, digital transformation represents both a significant challenge and a major opportunity to improve health service delivery.</p>
<h3>Developing a Digital Health Strategy</h3>
<p>A digital health strategy provides a roadmap for an organisation's digital transformation journey. Key components of a digital health strategy include:</p>
<ul>
  <li><strong>Vision:</strong> A compelling picture of what the organisation will look like after digital transformation.</li>
  <li><strong>Current state assessment:</strong> An honest evaluation of the organisation's current digital maturity, including infrastructure, systems, skills, and culture.</li>
  <li><strong>Strategic priorities:</strong> The key areas where digital investment will have the greatest impact on health outcomes and organisational performance.</li>
  <li><strong>Implementation roadmap:</strong> A phased plan for implementing digital initiatives, with clear milestones and resource requirements.</li>
  <li><strong>Governance framework:</strong> Structures and processes for overseeing digital transformation, including a digital health steering committee.</li>
  <li><strong>Monitoring and evaluation framework:</strong> Indicators and processes for tracking progress and measuring impact.</li>
</ul>
<p>In South Sudan, digital health strategies must be realistic about infrastructure constraints and human resource capacity, while being ambitious enough to drive meaningful change. Strategies should be developed through a participatory process that engages clinicians, administrators, patients, and government stakeholders.</p>
HTML, 1);

        $this->makeSub($topic, 'Change Management for Digital Health', <<<HTML
<h3>Why Change Management is Critical</h3>
<p>Technology is only one component of digital transformation — the human dimension is equally important. Research consistently shows that the majority of digital transformation failures are due to people and process issues rather than technology failures. Effective change management is therefore a core competency for digital health leaders.</p>
<h3>Change Management Frameworks</h3>
<p>Several change management frameworks are applicable to digital health transformation:</p>
<ul>
  <li><strong>Kotter's 8-Step Model:</strong> Create urgency, build a guiding coalition, form a strategic vision, enlist a volunteer army, enable action by removing barriers, generate short-term wins, sustain acceleration, and institute change.</li>
  <li><strong>ADKAR Model:</strong> Awareness, Desire, Knowledge, Ability, Reinforcement — a framework for managing individual change.</li>
  <li><strong>Prosci Change Management Methodology:</strong> A structured approach to managing the people side of change.</li>
</ul>
<h3>Overcoming Resistance to Digital Change</h3>
<p>Common sources of resistance to digital health transformation in South Sudan include: fear of job loss due to automation; concerns about increased workload during the transition period; lack of confidence in using new technology; distrust of data privacy and security; and scepticism about the benefits of digital systems based on past failed implementations. Effective strategies for overcoming resistance include: involving staff in the design and selection of digital systems; providing adequate training and ongoing support; demonstrating quick wins that show the benefits of digital systems; and addressing concerns openly and honestly.</p>
HTML, 2);

        $this->makeSub($topic, 'Building Digital Health Capacity and Culture', <<<HTML
<h3>Digital Literacy in Health Organisations</h3>
<p>Digital literacy — the ability to use digital technologies effectively and safely — is a prerequisite for successful digital health transformation. In South Sudan, digital literacy levels among health workers vary widely, from highly digitally literate urban health workers to rural community health workers with limited exposure to digital technology. Building digital literacy across the health workforce requires a systematic, long-term approach.</p>
<p>A digital literacy development programme for South Sudan health workers should include:</p>
<ul>
  <li>Basic computer and smartphone skills training</li>
  <li>Training on specific health information systems (DHIS2, EMR platforms)</li>
  <li>Data management and analysis skills</li>
  <li>Cybersecurity awareness</li>
  <li>Digital communication and collaboration tools</li>
</ul>
<h3>Creating a Digital Health Culture</h3>
<p>A digital health culture is one where staff embrace digital tools, use data to inform decisions, and continuously seek to improve processes through technology. Building this culture requires leadership commitment, visible role modelling by senior leaders, recognition and reward for digital innovation, and creating psychological safety for staff to experiment with new approaches. In South Sudan, where hierarchical organisational cultures are common, creating space for bottom-up digital innovation requires deliberate effort from health leaders.</p>
HTML, 3);

        $this->makeSub($topic, 'Measuring Digital Transformation Impact', <<<HTML
<h3>Defining Success in Digital Transformation</h3>
<p>Measuring the impact of digital transformation is challenging because the benefits are often indirect, long-term, and difficult to attribute to specific digital interventions. Nevertheless, health leaders must be able to demonstrate the value of digital investments to justify continued funding and organisational commitment. A comprehensive measurement framework for digital health transformation should include:</p>
<ul>
  <li><strong>Process metrics:</strong> Measures of how digital systems have changed health service delivery processes (e.g., reduction in patient waiting times, improvement in data completeness).</li>
  <li><strong>Outcome metrics:</strong> Measures of health outcomes that can be attributed to digital interventions (e.g., improvement in treatment adherence, reduction in diagnostic errors).</li>
  <li><strong>Efficiency metrics:</strong> Measures of cost savings and productivity improvements from digital systems.</li>
  <li><strong>User experience metrics:</strong> Measures of staff and patient satisfaction with digital systems.</li>
  <li><strong>Digital maturity metrics:</strong> Measures of progress along the digital health maturity continuum.</li>
</ul>
<p>Regular reporting on digital transformation metrics to senior leadership and stakeholders creates accountability and maintains momentum for the transformation journey. In South Sudan, where resources are scarce, demonstrating clear return on investment from digital health investments is essential for sustaining political and financial support.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 7 — mHealth and Mobile Applications
    // =========================================================================
    private function seedTopic7(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'mHealth and Mobile Applications',
            'Designing, implementing, and evaluating mobile health applications for health service delivery and health promotion in South Sudan.',
            7
        );

        $this->makeSub($topic, 'Introduction to mHealth', <<<HTML
<h3>What is mHealth?</h3>
<p>mHealth (mobile health) refers to the use of mobile devices — primarily smartphones and feature phones — to support health service delivery, health promotion, and health system management. mHealth encompasses a wide range of applications including SMS-based health reminders, mobile data collection tools, clinical decision support apps, telemedicine platforms, and health information portals.</p>
<p>South Sudan has significant potential for mHealth given the rapid growth in mobile phone penetration. Mobile phones are increasingly accessible even in rural areas, and many South Sudanese use mobile money services, demonstrating comfort with mobile technology. mHealth can leverage this existing mobile infrastructure to extend health services to underserved populations.</p>
<h3>mHealth Applications in South Sudan</h3>
<p>Current and potential mHealth applications in South Sudan include:</p>
<ul>
  <li><strong>Community health worker support:</strong> Mobile apps that guide CHWs through clinical protocols, enable data collection, and facilitate supervision.</li>
  <li><strong>Appointment reminders:</strong> SMS reminders for antenatal care, immunisation, and medication refill appointments.</li>
  <li><strong>Disease surveillance:</strong> Mobile reporting of disease cases by community health workers and health facilities.</li>
  <li><strong>Health information:</strong> SMS and voice-based health information services for communities.</li>
  <li><strong>Supply chain management:</strong> Mobile tools for tracking medical supply stocks and ordering.</li>
  <li><strong>Health worker training:</strong> Mobile learning platforms for continuing professional development.</li>
</ul>
HTML, 1);

        $this->makeSub($topic, 'mHealth Application Design and Development', <<<HTML
<h3>Principles of User-Centred mHealth Design</h3>
<p>Effective mHealth applications are designed with the end user at the centre of the design process. User-centred design involves understanding users' needs, contexts, and constraints through research, and iteratively testing and refining the application based on user feedback. For South Sudan, this means designing applications that work on low-cost Android smartphones, function offline in areas with poor connectivity, are available in local languages, and are intuitive for users with limited digital literacy.</p>
<h3>The mHealth Development Process</h3>
<p>Developing an mHealth application involves several stages:</p>
<ul>
  <li><strong>Needs assessment:</strong> Understanding the health problem to be addressed and whether mHealth is an appropriate solution.</li>
  <li><strong>User research:</strong> Understanding the needs, contexts, and constraints of target users through interviews, observations, and focus groups.</li>
  <li><strong>Prototype development:</strong> Creating low-fidelity prototypes (paper mockups, wireframes) for early user testing.</li>
  <li><strong>Iterative development:</strong> Building and testing the application in cycles, incorporating user feedback at each stage.</li>
  <li><strong>Pilot testing:</strong> Testing the application in a real-world setting with a small group of users before full deployment.</li>
  <li><strong>Scale-up:</strong> Deploying the application at scale, with ongoing monitoring and support.</li>
</ul>
<p>Open-source platforms such as CommCare, ODK, and KoBoToolbox provide ready-made frameworks for building mHealth data collection applications without requiring custom software development, making them particularly suitable for resource-constrained settings like South Sudan.</p>
HTML, 2);

        $this->makeSub($topic, 'mHealth for Community Health Workers', <<<HTML
<h3>The Role of CHWs in South Sudan\'s Health System</h3>
<p>Community Health Workers (CHWs) are the backbone of South Sudan's primary health care system, providing essential health services to communities that are far from health facilities. Equipping CHWs with mobile technology can significantly enhance their effectiveness by providing clinical decision support, enabling real-time data collection, facilitating supervision, and connecting them with health facility staff for case management support.</p>
<h3>mHealth Tools for CHWs</h3>
<p>Effective mHealth tools for CHWs in South Sudan should:</p>
<ul>
  <li>Provide step-by-step guidance for clinical protocols (e.g., integrated community case management of childhood illness)</li>
  <li>Enable offline data collection with automatic synchronisation when connectivity is available</li>
  <li>Include visual aids and audio support for CHWs with limited literacy</li>
  <li>Facilitate two-way communication between CHWs and supervisors</li>
  <li>Generate automated alerts for high-risk cases requiring referral</li>
  <li>Track CHW performance and provide feedback to supervisors</li>
</ul>
<h3>Implementation Considerations</h3>
<p>Successful mHealth deployment for CHWs requires: adequate training and ongoing support; reliable device charging solutions (solar chargers in off-grid areas); clear data ownership and privacy policies; integration with national health information systems; and sustainable financing for device replacement and data costs. Engaging CHWs in the design and testing of mHealth tools is essential for ensuring that the tools meet their needs and are adopted in practice.</p>
HTML, 3);

        $this->makeSub($topic, 'mHealth Evaluation and Scale-Up', <<<HTML
<h3>Evaluating mHealth Interventions</h3>
<p>The WHO framework for evaluating digital health interventions provides a structured approach for assessing mHealth programmes. Evaluation should address four questions: Is the intervention feasible in the target context? Is it usable by the target users? Is it effective in achieving its intended health outcomes? Can it be scaled up sustainably?</p>
<p>Common evaluation methods for mHealth interventions include:</p>
<ul>
  <li><strong>Randomised controlled trials (RCTs):</strong> The gold standard for evaluating effectiveness, but often impractical in resource-constrained settings.</li>
  <li><strong>Quasi-experimental designs:</strong> Comparing outcomes in areas with and without the mHealth intervention.</li>
  <li><strong>Pre-post studies:</strong> Comparing outcomes before and after mHealth implementation.</li>
  <li><strong>Process evaluations:</strong> Assessing how the mHealth intervention was implemented and why it did or did not achieve its intended outcomes.</li>
</ul>
<h3>Scaling mHealth in South Sudan</h3>
<p>Scaling mHealth interventions from pilot to national scale requires: evidence of effectiveness from pilot evaluations; government ownership and integration into national health programmes; sustainable financing (government budget, health insurance, user fees); technical infrastructure (connectivity, device supply chains); and human resource capacity for ongoing support and maintenance. The WHO-ITU Be He@lthy Be Mobile initiative provides guidance on scaling mHealth programmes in low-resource settings that is directly applicable to South Sudan.</p>
HTML, 4);
    }

    // =========================================================================
    // TOPIC 8 — Digital Health Policy and Governance
    // =========================================================================
    private function seedTopic8(Course $course): void
    {
        $topic = $this->makeTopic($course,
            'Digital Health Policy and Governance',
            'Understanding and contributing to digital health policy development, governance frameworks, and regulatory environments in South Sudan.',
            8
        );

        $this->makeSub($topic, 'National Digital Health Policy Frameworks', <<<HTML
<h3>The Importance of Digital Health Policy</h3>
<p>Digital health policy provides the legal, regulatory, and strategic framework within which digital health systems operate. Without adequate policy frameworks, digital health initiatives risk being fragmented, unsustainable, and potentially harmful to patients and health workers. Health leaders must understand the existing policy landscape and actively contribute to policy development to ensure that digital health investments are protected and sustained.</p>
<h3>Components of a National Digital Health Policy</h3>
<p>A comprehensive national digital health policy should address:</p>
<ul>
  <li><strong>Vision and strategic objectives:</strong> The government's vision for digital health and the strategic priorities for investment.</li>
  <li><strong>Governance structures:</strong> Who is responsible for overseeing digital health at national level (e.g., a national digital health unit within the Ministry of Health).</li>
  <li><strong>Standards and interoperability:</strong> Mandatory standards for health data and system interoperability.</li>
  <li><strong>Data privacy and security:</strong> Legal requirements for protecting health data.</li>
  <li><strong>Financing:</strong> How digital health will be financed, including government budget allocations and donor coordination.</li>
  <li><strong>Human resource development:</strong> Plans for building digital health capacity in the health workforce.</li>
  <li><strong>Innovation ecosystem:</strong> Policies to support local digital health innovation and entrepreneurship.</li>
</ul>
<p>South Sudan's national digital health policy is still developing. Health leaders have an important role to play in advocating for comprehensive, evidence-based digital health policies that reflect the country's specific needs and context.</p>
HTML, 1);

        $this->makeSub($topic, 'Digital Health Governance Structures', <<<HTML
<h3>Governance for Digital Health</h3>
<p>Effective governance is essential for ensuring that digital health investments achieve their intended outcomes and that risks are managed appropriately. Digital health governance encompasses the structures, processes, and accountability mechanisms that guide digital health decision-making at national, state, and facility levels.</p>
<p>Key governance structures for digital health in South Sudan include:</p>
<ul>
  <li><strong>National Digital Health Steering Committee:</strong> A high-level body providing strategic oversight of national digital health initiatives, chaired by the Ministry of Health.</li>
  <li><strong>Technical Working Group on Digital Health:</strong> A technical body coordinating digital health standards, interoperability, and implementation across government and partners.</li>
  <li><strong>Health Information System Unit:</strong> A dedicated unit within the Ministry of Health responsible for managing national health information systems.</li>
  <li><strong>Facility-level IT committees:</strong> Committees at health facility level responsible for managing local digital health systems and ensuring data quality.</li>
</ul>
<h3>Donor Coordination in Digital Health</h3>
<p>In South Sudan, where most digital health investment comes from international donors, effective donor coordination is essential for avoiding fragmentation and duplication. The Digital Health Technical Working Group provides a platform for coordinating donor investments in digital health, aligning with national priorities, and sharing lessons learned. Health leaders must actively participate in these coordination mechanisms to ensure that their organisations' digital health activities contribute to national goals.</p>
HTML, 2);

        $this->makeSub($topic, 'Regulatory Frameworks for Digital Health', <<<HTML
<h3>Regulating Digital Health Technologies</h3>
<p>Digital health technologies — including medical devices, software applications, and AI systems — require appropriate regulatory oversight to ensure they are safe, effective, and of acceptable quality. Regulatory frameworks for digital health are still developing in most low-income countries, including South Sudan. Health leaders must understand the existing regulatory landscape and advocate for appropriate regulations that protect patients without stifling innovation.</p>
<p>Key regulatory areas for digital health include:</p>
<ul>
  <li><strong>Medical device regulation:</strong> Digital health tools that meet the definition of a medical device (e.g., diagnostic software, monitoring devices) require regulatory approval.</li>
  <li><strong>Health data protection:</strong> Regulations governing the collection, storage, use, and sharing of personal health data.</li>
  <li><strong>Telemedicine regulation:</strong> Rules governing the practice of telemedicine, including licensure, liability, and prescribing.</li>
  <li><strong>Health information system standards:</strong> Mandatory technical standards for health information systems to ensure interoperability and data quality.</li>
</ul>
<h3>Advocating for Enabling Regulations</h3>
<p>Health leaders have a responsibility to advocate for regulatory frameworks that enable beneficial digital health innovation while protecting patients. This includes engaging with government regulators, contributing to policy consultations, sharing evidence from digital health implementations, and building coalitions with other health organisations and technology companies. In South Sudan, where regulatory capacity is limited, health leaders can also support the development of regulatory capacity through technical assistance and knowledge sharing.</p>
HTML, 3);

        $this->makeSub($topic, 'Financing Digital Health in South Sudan', <<<HTML
<h3>The Digital Health Financing Challenge</h3>
<p>Sustainable financing is one of the most significant challenges for digital health in South Sudan. Most digital health initiatives are currently funded by international donors, creating dependency and sustainability risks. Building sustainable domestic financing for digital health requires advocacy for increased government health budget allocations, integration of digital health costs into health programme budgets, and exploration of innovative financing mechanisms.</p>
<h3>Financing Mechanisms for Digital Health</h3>
<p>Potential financing mechanisms for digital health in South Sudan include:</p>
<ul>
  <li><strong>Government budget allocation:</strong> Advocating for dedicated budget lines for health ICT in the national health budget.</li>
  <li><strong>Donor funding:</strong> Securing grants from bilateral donors, multilateral agencies, and foundations for digital health investments.</li>
  <li><strong>Public-private partnerships:</strong> Partnering with technology companies to co-invest in digital health infrastructure and applications.</li>
  <li><strong>Health insurance:</strong> Including digital health services (e.g., telemedicine) in health insurance benefit packages.</li>
  <li><strong>Cross-subsidisation:</strong> Using revenues from digital health services in urban areas to subsidise services in rural areas.</li>
</ul>
<h3>Making the Investment Case</h3>
<p>Health leaders must be able to make a compelling investment case for digital health to government officials and donors. This requires: clear articulation of the health problems that digital health will address; evidence of effectiveness from pilot programmes and global literature; realistic cost estimates and return on investment projections; and a credible implementation plan. Building the evidence base for digital health impact in South Sudan through rigorous evaluation of pilot programmes is therefore a strategic priority for digital health leaders.</p>
HTML, 4);
    }

    // =========================================================================
    // EXAM QUESTIONS (40 total — A=10, B=10, C=10, D=10)
    // =========================================================================
    private function seedQuestions(Course $course): void
    {
        $questions = [
            // Q1 — A
            ['question' => 'Which WHO document provides the global strategic framework for digital health from 2020 to 2025?',
             'a' => 'WHO Global Strategy on Digital Health 2020–2025',
             'b' => 'WHO Digital Health Implementation Guide',
             'c' => 'WHO eHealth Action Plan',
             'd' => 'WHO Health Information Systems Framework',
             'answer' => 'A',
             'explanation' => 'The WHO Global Strategy on Digital Health 2020–2025 provides the overarching framework for countries to harness digital technologies to achieve UHC and the SDGs.'],

            // Q2 — B
            ['question' => 'What does DHIS2 stand for?',
             'a' => 'Digital Health Information System 2',
             'b' => 'District Health Information Software 2',
             'c' => 'Data Health Integration System 2',
             'd' => 'Distributed Health Information Service 2',
             'answer' => 'B',
             'explanation' => 'DHIS2 stands for District Health Information Software 2, the world\'s largest open-source health management information system platform used in over 70 countries.'],

            // Q3 — C
            ['question' => 'Which architecture framework provides a blueprint for building interoperable national health information systems?',
             'a' => 'HIMSS EMRAM',
             'b' => 'HL7 FHIR',
             'c' => 'OpenHIE',
             'd' => 'ISO 27001',
             'answer' => 'C',
             'explanation' => 'OpenHIE (Open Health Information Exchange) provides a community-driven architecture framework for building interoperable national health information systems.'],

            // Q4 — D
            ['question' => 'What is the primary difference between an EMR and an EHR?',
             'a' => 'An EMR is digital while an EHR is paper-based',
             'b' => 'An EMR is used by patients while an EHR is used by providers',
             'c' => 'An EMR stores financial data while an EHR stores clinical data',
             'd' => 'An EMR is used within one practice while an EHR can be shared across multiple providers',
             'answer' => 'D',
             'explanation' => 'An EMR is a digital patient record used within a single practice, while an EHR is a broader concept that includes data from multiple providers and can be shared across health care settings.'],

            // Q5 — A
            ['question' => 'Which telemedicine modality involves collecting medical data and transmitting it to a specialist for review at a later time?',
             'a' => 'Asynchronous telemedicine (store-and-forward)',
             'b' => 'Synchronous telemedicine',
             'c' => 'Remote patient monitoring',
             'd' => 'Teleconsultation',
             'answer' => 'A',
             'explanation' => 'Asynchronous (store-and-forward) telemedicine involves collecting medical data (images, records) and transmitting it for specialist review at a later time, without real-time interaction.'],

            // Q6 — B
            ['question' => 'What is the leading modern standard for exchanging health information electronically?',
             'a' => 'ICD-11',
             'b' => 'HL7 FHIR',
             'c' => 'SNOMED CT',
             'd' => 'ADX',
             'answer' => 'B',
             'explanation' => 'HL7 FHIR (Fast Healthcare Interoperability Resources) is the leading modern standard for health information exchange, defining resources and APIs for interoperability.'],

            // Q7 — C
            ['question' => 'Which type of health data analytics forecasts what is likely to happen based on existing data?',
             'a' => 'Descriptive analytics',
             'b' => 'Diagnostic analytics',
             'c' => 'Predictive analytics',
             'd' => 'Prescriptive analytics',
             'answer' => 'C',
             'explanation' => 'Predictive analytics uses existing data to forecast future events, such as predicting disease outbreak risk based on epidemiological and environmental data.'],

            // Q8 — D
            ['question' => 'Which cybersecurity threat involves malicious software that encrypts health system data and demands payment?',
             'a' => 'Phishing',
             'b' => 'Data breach',
             'c' => 'Insider threat',
             'd' => 'Ransomware',
             'answer' => 'D',
             'explanation' => 'Ransomware is malicious software that encrypts data and demands payment for decryption, and has caused significant disruptions to health systems globally.'],

            // Q9 — A
            ['question' => 'What does the NIST Cybersecurity Framework\'s "Protect" function involve?',
             'a' => 'Implementing safeguards to ensure delivery of critical services',
             'b' => 'Identifying cybersecurity risks and vulnerabilities',
             'c' => 'Detecting cybersecurity events in a timely manner',
             'd' => 'Recovering systems after a cybersecurity incident',
             'answer' => 'A',
             'explanation' => 'The "Protect" function of the NIST Cybersecurity Framework involves implementing appropriate safeguards to ensure delivery of critical infrastructure services.'],

            // Q10 — B
            ['question' => 'Which change management model includes the steps: Create urgency, Build a guiding coalition, and Generate short-term wins?',
             'a' => 'ADKAR Model',
             'b' => 'Kotter\'s 8-Step Model',
             'c' => 'Prosci Methodology',
             'd' => 'Lewin\'s Change Model',
             'answer' => 'B',
             'explanation' => 'Kotter\'s 8-Step Model includes creating urgency, building a guiding coalition, forming a vision, enlisting volunteers, enabling action, generating short-term wins, sustaining acceleration, and instituting change.'],

            // Q11 — C
            ['question' => 'What is the primary purpose of role-based access control (RBAC) in health information systems?',
             'a' => 'To encrypt patient data stored in databases',
             'b' => 'To back up health data to a secure location',
             'c' => 'To ensure users can only access data and functions required for their role',
             'd' => 'To monitor network traffic for cybersecurity threats',
             'answer' => 'C',
             'explanation' => 'RBAC assigns permissions based on a user\'s role, ensuring each user can only access the data and functions they need for their work, protecting patient privacy.'],

            // Q12 — D
            ['question' => 'Which open-source platform is widely used for building mHealth data collection applications in resource-constrained settings?',
             'a' => 'Salesforce Health Cloud',
             'b' => 'Epic Systems',
             'c' => 'Microsoft Dynamics',
             'd' => 'KoBoToolbox / ODK',
             'answer' => 'D',
             'explanation' => 'KoBoToolbox and ODK are open-source mobile data collection platforms widely used in resource-constrained settings for mHealth applications, offering offline functionality and low cost.'],

            // Q13 — A
            ['question' => 'What is the principle of "data minimisation" in health data privacy?',
             'a' => 'Collecting only the data that is necessary for the stated purpose',
             'b' => 'Reducing the size of health databases to save storage costs',
             'c' => 'Limiting the number of staff who can enter data into health systems',
             'd' => 'Compressing health data files to reduce transmission time',
             'answer' => 'A',
             'explanation' => 'Data minimisation is a privacy principle requiring that only data necessary for the stated purpose is collected, reducing privacy risks and compliance burden.'],

            // Q14 — B
            ['question' => 'Which WHO initiative provides guidance on scaling mHealth programmes in low-resource settings?',
             'a' => 'WHO SMART Guidelines',
             'b' => 'WHO-ITU Be He@lthy Be Mobile',
             'c' => 'WHO Digital Square',
             'd' => 'WHO OpenHIE',
             'answer' => 'B',
             'explanation' => 'The WHO-ITU Be He@lthy Be Mobile initiative provides guidance and support for scaling mHealth programmes in low-resource settings, directly applicable to South Sudan.'],

            // Q15 — C
            ['question' => 'What is the main challenge of digital health financing in South Sudan?',
             'a' => 'Excessive government investment crowding out private sector innovation',
             'b' => 'Too many competing domestic technology companies',
             'c' => 'Heavy dependence on international donor funding creating sustainability risks',
             'd' => 'Overly restrictive regulations limiting digital health investment',
             'answer' => 'C',
             'explanation' => 'Most digital health in South Sudan is donor-funded, creating dependency and sustainability risks when donor funding ends — a major challenge for digital health leaders.'],

            // Q16 — D
            ['question' => 'Which data quality dimension asks: "Is the data available when it is needed for decision-making?"',
             'a' => 'Completeness',
             'b' => 'Accuracy',
             'c' => 'Consistency',
             'd' => 'Timeliness',
             'answer' => 'D',
             'explanation' => 'Timeliness refers to whether data is available when needed for decision-making — a critical dimension for health data used in outbreak response and programme management.'],

            // Q17 — A
            ['question' => 'What is the ADKAR model used for in digital health transformation?',
             'a' => 'Managing individual change through Awareness, Desire, Knowledge, Ability, and Reinforcement',
             'b' => 'Assessing digital health maturity across five dimensions',
             'c' => 'Designing mHealth applications using agile development principles',
             'd' => 'Evaluating the cost-effectiveness of digital health interventions',
             'answer' => 'A',
             'explanation' => 'The ADKAR model is a change management framework that guides individuals through change by building Awareness, Desire, Knowledge, Ability, and Reinforcement.'],

            // Q18 — B
            ['question' => 'Which standard is used for coding diagnoses and health conditions in health information systems?',
             'a' => 'HL7 FHIR',
             'b' => 'ICD-10/ICD-11',
             'c' => 'LOINC',
             'd' => 'ADX',
             'answer' => 'B',
             'explanation' => 'ICD-10/ICD-11 (International Classification of Diseases) is the standard for coding diagnoses and health conditions, used in health information systems globally.'],

            // Q19 — C
            ['question' => 'What is Transport Layer Security (TLS) used for in digital health systems?',
             'a' => 'Encrypting data stored on health facility servers',
             'b' => 'Managing user access permissions in health information systems',
             'c' => 'Encrypting data in transit over the internet (HTTPS)',
             'd' => 'Backing up health data to cloud storage',
             'answer' => 'C',
             'explanation' => 'TLS is the protocol used to encrypt data in transit over the internet. Health information systems should use HTTPS (which uses TLS) for all web-based access.'],

            // Q20 — D
            ['question' => 'Which governance body provides strategic oversight of national digital health initiatives in South Sudan?',
             'a' => 'Health Cluster',
             'b' => 'Technical Working Group on Maternal Health',
             'c' => 'NGO Coordination Forum',
             'd' => 'National Digital Health Steering Committee',
             'answer' => 'D',
             'explanation' => 'The National Digital Health Steering Committee provides high-level strategic oversight of national digital health initiatives, chaired by the Ministry of Health.'],
        ];

        foreach ($questions as $i => $q) {
            $this->makeQuestion($course, $q, $i + 1);
        }

        $this->seedQuestions2($course);
    }

    private function seedQuestions2(Course $course): void
    {
        $questions = [
            // Q21 — A
            ['question' => 'What is the primary benefit of offline functionality in mHealth applications for South Sudan?',
             'a' => 'Enables data collection in areas with poor or no internet connectivity',
             'b' => 'Reduces the cost of mobile data plans for health workers',
             'c' => 'Improves the visual design of the application interface',
             'd' => 'Allows multiple users to share a single device simultaneously',
             'answer' => 'A',
             'explanation' => 'Offline functionality is critical for South Sudan where internet connectivity is unreliable, allowing health workers to collect data and use applications without connectivity.'],

            // Q22 — B
            ['question' => 'What does the "Identify" function in the NIST Cybersecurity Framework involve?',
             'a' => 'Implementing safeguards to protect critical services',
             'b' => 'Understanding cybersecurity risks to systems, assets, data, and capabilities',
             'c' => 'Detecting cybersecurity events in a timely manner',
             'd' => 'Responding to detected cybersecurity incidents',
             'answer' => 'B',
             'explanation' => 'The "Identify" function involves developing an organisational understanding of cybersecurity risks to systems, assets, data, and capabilities.'],

            // Q23 — C
            ['question' => 'Which AI application is most immediately relevant for community health workers in South Sudan?',
             'a' => 'Natural language processing for clinical notes',
             'b' => 'Genomic data analysis for personalised medicine',
             'c' => 'AI-powered diagnostic tools that work with limited data and infrastructure',
             'd' => 'Robotic surgery assistance systems',
             'answer' => 'C',
             'explanation' => 'AI-powered diagnostic tools that work with limited data and infrastructure are most relevant for South Sudan CHWs, enabling better case management in resource-constrained settings.'],

            // Q24 — D
            ['question' => 'What is the purpose of a digital health maturity model?',
             'a' => 'To rank countries by their digital health investment levels',
             'b' => 'To certify digital health applications for clinical use',
             'c' => 'To train health workers in digital literacy skills',
             'd' => 'To assess current digital health adoption and identify a pathway for advancement',
             'answer' => 'D',
             'explanation' => 'Digital health maturity models assess an organisation\'s or country\'s current level of digital health adoption and provide a framework for advancing along the maturity continuum.'],

            // Q25 — A
            ['question' => 'What is the CommCare platform primarily used for in health programmes?',
             'a' => 'Building mobile applications for community health worker support and data collection',
             'b' => 'Managing hospital financial accounts and billing',
             'c' => 'Conducting video telemedicine consultations',
             'd' => 'Analysing genomic data for disease research',
             'answer' => 'A',
             'explanation' => 'CommCare is an open-source platform for building mobile applications that support community health workers with clinical protocols, data collection, and supervision.'],

            // Q26 — B
            ['question' => 'Which dimension of digital health transformation focuses on staff attitudes toward digital tools and data use?',
             'a' => 'Digital infrastructure',
             'b' => 'Digital culture',
             'c' => 'Digital governance',
             'd' => 'Digital financing',
             'answer' => 'B',
             'explanation' => 'Digital culture refers to the attitudes, behaviours, and norms around digital tools and data use within an organisation — a critical but often overlooked dimension of digital transformation.'],

            // Q27 — C
            ['question' => 'What is the primary purpose of a health information exchange (HIE)?',
             'a' => 'To train health workers in digital literacy',
             'b' => 'To fund digital health initiatives in low-income countries',
             'c' => 'To enable different health information systems to share data securely',
             'd' => 'To regulate the use of AI in health care',
             'answer' => 'C',
             'explanation' => 'A health information exchange (HIE) enables different health information systems to share patient data securely, supporting continuity of care and population health management.'],

            // Q28 — D
            ['question' => 'What is the most significant barrier to EMR implementation in South Sudan health facilities?',
             'a' => 'Excessive number of EMR vendors competing for contracts',
             'b' => 'Government regulations prohibiting EMR use',
             'c' => 'Lack of interest from health workers in digital systems',
             'd' => 'Unreliable electricity, limited connectivity, and limited digital literacy',
             'answer' => 'D',
             'explanation' => 'Unreliable electricity, limited internet connectivity, and limited digital literacy among health workers are the most significant barriers to EMR implementation in South Sudan.'],

            // Q29 — A
            ['question' => 'What is the purpose of a data quality audit in health information systems?',
             'a' => 'To compare HIS data with source registers to identify errors and inconsistencies',
             'b' => 'To assess the financial cost of data collection activities',
             'c' => 'To evaluate the cybersecurity of health information systems',
             'd' => 'To train data entry staff on DHIS2 procedures',
             'answer' => 'A',
             'explanation' => 'A data quality audit compares data in the HIS with source registers (facility records) to identify errors, omissions, and inconsistencies, enabling targeted quality improvement.'],

            // Q30 — B
            ['question' => 'Which principle should guide the selection of digital health technologies for South Sudan?',
             'a' => 'Always select the most technologically advanced solution available',
             'b' => 'Select solutions appropriate for local context, infrastructure, and user capacity',
             'c' => 'Prioritise proprietary solutions from established international vendors',
             'd' => 'Implement the same solutions used in high-income countries',
             'answer' => 'B',
             'explanation' => 'Technology selection for South Sudan must be guided by local context — infrastructure constraints, user digital literacy, connectivity, and sustainability — not just technical sophistication.'],

            // Q31 — C
            ['question' => 'What is the role of the Digital Health Technical Working Group in South Sudan?',
             'a' => 'To provide clinical care using telemedicine',
             'b' => 'To manage the national DHIS2 database',
             'c' => 'To coordinate digital health standards, interoperability, and implementation across government and partners',
             'd' => 'To regulate digital health applications and devices',
             'answer' => 'C',
             'explanation' => 'The Digital Health Technical Working Group coordinates digital health standards, interoperability, and implementation across government and partners, preventing fragmentation.'],

            // Q32 — D
            ['question' => 'What is end-to-end encryption used for in digital health communications?',
             'a' => 'Encrypting data stored on health facility servers',
             'b' => 'Protecting health data during database backups',
             'c' => 'Securing health worker login credentials',
             'd' => 'Ensuring only the sender and recipient can read a message',
             'answer' => 'D',
             'explanation' => 'End-to-end encryption ensures that only the sender and recipient can read a message, protecting patient data in telemedicine consultations and health worker communications.'],

            // Q33 — A
            ['question' => 'Which evaluation design is considered the gold standard for assessing mHealth effectiveness?',
             'a' => 'Randomised controlled trial (RCT)',
             'b' => 'Pre-post study',
             'c' => 'Process evaluation',
             'd' => 'Case study',
             'answer' => 'A',
             'explanation' => 'Randomised controlled trials (RCTs) are the gold standard for evaluating effectiveness, though they are often impractical in resource-constrained settings like South Sudan.'],

            // Q34 — B
            ['question' => 'What is the primary advantage of open-source EMR platforms for South Sudan health facilities?',
             'a' => 'They provide 24/7 technical support from the vendor',
             'b' => 'They avoid vendor lock-in and reduce licensing costs',
             'c' => 'They are always more feature-rich than proprietary systems',
             'd' => 'They automatically comply with all data privacy regulations',
             'answer' => 'B',
             'explanation' => 'Open-source EMR platforms avoid vendor lock-in and eliminate licensing costs, making them more sustainable for resource-constrained South Sudan health facilities.'],

            // Q35 — C
            ['question' => 'What does prescriptive analytics do in health data analysis?',
             'a' => 'Summarises what has happened in the health system',
             'b' => 'Explains why a health event occurred',
             'c' => 'Recommends actions to achieve desired health outcomes',
             'd' => 'Forecasts future disease trends',
             'answer' => 'C',
             'explanation' => 'Prescriptive analytics recommends specific actions to achieve desired outcomes, such as optimising health worker deployment based on disease burden data.'],

            // Q36 — D
            ['question' => 'Which financing mechanism involves partnering with technology companies to co-invest in digital health infrastructure?',
             'a' => 'Government budget allocation',
             'b' => 'Donor grants',
             'c' => 'Health insurance reimbursement',
             'd' => 'Public-private partnerships',
             'answer' => 'D',
             'explanation' => 'Public-private partnerships involve partnering with technology companies to co-invest in digital health infrastructure, sharing costs and risks between government and private sector.'],

            // Q37 — A
            ['question' => 'What is the primary purpose of solar chargers in mHealth programmes for South Sudan CHWs?',
             'a' => 'To provide reliable device charging in off-grid areas without electricity',
             'b' => 'To reduce the cost of mobile data for health workers',
             'c' => 'To improve the processing speed of mobile devices',
             'd' => 'To enable GPS tracking of community health workers',
             'answer' => 'A',
             'explanation' => 'Solar chargers provide reliable device charging for CHWs in off-grid areas where electricity is unavailable, ensuring continuous operation of mHealth tools.'],

            // Q38 — B
            ['question' => 'What is the LOINC standard used for in health information systems?',
             'a' => 'Coding diagnoses and health conditions',
             'b' => 'Identifying laboratory and clinical observations',
             'c' => 'Exchanging aggregate health data between systems',
             'd' => 'Defining APIs for health data interoperability',
             'answer' => 'B',
             'explanation' => 'LOINC (Logical Observation Identifiers Names and Codes) is a standard for identifying laboratory tests and clinical observations in health information systems.'],

            // Q39 — C
            ['question' => 'What is the most important factor for sustaining digital health transformation in South Sudan?',
             'a' => 'Adopting the latest technology from high-income countries',
             'b' => 'Maximising the number of digital health applications deployed',
             'c' => 'Building government ownership and domestic financing capacity',
             'd' => 'Ensuring all health workers have the latest smartphones',
             'answer' => 'C',
             'explanation' => 'Government ownership and domestic financing capacity are the most important factors for sustaining digital health transformation beyond the initial donor-funded phase.'],

            // Q40 — D
            ['question' => 'Which component of a national digital health policy addresses how health data will be protected legally?',
             'a' => 'Vision and strategic objectives',
             'b' => 'Governance structures',
             'c' => 'Financing mechanisms',
             'd' => 'Data privacy and security regulations',
             'answer' => 'D',
             'explanation' => 'The data privacy and security component of a national digital health policy establishes legal requirements for protecting personal health data, including collection, storage, use, and sharing.'],
        ];

        foreach ($questions as $i => $q) {
            $this->makeQuestion($course, $q, $i + 21);
        }
    }

    // =========================================================================
    // DOWNLOADS
    // =========================================================================
    private function seedDownloads(Course $course): void
    {
        $this->makeDownload(
            $course,
            'Digital Health Strategy Guide',
            'digital-health-strategy-guide.pdf',
            'application/pdf',
            3145728  // ~3 MB
        );

        $this->makeDownload(
            $course,
            'HIS Implementation Checklist (Excel)',
            'his-implementation-checklist.xlsx',
            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            204800   // ~200 KB
        );
    }
}
