From 07c5842001fd04c76a83bc13134075c2c9277825 Mon Sep 17 00:00:00 2001 From: sleblanc23 Date: Fri, 1 Aug 2025 15:08:36 -0500 Subject: [PATCH 1/3] allow staffSectionAssociations to implicitly identify teachers --- README.md | 9 +++++++++ models/oneroster_1_1/or1_1__int_users_staff.sql | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 381d8fb..9895ca6 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,15 @@ Example: is_economic_disadvantaged: 'edu.economic_disadvantage' ``` +`oneroster:classroom_positions`: List of Classroom Positions that should allow a staffSectionAssociation to _implicitly_ assign the Teacher role, regardless of their StaffClassification or whether they even have a StaffAssignment at all. This would allow, for example, only provisioning the Teacher of Record, and not Aides, Substitutes, or other roles. +This should be a list of approved Classroom Position values, or null to leave unrestricted. +Example: +```yaml +'oneroster:classroom_positions': + - Teacher of Record + - Substitute +``` + ## OneRoster extensions OneRoster is an extensible standard. Extensions in this package begin with `metadata.edu` and are always on the right-hand side of the table, as specified in the standard. diff --git a/models/oneroster_1_1/or1_1__int_users_staff.sql b/models/oneroster_1_1/or1_1__int_users_staff.sql index 91df0e0..c5b52ec 100644 --- a/models/oneroster_1_1/or1_1__int_users_staff.sql +++ b/models/oneroster_1_1/or1_1__int_users_staff.sql @@ -20,24 +20,27 @@ teaching_staff as ( select distinct k_staff from {{ ref('fct_staff_section_association') }} where school_year = {{ var('oneroster:active_school_year')}} + {% if var('oneroster:classroom_positions', '') %} + and classroom_position in ('{{ var("oneroster:classroom_positions", "") | join("', '") }}') + {% endif %} ), role_xwalk as ( select * from {{ ref('xwalk_oneroster_staff_classifications') }} ), staff_role as ( select - staff_school.k_staff, + coalesce(staff_school.k_staff, teaching_staff.k_staff) as k_staff_coalesce, coalesce(oneroster_role, 'teacher') as oneroster_role, coalesce(staff_school.staff_classification, 'Teacher') as staff_classification from staff_school left join role_xwalk on staff_school.staff_classification = role_xwalk.staff_classification - left join teaching_staff + full join teaching_staff on staff_school.k_staff = teaching_staff.k_staff -- either in the staff xwalk, or teaches a section where (role_xwalk.staff_classification is not null or teaching_staff.k_staff is not null) -- only one role per staff. if multiple, prefer admin over teacher - qualify 1 = row_number() over(partition by staff_school.k_staff order by oneroster_role) + qualify 1 = row_number() over(partition by k_staff_coalesce order by oneroster_role) ), user_ids as ( @@ -96,7 +99,7 @@ formatted as ( join user_ids on dim_staff.k_staff = user_ids.k_staff join staff_role - on dim_staff.k_staff = staff_role.k_staff + on dim_staff.k_staff = staff_role.k_staff_coalesce left join staff_orgs_agg on dim_staff.k_staff = staff_orgs_agg.k_staff ) From 3b6bb7fdce4bf55453925f36157df2d3d49ceb88 Mon Sep 17 00:00:00 2001 From: sleblanc23 Date: Fri, 1 Aug 2025 15:39:08 -0500 Subject: [PATCH 2/3] make implicit teacher assignments configurable --- README.md | 5 +++-- models/oneroster_1_1/or1_1__int_users_staff.sql | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9895ca6..2b715d5 100644 --- a/README.md +++ b/README.md @@ -158,8 +158,9 @@ Example: is_economic_disadvantaged: 'edu.economic_disadvantage' ``` -`oneroster:classroom_positions`: List of Classroom Positions that should allow a staffSectionAssociation to _implicitly_ assign the Teacher role, regardless of their StaffClassification or whether they even have a StaffAssignment at all. This would allow, for example, only provisioning the Teacher of Record, and not Aides, Substitutes, or other roles. -This should be a list of approved Classroom Position values, or null to leave unrestricted. +`oneroster:require_staff_assignment`: Should teaching staff function like all other staff types, in that we require a Staff Assignment with an appropriate Staff Classification? Or should we treat staffSectionAssociation as implicitly assigning the Teacher role, regardless of their StaffClassification or whether they even have a StaffAssignment at all? Default: True + +`oneroster:classroom_positions`: Only include Staff-Classroom associations when the staff is listed with an appropriate Classroom Position. This would allow, for example, only including the Teacher of Record, and not Aides, Substitutes, or other roles. This should be a list of approved Classroom Position values, or null to leave unrestricted. Example: ```yaml 'oneroster:classroom_positions': diff --git a/models/oneroster_1_1/or1_1__int_users_staff.sql b/models/oneroster_1_1/or1_1__int_users_staff.sql index c5b52ec..2c25c35 100644 --- a/models/oneroster_1_1/or1_1__int_users_staff.sql +++ b/models/oneroster_1_1/or1_1__int_users_staff.sql @@ -35,7 +35,11 @@ staff_role as ( from staff_school left join role_xwalk on staff_school.staff_classification = role_xwalk.staff_classification - full join teaching_staff + {% if var('oneroster:require_staff_assignment', true) %} + left join teaching_staff + {% else %} + full outer join teaching_staff + {% endif %} on staff_school.k_staff = teaching_staff.k_staff -- either in the staff xwalk, or teaches a section where (role_xwalk.staff_classification is not null or teaching_staff.k_staff is not null) From fd3d9ee3cd93a40b29849699e0ada69627446646 Mon Sep 17 00:00:00 2001 From: rlittle08 Date: Thu, 14 Aug 2025 15:15:07 -0500 Subject: [PATCH 3/3] explicit removal of ssn id systems --- models/oneroster_1_1/or1_1__int_users_staff.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/oneroster_1_1/or1_1__int_users_staff.sql b/models/oneroster_1_1/or1_1__int_users_staff.sql index 2c25c35..2986766 100644 --- a/models/oneroster_1_1/or1_1__int_users_staff.sql +++ b/models/oneroster_1_1/or1_1__int_users_staff.sql @@ -53,6 +53,8 @@ user_ids as ( listagg(concat('{', id_system, ':', id_code, '}'), ',') as ids from {{ ref('stg_ef3__staffs__identification_codes') }} where api_year = {{ var('oneroster:active_school_year')}} + -- explicitly filter out SSNs + and id_system not ilike '%ssn%' group by all ),