Added missing WHERE clause on encounter types to one sub-queries for delivery_ma

and added comment on encounter_type