vl-data-insert.core

append-and-replace

(append-and-replace struct m)
Append `:Value`, `:SdValue` and `:N` if present. Relaces `:Type` and
`:Unit`.

fit-in-struct

(fit-in-struct s m)
Fits `m` into the given structure `s`. Function looks up the
`:Type` of `m`. If a structure with the same `:Type` exist
[[append-and-replace]] is called.

store-result

(store-result d x p)
Stores the result `x`(ensured to be a map `m`) in the given
`d`ocument under `p`ath. If `m` contains `:Type` and `:Value` `m`
is [[fit-in-struct]] and the structure `s` is assumed to be a
`vector`. Other cases (e.g. merge in `:AuxValues`) are straight
forward (see [[vl-data-insert/test/cmp/doc_test.clj]] for details).

store-results

(store-results doc v p)
Takes a vector of maps. Calls `store-result` on each map.

Example:
```clojure
(def p "Calibration.Measurement.Values.Pressure")
(def m {:Type    "a"
      :Unit    "b"
      :Value   [0]
      :SdValue [0]
      :N       [1]})

(def d {:Calibration
       {:Measurement
        {:Values
         {:Pressure
         [{:Type    "a"
          :Unit    "b"
          :Value   [0]
          :SdValue [0]
          :N       [1]}]}}}})

(store-results d [m m m m] p)

;; =>
;;   {:Calibration
;;    {:Measurement
;;     {:Values
;;      {:Pressure
;;       [{:Type "a",
;;         :Unit "b",
;;         :Value [0 0 0 0 0],
;;         :SdValue [0 0 0 0 0],
;;         :N [1 1 1 1 1]}]}}}}
```

vector-vals

(vector-vals m)
Ensures that the values of `:Value`,`:SdValue` and `:N` are
vectors.