 
 (def parsed (->> data
                  (remove #(= "Included in other discovery" (:dscCurrentActivityStatus %)))
-                 (map #(select-keys % [:dscName :fldName :dscDiscoveryYear :dscCurrentActivityStatus]))
-                 (csv/read-number-or-throw-columns [:dscDiscoveryYear])
+                 (map #(rename-keys % {:dscCurrentActivityStatus :status
+                                       :dscDiscoveryYear :year}))
+                 (map #(update % :status status-map))
+                 (map #(select-keys % [:dscName :fldName :year :status]))
+                 (csv/read-number-or-throw-columns [:year])
                  (map #(update % :fldName (fn [x] (if (empty? x) nil x))))
                  (map #(update % :dscName (fn [x] (if (empty? x) nil x))))
                  (map #(assoc % :name (or (:fldName %) (:dscName %))))
                  (group-by :name)
                  (vals)
-                 (map #(sort-by (fn [x] (:dscDiscoveryYear x)) %))
+                 (map #(sort-by (fn [x] (:year x)) %))
                  (map #(first %))
                  (flatten)
                  (map #(assoc % :fldRecoverableLiquids (recoverable % :fldRecoverableLiquids)))

(ns clj-simple-chart.ncs.discovery
  (:require [clj-simple-chart.csv.csvmap :as csv]
            [clj-http.client :as client]
            [clj-simple-chart.ncs.resource :as resource]
            [clj-simple-chart.ncs.reserve :as reserve]
            [clojure.test :as test]))

                 (csv/number-or-throw-columns [:fldRecoverableLiquids :fldRecoverableGas])
                 (sort-by :name)
                 (vec)))

(def producing-field-names (->> parsed
                                (filter #(= :producing (:status %)))
                                (map :name)
                                (distinct)
                                (sort)
                                (vec)))

(def shut-down-field-names (->> parsed
                                (filter #(= :shut-down (:status %)))
                                (map :name)
                                (distinct)
                                (sort)
                                (vec)))
