                     CASE WHEN contact_type != 'Infant' AND treatments_agg.total_doses >= 4 THEN 1 ELSE 0 END AS dose4_hs,
                     CASE WHEN contact_type != 'Infant' AND treatments_agg.total_doses >= 5 THEN 1 ELSE 0 END AS dose5_hs,
                     CASE WHEN contact_type != 'Infant' AND treatments_agg.total_doses >= 6 THEN 1 ELSE 0 END AS dose6_hs,
-                    CASE WHEN contact_type = 'Infant' AND disposition = 'Moved' AND (hepb_dose1_date IS NOT NULL OR hepb_comvax1_date IS NOT NULL) AND hbig_vacc_date IS NOT NULL THEN 1 ELSE 0 END AS dose1_hbig_trans,
-                    CASE WHEN contact_type = 'Infant' AND disposition = 'Moved' AND hepb_dose1_date IS NULL AND hepb_comvax1_date IS NULL AND hbig_vacc_date IS NOT NULL THEN 1 ELSE 0 END AS hbig_trans,
-                    CASE WHEN contact_type = 'Infant' AND disposition = 'Moved' AND (hepb_dose1_date IS NOT NULL OR hepb_comvax1_date IS NOT NULL) AND hbig_vacc_date IS NULL THEN 1 ELSE 0 END AS dose1_trans,
-                    CASE WHEN contact_type = 'Infant' AND disposition = 'Moved' AND hepb_dose1_date IS NULL AND hepb_comvax1_date IS NULL AND hbig_vacc_date IS NULL THEN 1 ELSE 0 END AS neither_trans,
+                    CASE WHEN contact_type = 'Infant' AND disposition IN (
+                        'Closed: Transferred to another state',
+                        'Closed: Left state (unable to transfer)',
+                        'Closed: Moved out of country'
+                    ) AND (hepb_dose1_date IS NOT NULL OR hepb_comvax1_date IS NOT NULL) AND hbig_vacc_date IS NOT NULL THEN 1 ELSE 0 END AS dose1_hbig_trans,
+                    CASE WHEN contact_type = 'Infant' AND disposition IN (
+                        'Closed: Transferred to another state',
+                        'Closed: Left state (unable to transfer)',
+                        'Closed: Moved out of country'
+                    ) AND hepb_dose1_date IS NULL AND hepb_comvax1_date IS NULL AND hbig_vacc_date IS NOT NULL THEN 1 ELSE 0 END AS hbig_trans,
+                    CASE WHEN contact_type = 'Infant' AND disposition IN (
+                        'Closed: Transferred to another state',
+                        'Closed: Left state (unable to transfer)',
+                        'Closed: Moved out of country'
+                    ) AND (hepb_dose1_date IS NOT NULL OR hepb_comvax1_date IS NOT NULL) AND hbig_vacc_date IS NULL THEN 1 ELSE 0 END AS dose1_trans,
+                    CASE WHEN contact_type = 'Infant' AND disposition IN (
+                        'Closed: Transferred to another state',
+                        'Closed: Left state (unable to transfer)',
+                        'Closed: Moved out of country'
+                    ) AND hepb_dose1_date IS NULL AND hepb_comvax1_date IS NULL AND hbig_vacc_date IS NULL THEN 1 ELSE 0 END AS neither_trans,
                     CASE WHEN contact_type = 'Infant' AND
-                        disposition = 'Moved' AND
+                        disposition IN (
+                            'Closed: Transferred to another state',
+                            'Closed: Left state (unable to transfer)',
+                            'Closed: Moved out of country'
+                        ) AND
                         (hepb_dose1_date <= dce.birth_date + INTERVAL '8 months' OR hepb_comvax1_date <= dce.birth_date + INTERVAL '8 months') AND
                         (hepb_dose2_date <= dce.birth_date + INTERVAL '8 months' OR hepb_comvax2_date <= dce.birth_date + INTERVAL '8 months') AND
                         (hepb_dose3_date <= dce.birth_date + INTERVAL '8 months' OR hepb_comvax4_date <= dce.birth_date + INTERVAL '8 months') AND

                        THEN 1 ELSE 0
                    END AS all_8m_trans,
                    CASE WHEN contact_type = 'Infant' AND
                        disposition = 'Moved' AND
                        (hepb_dose1_date <= dce.birth_date + INTERVAL '12 months' OR hepb_comvax1_date <= dce.birth_date + INTERVAL '12 months') AND
                        (hepb_dose2_date <= dce.birth_date + INTERVAL '12 months' OR hepb_comvax2_date <= dce.birth_date + INTERVAL '12 months') AND
                        (hepb_dose3_date <= dce.birth_date + INTERVAL '12 months' OR hepb_comvax4_date <= dce.birth_date + INTERVAL '12 months') AND

                                        END    
                                    ELSE -- Not an 'Infant' type
                                        CASE
                                            WHEN
                                                COALESCE((trisano.get_contact_hbsag_before(dce.id, CURRENT_DATE)).test_result, 'dummy') = 'Positive / Reactive' OR
                                                COALESCE((trisano.get_contact_antihb_before(dce.id, CURRENT_DATE)).test_result, 'dummy') = 'Positive / Reactive'
                                                THEN 9 -- fdd = report date, act = 'Close Contact'
                                            WHEN
                                                (
                                                    (hepb_dose1_date IS NULL AND hepb_comvax1_date IS NULL) OR
                                                    (hepb_dose2_date IS NULL AND hepb_comvax2_date IS NULL) OR
                                                    (hepb_dose3_date IS NULL AND hepb_comvax3_date IS NULL)
                                                ) AND hepb_dose6_date IS NULL
                                                THEN
                                                    7 -- fdd = report date, act = "Check vaccination history; Test or Vaccinate"
                                            ELSE 
                                                CASE WHEN disposition = 'Closed: Completed' THEN -1 -- Don't show this contact
                                                ELSE 9 -- fdd = report date, act = 'Close contact'
                                                END
                                        END
                                END AS fdd_act_code
                            FROM
