Generate Documentation
CIIDCIID-ReportsG3GitHub
  • Introduction to Generate
  • User Guide
    • Getting Started
      • Requesting Generate
      • User Roles and Logging In
      • Navigating Generate
    • Resources
    • Data Population Summary
      • Producing Reports
      • Reports
      • Running Reports
    • Standard Reports
      • EDFacts Reports
        • Creating Submission Files
      • SPP/APR Reports
      • Reports Library
    • Settings
      • Toggle
      • Update
      • Metadata
      • Data Migration
    • Quality Assurance
    • Support
  • Developer Guides
    • Getting Started
    • Installation
      • OAuth Configuration
      • Configuring Metadata Updates
      • Subfolder configuration
      • Optional Installations
      • Azure Installation Guide
      • Upgrade
        • Generate Update
        • Optional Installations
    • Migration
      • Fact Type Table
        • Assessment Fact Type
        • Child Count Fact Type
        • Directory Fact Type
        • Discipline Fact Type
        • Exiting Fact Type
        • Membership
        • Staff
    • Generate Utilities
      • File Comparison
        • Loading Files
        • Run the File Comparison
        • Reviewing Results
        • Researching Mismatches
      • Staging Validation
        • Staging Table Validation Process
      • Rebuild Indexes
      • Cleanup Grades Offered
      • Cleanup Debug Tables
      • Source System Reference Data Mapping Utility
        • Source System Reference Data
      • Staging Table Snapshot
      • Fact Type Table Validation Process
      • Debug Views for Staging and the Fact tables
    • Generate Architecture
    • GitHub Guide
    • Discord Guide
    • Working With Generate Code
      • Migration Stored Procedures
        • Staging.RUN_DMC
        • RDS.Get_MembershipReportData
        • Staging.Staging-to-DimPeople
        • Staging.Staging-To-DimPeople_K12Students
        • Staging.Staging-to-FactK12ProgramParticipations
        • Staging.Staging-To-FactK12SeclusionsOrRestraints
        • Staging.Staging-to-FactK12StudentCounts_ChildCount
        • Staging.Staging-to-FactK12StudentCounts_Chronic
        • Staging.Staging-to-FactK12StudentCounts_Dropout
        • Staging.Staging-to-FactK12StudentCounts_GraduationRate
        • Staging.Staging-to-FactK12StudentCounts_Homeless
        • Staging.Staging-to-FactK12StudentCounts_HSGradPSEnroll
        • Staging.Staging-to-FactK12StudentCounts_Membership
        • Staging.Staging-to-FactK12StudentCounts_MigrantEducationProgram
        • Staging.Staging-to-FactK12StudentCounts_NeglectedOrDelinquent
        • Staging.Staging-to-FactK12StudentCounts_SpecEdExit
        • Staging.Staging-to-FactK12StudentCourseSections
        • Staging.Staging-to-FactK12StudentDisciplines
        • Staging.Staging-to-FactK12StudentEnrollments
        • Staging.Staging-To-FactSpecialEducation
      • Unit Test By File Spec
        • App.DimK12Staff_TestCase
        • App.DimK12Students_TestCase
        • App.FS002_TestCase
        • App.FS005_TestCase
        • App.FS006_TestCase
        • App.FS007_TestCase
        • App.FS009_TestCase
        • App.FS032_TestCase
        • App.FS033_TestCase
        • App.FS040_TestCase
  • Release Notes
    • Introduction
    • Release Notes 12.4
    • Release Notes 12.3
    • Release Notes 12.2
    • Release Notes 12.1
    • Archive
      • Release Notes 12.0
      • Release Notes 11.4
      • Release Notes 11.3
      • Release Notes 11.2
      • Release Notes 11.1
      • Release Notes 11.0
      • Release Notes 5.3
        • Generate 5.3 Office Hour
      • Release Notes 5.2
        • Generate 5.2 Office Hour
      • Release Notes 5.1
        • Generate 5.1 Office Hour
      • Release Notes 5.0
        • Generate 5.0 Office Hour
      • Release Notes 4.1
      • Release Notes 4.0
      • Release Notes 3.8
      • Release Notes 3.7
      • Release Notes 3.6
      • Release Notes 3.5
      • Release Notes 3.4
      • Release Notes 3.3
      • Release Notes 3.2
      • Release Notes 3.1
      • Release Notes 3.0
      • Release Notes 2.4
    • Release Notes 12.3
  • Hot Fixes
    • Hot Fix - 4/13/2023
Powered by GitBook
On this page
  • Overview & Purpose
  • Business Context
  • Parameters
  • Source Tables
  • Temporary Tables
  • Potential Improvements
  • Execution Steps

Was this helpful?

Edit on GitHub
  1. Developer Guides
  2. Working With Generate Code
  3. Unit Test By File Spec

App.FS009_TestCase

Overview & Purpose

This stored procedure is a unit test case for validating the C009 report (Special Education Exit) data generation. It compares data generated by the reporting system against a manually calculated dataset to ensure accuracy across various demographic breakdowns and organizational levels.

Main Functions:

  • Test Data Generation

    Creates test data sets for comparison with the EDFacts C009 report

  • Report Validation

    Compares test data against actual report data to validate accuracy

Key Calculations:

  • Test Data Generation: Counts unique students for each demographic breakdown

    Formula: COUNT(DISTINCT StudentIdentifierState)

    Business Significance: Ensures accurate student counts in special education exit reporting

    Example: Student counts by age, race, disability type, and exit reason

  • Report Validation: Determines if the test case passed or failed

    Formula: CASE WHEN s.StudentCount = ISNULL(rreksc.StudentCount, -1) THEN 1 ELSE 0 END

    Business Significance: Ensures data integrity in federal reporting

    Example: Comparing student counts by disability type between test data and report data

Data Transformations:

  • Filtering students by age range (14-21)

  • Mapping disability codes to EDFacts reporting codes

  • Mapping exit reason codes to EDFacts reporting codes

  • Determining race/ethnicity categories based on federal reporting guidelines

  • Calculating student age based on child count date

Expected Output:

A series of test case results stored in App.SqlUnitTestCaseResult indicating whether each demographic breakdown matches between the test data and the actual report data

Business Context

System: EDFacts Reporting System

Necessity: Ensures accurate federal reporting of special education exit data as required by IDEA

Business Rules:

  • Students must be between ages 14-21

  • Only include students with valid disability codes

  • Exit reasons must map to valid EDFacts codes

  • Data must be aggregated at both SEA (state) and LEA (district) levels

  • Multiple demographic breakdowns must be calculated (race, gender, EL status, disability type)

Result Usage:

Validates the accuracy of C009 (Special Education Exit) report data before federal submission

Execution Frequency:

Annually before EDFacts submission deadline

Critical Periods:

  • EDFacts submission window

Parameters

Parameter
Data Type
Purpose
Required

@SchoolYear

SMALLINT

Specifies the school year for which to run the test case

True

Source Tables

Staging.ProgramParticipationSpecialEducation

Business Purpose: Contains special education program participation data including exit information

Columns:

Name
Data Type
Business Purpose

StudentIdentifierState

VARCHAR

Unique identifier for students at state level

LeaIdentifierSeaAccountability

VARCHAR

Identifies the LEA responsible for the student

ProgramParticipationEndDate

DATETIME

Date when student exited special education

SpecialEducationExitReason

VARCHAR

Reason why student exited special education

Staging.K12Enrollment

Business Purpose: Contains student enrollment information

Columns:

Name
Data Type
Business Purpose

StudentIdentifierState

VARCHAR

Unique identifier for students at state level

Birthdate

DATETIME

Student's date of birth

HispanicLatinoEthnicity

BIT

Indicates if student is Hispanic/Latino

Sex

VARCHAR

Student's sex

Staging.IdeaDisabilityType

Business Purpose: Contains student disability information

Columns:

Name
Data Type
Business Purpose

IdeaDisabilityTypeCode

VARCHAR

Code indicating student's disability category

IsPrimaryDisability

BIT

Indicates if this is the student's primary disability

App.SqlUnitTest

Business Purpose: Stores unit test definitions

Columns:

Name
Data Type
Business Purpose

SqlUnitTestId

INT

Primary key for unit tests

UnitTestName

VARCHAR

Name of the unit test

RDS.ReportEDFactsK12StudentCounts

Business Purpose: Stores generated EDFacts report data

Columns:

Name
Data Type
Business Purpose

ReportCode

VARCHAR

Identifies the EDFacts report (C009)

ReportYear

INT

School year of the report

StudentCount

INT

Count of students in each category

Temporary Tables

#disabilityCodes

Purpose: Stores valid disability codes for the specified school year

Columns:

Name
Data Type
Purpose/Calculation

CategoryOptionCode

VARCHAR(60)

Direct from App.CategoryOptions

#catchmentType

Purpose: Stores the two catchment area types to test

Columns:

Name
Data Type
Purpose/Calculation

CatchmentArea

VARCHAR(100)

Hardcoded values

#staging

Purpose: Stores calculated test data for comparison with report data

Columns:

Name
Data Type
Purpose/Calculation

StudentIdentifierState

VARCHAR(100)

Direct from source

Age

VARCHAR(100)

Calculated based on birthdate and child count date

SpecialEducationExitReasonEdFactsCode

VARCHAR(100)

Mapped from source exit reason to EDFacts code

#stuLea

Purpose: Stores the latest special education exit record for each student by LEA

Columns:

Name
Data Type
Purpose/Calculation

StudentIdentifierState

VARCHAR(20)

Direct from source

LeaIdentifierSeaAccountability

VARCHAR(20)

Direct from source

SpecialEducationServicesExitDate

DATETIME

MAX(ProgramParticipationEndDate)

Potential Improvements

Performance

Description: Add indexes to temporary tables

Benefits: Improved join performance, especially for #staging which is used in multiple joins

Priority: Medium

Code Quality

Description: Consolidate redundant code in test case execution

Benefits: Reduced code duplication, easier maintenance

Priority: Medium

Error Handling

Description: Add more specific error handling for data issues

Benefits: Better diagnostics when tests fail due to data problems

Priority: Low

Execution Steps

Step 1: Initialize test case in App.SqlUnitTest

Input Data: None

Transformations: None

IF NOT EXISTS (SELECT 1 FROM App.SqlUnitTest WHERE UnitTestName = 'FS009_UnitTestCase') BEGIN INSERT INTO App.SqlUnitTest...

Step 2: Clear previous test results

Input Data: SqlUnitTestId

Transformations: None

DELETE FROM App.SqlUnitTestCaseResult WHERE SqlUnitTestId = @SqlUnitTestId

Step 3: Set up school year data migration

Input Data: @SchoolYear parameter

Transformations: None

UPDATE rds.DimSchoolYearDataMigrationTypes SET IsSelected = 1 FROM rds.DimSchoolYearDataMigrationTypes sydmt JOIN rds.DimSchoolYears sy ON sydmt.DimSchoolYearId = sy.DimSchoolYearId WHERE sy.SchoolYear = @SchoolYear

Step 4: Calculate reference dates

Input Data: @SchoolYear parameter

Transformations: Date calculations

select @ChildCountDate = CAST('10/01/' + cast(@SchoolYear - 1 AS Varchar(4)) AS DATETIME)

Step 5: Load disability codes

Input Data: App.CategoryOptions, App.Categories, App.ToggleResponses

Transformations: Filtering by category code and toggle response

INSERT INTO #disabilityCodes SELECT distinct o.CategoryOptionCode from app.CategoryOptions o inner join app.Categories c on o.CategoryId = c.CategoryId and c.CategoryCode = 'DISABCATIDEAEXIT'...

Step 6: Process each catchment area type

Input Data: #catchmentType temp table

Transformations: Multiple

DECLARE db_cursor CURSOR FOR SELECT CatchmentArea FROM #catchmentType

Step 7: Generate report data

Input Data: Multiple source tables

Transformations: Multiple

EXEC RDS.Create_ReportData 'C009', 'specedexit', 0

Step 8: Calculate test data

Input Data: Multiple source tables

Transformations: Multiple joins, filters, and mappings

INSERT INTO #staging SELECT DISTINCT ske.StudentIdentifierState, ske.LeaIdentifierSeaAccountability, ske.SchoolIdentifierSea, ske.Birthdate, CASE WHEN @ChildCountDate <= sppse.ProgramParticipationEndDate THEN [RDS].[Get_Age](ske.Birthdate, @ChildCountDate) ELSE [RDS].[Get_Age](ske.BirthDate, DATEADD(year, -1, @ChildCountDate)) END AS Age...

Step 9: Run test cases and record results

Input Data: #staging and RDS.ReportEDFactsK12StudentCounts

Transformations: Aggregations by various demographics

INSERT INTO App.SqlUnitTestCaseResult (SqlUnitTestId, TestCaseName, TestCaseDetails, ExpectedResult, ActualResult, Passed, TestDateTime) SELECT @SqlUnitTestId, 'CSA SEA Match All'...

PreviousApp.FS007_TestCaseNextApp.FS032_TestCase

Was this helpful?