You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JOIN EligibleBySpec elig ONelig.pers_person_id=p.pers_person_id-- either unborn, or 26th bday falls on or after @ea_cohort_window_start (deceased not filtered)
709
710
JOIN SpecInclusion si ONsi.person_id=p.pers_person_id-- appearing in ActiveReferral, WaitingAssessment, CIN plan, CP plan, LAC, Care leavers 16 to 25, Disabled
710
711
711
-
/* Disabilities array */
712
+
/* Disabilities array, return NULL when no codes*/
712
713
OUTERAPPLY (
713
-
SELECT JSON_QUERY(
714
-
N'['+
715
-
ISNULL(
716
-
STUFF((
717
-
SELECTN','+QUOTENAME(u.code, '"')
718
-
FROM (
719
-
SELECTTOP (12) code
720
-
FROM (
721
-
SELECT DISTINCT
722
-
UPPER(LTRIM(RTRIM(d2.disa_disability_code))) AS code
0 commit comments