   alias FileCleaner.OrganisationUtils
 
 
+  @header_types %{
+    "organisation" => :organisations,
+    "minister" => :minister,
+    "date" => :date,
+    "reason" => :reason,
+    "purpose" => :reason
+  }
+
+
   defmodule RowState do
-    defstruct previous_minister: :nil
+    defstruct previous_minister: :nil, data_positions: :nil
   end
 
 

            |> parse_and_insert_reason(reason)
            |> parse_and_insert_organisations(organisations)
      {[row], Map.put(row_state, :previous_minister, row.minister)}
    :nil ->
      {[:nil], row_state}
    {:error, error} ->
      {[{:error, error, row_index}], row_state}
    end
  end


  defp fetch_meeting_values_from_row([minister, date, organisations, reason], _row_state) do
    %{minister: minister, date: date, organisations: organisations, reason: reason}
  end

  defp fetch_meeting_values_from_row(csv_row, _) do
    if row_is_empty? csv_row do
      :nil
    else
      {:error, :unrecognised_row_format}
    end
  end




  defp clean_meeting_row(row, :header, _file_metadata) do
    IO.puts inspect(row)
    data_positions = meeting_data_positions_from_header row
    {[:nil], %RowState{data_positions: data_positions}}
  end

  defp clean_meeting_row({csv_row, row_index}, row_state, file_metadata) do
    case fetch_meeting_values_from_row(csv_row, row_state) do
    %{minister: "", date: "", organisations: "", reason: ""} ->
      {[:nil], row_state}
    %{minister: minister, date: date, organisations: organisations, reason: reason} ->
      row = %MeetingRow{row: row_index}
            |> parse_and_insert_minister(String.trim(minister), row_state)
