Skip to content

Commit

Permalink
Fix preprocess-slices-by-discriminator :pattern error
Browse files Browse the repository at this point in the history
Co-authored-by: @ddegr <[email protected]>
  • Loading branch information
KGOH and @ddegr committed Dec 10, 2021
1 parent ad0cd89 commit f556943
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/zen/fhir/loader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,15 @@
path (mapv (comp keyword :key) rich-path)]
(sp/transform [sp/MAP-VALS]
(fn [v]
(let [[pattern-k pattern] (-> (get-in v inter-path) (utils/poly-find :pattern))
match (cond->> (pattern->zen-match pattern)
(seq path)
(assoc-in {} path))]
(-> (if (seq path)
(update-in v path dissoc pattern-k)
(dissoc v pattern-k))
(assoc :match match))))
(if-let [[pattern-k pattern] (some-> (get-in v inter-path) (utils/poly-find :pattern))]
(let [match (cond->> (pattern->zen-match pattern)
(seq path)
(assoc-in {} path))]
(-> (if (seq path)
(update-in v path dissoc pattern-k)
(dissoc v pattern-k))
(assoc :match match)))
v))
slices)))


Expand Down

0 comments on commit f556943

Please sign in to comment.