Skip to content

Commit

Permalink
Fix ftr index codesystem idx valueset update
Browse files Browse the repository at this point in the history
Co-authored-by: @islambegkatibov <[email protected]>
  • Loading branch information
KGOH and katibov committed Dec 16, 2022
1 parent 66630ea commit d9d5b73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/ftr/utils/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
(recur ks
(cond
(and (map? v) (map? av)) (assoc acc k (deep-merge av v))
(and (set? v) (set? av)) (assoc acc k (into v av))
(and (nil? v) (map? av)) (assoc acc k av)
:else (assoc acc k v))))))))

Expand Down
14 changes: 8 additions & 6 deletions src/ftr/zen_package.clj
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,17 @@
(loop [{:as concept, :keys [code system display]}
(.readLine tf-reader)

{:as ftr-index, :keys [codesystems]}
ftr-index-with-updated-vss]
ftr-index ftr-index-with-updated-vss]
(if-not (nil? concept)
(recur
(.readLine tf-reader)
(if (get-in codesystems [system code])
(update-in ftr-index [ftr-tag :codesystems system code :valueset] conj vs-url)
(assoc-in ftr-index [ftr-tag :codesystems system code] {:display display
:valueset #{vs-url}})))
(update-in ftr-index
[ftr-tag :codesystems system code]
(fn [code-idx]
(if (some? code-idx)
(update code-idx :valueset conj vs-url)
{:display display
:valueset #{vs-url}}))))
ftr-index))))


Expand Down

0 comments on commit d9d5b73

Please sign in to comment.