diff --git a/src/clj_hl7_fhir/core.clj b/src/clj_hl7_fhir/core.clj index 2687d22..65166f9 100644 --- a/src/clj_hl7_fhir/core.clj +++ b/src/clj_hl7_fhir/core.clj @@ -212,7 +212,17 @@ (apply join-paths url-components) (merge (search-params->query-map where) - (apply hash-map params))))) + (apply hash-map (if (and (seq? params) + (= 1 (count params))) + (first params) + params)))))) + +(defn search-and-fetch + "same as search, but automatically fetches all pages of resources returning a single bundle + that contains all search results." + [base-url type where & params] + (fetch-all + (search base-url type where params))) ;(def server-url "http://fhir.healthintersections.com.au/open") ;(def server-url "http://spark.furore.com/fhir")