Skip to content

Commit

Permalink
Add max-hits parameter to expand-ecl
Browse files Browse the repository at this point in the history
  • Loading branch information
wardle committed Mar 15, 2023
1 parent 87585b5 commit a1b2c6b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/com/eldrix/hermes/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,18 @@
(search/do-search (.-searcher svc) params)))

(s/fdef expand-ecl
:args (s/cat :svc ::svc :ecl ::non-blank-string)
:args (s/cat :svc ::svc :ecl ::non-blank-string :max-hits (s/? int?))
:ret (s/coll-of ::result))
(defn expand-ecl
"Expand an ECL expression."
[^Svc svc ecl]
(let [q1 (ecl/parse svc ecl)
q2 (search/q-not q1 (search/q-fsn))]
(search/do-query-for-results (.-searcher svc) q2)))
([^Svc svc ecl]
(let [q1 (ecl/parse svc ecl)
q2 (search/q-not q1 (search/q-fsn))]
(search/do-query-for-results (.-searcher svc) q2)))
([^Svc svc ecl max-hits]
(let [q1 (ecl/parse svc ecl)
q2 (search/q-not q1 (search/q-fsn))]
(search/do-query-for-results (.-searcher svc) q2 max-hits))))

(s/fdef intersect-ecl
:args (s/cat :svc ::svc :concept-ids (s/coll-of :info.snomed.Concept/id) :ecl ::non-blank-string))
Expand Down

0 comments on commit a1b2c6b

Please sign in to comment.