                                         THEN item_oid
                                         ELSE
                                             lower(
-                                                    FORMAT(
-                                                            $$%1$s_%2$s$$,
-                                                            substr(
-                                                                    dm_clean_name_string(
-                                                                            dm_meta.item_name),
-                                                                    1,
-                                                                    12
-                                                            ),
-                                                            substr(
-                                                                    dm_clean_name_string(
-                                                                            dm_meta.item_description),
-                                                                    1,
-                                                                    45
-                                                            )
+                                                FORMAT(
+                                                    $$%1$s_%2$s$$,
+                                                    substr(
+                                                        dm_clean_name_string(
+                                                            dm_meta.item_name),
+                                                        1,
+                                                        12
+                                                    ),
+                                                    substr(
+                                                        dm_clean_name_string(
+                                                            dm_meta.item_description),
+                                                        1,
+                                                        45
                                                     )
+                                                )
                                             )
                                         END
                                     ) AS item_name_hint,

                                    LEFT JOIN
                                    crf_nulls
                                    USING (study_name, item_group_oid)
                                WHERE
                                    (
                                        CASE
                                        WHEN length(
                                                     filter_study_name
                                             ) > 0
                                        THEN dm_meta.study_name =
                                             filter_study_name

                        SELECT
                            study_name,
                            lower(
                                item_group_oid
                            ) AS item_group_oid,
                            item_oid,
                            lower(
                                item_name
                            ) AS item_name,
                            lower(
                                CASE
                                WHEN length(
                                         item_name_hint
                                     ) > 57
                                THEN substr(
                                    item_name_hint,
                                    1,
                                    57
                                )
                                ELSE item_name_hint
                                END
                            ) AS item_name_hint,
                            item_data_type,
                            max(
                                item_form_order
                            ) AS item_form_order,
                            max(
                                item_response_set_label
                            ) AS item_response_set_label,
                            crf_null_values
                        FROM
