-
Notifications
You must be signed in to change notification settings - Fork 7
SEDM Base and Stage Models #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ryanaguilar
wants to merge
37
commits into
main
Choose a base branch
from
feature/sedm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feature/sedm: Add SEDM (Special Education Data Model) staging models
Description & motivation
This PR introduces a complete set of staging models for the Special Education Data Model (SEDM) domain, following the established patterns for Ed-Fi 3.x base and stage models. The implementation includes 7 base models and 7 corresponding stage models for IEP (Individualized Education Program) related resources, enabling staging and analysis of special education data.
All models follow the established conventions:
gen_skey()macro anddbt_utils.generate_surrogate_key(), deduplicate records usingdbt_utils.deduplicate(), filter deleted records, and extract extensions. Stage models are materialized as tables.The SEDM domain is configured to be enabled via feature flag:
src:domain:sedm:enabled.PR Merge Priority:
Changes to existing files:
dbt_project.yml: Added SEDM domain configuration with base models materialized as views and stage models as tables. This follows the same pattern as existingedfi_3domains, ensuring consistency across the project structure.macros/gen_skey.sql: Added two new key definitions to support SEDM models:k_student_iep: Annualized key for student IEP. Includesiep_finalized_date,iep_servicing_ed_org_id,student_iep_association_id, andstudent_unique_id. This key is used across multiple SEDM models to link records to IEP.k_student_iep_service_prescription: Non-annualized key for IEP service prescriptions. Includesiep_service_id,iep_servicing_ed_org_id,service_prescription,service_prescription_date,student_iep_association_id, andstudent_unique_id. This key enables proper linking of service prescription records.New files created:
Base Models
base_sedm__idea_events: Extracts IDEA (Individuals with Disabilities Education Act) events from theidea_eventssource. Includes event begin/end dates, event narrative, event reason and compliance descriptors, and references to students and education organizations.base_sedm__student_iep_accommodations: Extracts student IEP accommodation collections from thestudent_iep_accommodationssource. Includes key columns for student IEP association ID, student unique ID, and IEP servicing education organization ID. Preserves the accommodations list for further processing in downstream models.base_sedm__student_iep_disabilities: Extracts student IEP disability collections from thestudent_iep_disability_collectionssource. Includes key columns for student IEP association ID, student unique ID, and IEP servicing education organization ID. Preserves the disabilities list for further processing.base_sedm__student_iep_goals: Extracts student IEP goals from thestudent_iep_goalssource. Includes goal ID, goal details, achievement period dates, goal descriptor, and references to students, IEPs, and IDEA events.base_sedm__student_iep_service_deliveries: Extracts student IEP service deliveries from thestudent_iep_service_deliveriessource. Includes service delivery ID, service delivery date and descriptor, service provider information, references to service prescriptions, and lists of service providers and external service providers.base_sedm__student_iep_service_prescriptions: Extracts student IEP service prescriptions from thestudent_iep_service_prescriptionssource. Includes service ID, prescription date and descriptor, begin/end dates, duration and frequency information, service location type, and references to students, IEPs, staff, and IDEA events.base_sedm__student_ieps: Extracts student IEPs (main IEP records) from thestudent_iepssource. Includes IEP association ID, finalized date, begin/end dates, amended date, status and reason exited descriptors, special education setting descriptor, medically fragile and multiply disabled flags, hours per week information, and references to education organizations, students, and special education program associations.Stage Models (Tables)
stg_sedm__student_iep_accommodations: Creates deduplicated and keyed version of IEP accommodations. Generates primary surrogate keyk_student_iep_accommodation_collectionusing tenant_code, api_year, student_iep_association_id, student_unique_id, and iep_servicing_ed_org_id. Usesgen_skey()to generate foreign keys for k_student, k_student_xyear, and k_student_iep. Deduplicates by primary key, keeping the most recent version based on last_modified_timestamp and pull_timestamp. Filters out deleted records.stg_sedm__student_iep_disabilities: Creates deduplicated and keyed version of IEP disabilities. Generates primary surrogate keyk_student_iep_disability_collectionusing tenant_code, api_year, student_iep_association_id, student_unique_id, and iep_servicing_ed_org_id. Usesgen_skey()to generate foreign keys for k_student, k_student_xyear, and k_student_iep. Adds school_year column. Deduplicates and filters deleted records.stg_sedm__student_iep_goals: Creates deduplicated and keyed version of IEP goals. Generates primary surrogate keyk_student_iep_goalusing tenant_code, api_year, iep_goal_id, student_unique_id, and student_iep_association_id. Usesgen_skey()to generate foreign keys for k_student, k_student_xyear, and k_student_iep. Adds school_year column. Deduplicates and filters deleted records.stg_sedm__student_iep_service_deliveries: Creates deduplicated and keyed version of IEP service deliveries. Generates primary surrogate key using tenant_code, api_year, and natural key components. Usesgen_skey()to generate foreign keys for k_student, k_student_xyear, and k_student_iep. Deduplicates and filters deleted records.stg_sedm__student_iep_service_prescriptions: Creates deduplicated and keyed version of IEP service prescriptions. Generates primary surrogate keyk_student_iep_service_prescriptionusing tenant_code, api_year, iep_service_id, iep_servicing_ed_org_id, service_prescription, service_prescription_date, student_iep_association_id, and student_unique_id. Usesgen_skey()to generate foreign keys for k_student, k_student_xyear, k_student_iep, and k_staff (using service_provider_staff_reference). Adds school_year column. Deduplicates and filters deleted records.stg_sedm__student_ieps: Creates deduplicated and keyed version of IEPs. Generates primary surrogate keyk_student_iepusing tenant_code, api_year, student_iep_association_id, iep_servicing_ed_org_id, iep_finalized_date, and student_unique_id. Usesgen_skey()to generate foreign keys for k_student and k_student_xyear. Usesedorg_ref()macro for education organization references (non-annualized). Adds school_year column. Deduplicates and filters deleted records.All stage models follow consistent patterns:
dbt_utils.generate_surrogate_key()with tenant_code, api_year, and natural key componentsgen_skey()macro for standardized referencesdbt_utils.deduplicate()partitioned by primary key, ordered bylast_modified_timestamp desc, pull_timestamp descis_deleted = trueextract_extension()macroTests and QC done:
dbt runfor all SEDM base and stage models and confirmed successful compilationdbt_project.ymlmatches the structure of other domainsgen_skey()macro additions follow the existing pattern and include proper annualization flagsFuture ToDos & Questions: