Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ Example:
is_economic_disadvantaged: 'edu.economic_disadvantage'
```

`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':
- 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.

Expand Down
15 changes: 12 additions & 3 deletions models/oneroster_1_1/or1_1__int_users_staff.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,31 @@ 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
{% 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)
-- 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 (
Expand All @@ -46,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
),

Expand Down Expand Up @@ -96,7 +105,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
)
Expand Down