 select df.part_ref as unique_id,
        df.collection_ref as collection,
        df.collection_name as collection_name,
-       df.collection_path as collection_path, 
-       trim(both ',' from
+       df.collection_path as collection_path,
+       case when coalesce(df.part,'') in ('specimen', 'animal', 'undefined', 'unknown', '') then '' else df.part end as part_item,
+       case when df.individual_sex in ('undefined', 'unknown', 'not stated', 'non applicable') then '' else ', ' || df.individual_sex || case when df.individual_state = 'not applicable' then '' else df.individual_state end end as part_sex_state,
+       case when df.individual_type = 'specimen' then '' else ', ' || df.individual_type end as part_type,
+       case when df.individual_stage in ('undefined', 'unknown', 'not stated') then '' else ', ' || df.individual_stage end as part_stage,
+       case when coalesce(df.container_storage, '') in ('unknown', '/', '') then '' || case when coalesce(df.sub_container_storage, '') in ('unknown', '/', '')  then '' else ', ' || df.sub_container_storage end else ', ' || df.container_storage || case when coalesce(df.sub_container_storage, '') in ('unknown', '/', '') or df.sub_container_storage = df.container_storage then '' else ' - ' || df.sub_container_storage end end as part_storage,
+/*       trim(both ',' from
         trim(case when coalesce(df.part,'') in ('specimen', 'animal', 'undefined', 'unknown', '') then '' else df.part end 
               || 
               case when df.individual_sex in ('undefined', 'unknown', 'not stated', 'non applicable') then '' else ', ' || df.individual_sex || case when df.individual_state = 'not applicable' then '' else df.individual_state end end 

              case when df.individual_stage in ('undefined', 'unknown', 'not stated') then '' else ', ' || df.individual_stage end 
              || 
              case when coalesce(df.container_storage, '') in ('unknown', '/', '') then '' || case when coalesce(df.sub_container_storage, '') in ('unknown', '/', '')  then '' else ', ' || df.sub_container_storage end else ', ' || df.container_storage || case when coalesce(df.sub_container_storage, '') in ('unknown', '/', '') or df.sub_container_storage = df.container_storage then '' else ' - ' || df.sub_container_storage end end
            )) as item,
       array[fullToIndex(df.part)] as part,
       array[fullToIndex(df.individual_type)] as type,
       df.individual_sex as sex,

                          where referenced_relation = 'taxonomy' and record_id = df.taxon_ref and group_name = 'rename'
                         )
       )::varchar as current_name,
       case when df.acquisition_category is not null and trim(df.acquisition_category) !='' then df.acquisition_category else '' end as acquisition_category,
       df.gtu_ref as gtu_ref,
       df.gtu_country_tag_value::varchar as countries,
       df.gtu_country_tag_indexed as countries_array,
