                  (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)))


(def parsed (->> data
                 (remove #(= "Included in other discovery" (:dscCurrentActivityStatus %)))
                 (map #(select-keys % [:dscName :fldName :dscDiscoveryYear :dscCurrentActivityStatus]))
                 (csv/read-number-or-throw-columns [:dscDiscoveryYear])
                 (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 #(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]
            [clojure.set :refer [rename-keys]]
            [clj-simple-chart.ncs.resource :as resource]
            [clj-simple-chart.ncs.reserve :as reserve]
            [clojure.test :as test]))
