feat: drive sixth-form separation from GIAS OfficialSixthForm flag #21

Merged
tudor merged 10 commits from feat/gias-sixth-form-flag into main 2026-07-07 13:48:12 +00:00
Showing only changes of commit f1388ff5bd - Show all commits
@@ -55,9 +55,12 @@ select
-- Authoritative sixth-form flag (spec §3): GIAS OfficialSixthForm.
-- "Not applicable" (nurseries, primaries, PRUs) => false. Blank GIAS
-- value (rare, new establishments) falls back to the statutory age range.
-- lower(trim()) guards against casing/whitespace variants in raw GIAS
-- data, same as the phase derivation above — an unmatched variant would
-- otherwise silently fall through to the age-range fallback.
case
when s.official_sixth_form = 'Has a sixth form' then true
when s.official_sixth_form in ('Does not have a sixth form', 'Not applicable') then false
when lower(trim(s.official_sixth_form)) = 'has a sixth form' then true
when lower(trim(s.official_sixth_form)) in ('does not have a sixth form', 'not applicable') then false
else coalesce(s.statutory_high_age >= 18, false)
end as has_sixth_form,
s.capacity,