From eb88fbca2004c097dfb9bde3bd9c014db328279d Mon Sep 17 00:00:00 2001 From: gered Date: Fri, 4 Jul 2014 12:34:04 -0400 Subject: [PATCH] add convenience function for turning bundles into sequences of resources --- src/clj_hl7_fhir/core.clj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/clj_hl7_fhir/core.clj b/src/clj_hl7_fhir/core.clj index 396d7c5..1db90cc 100644 --- a/src/clj_hl7_fhir/core.clj +++ b/src/clj_hl7_fhir/core.clj @@ -93,6 +93,13 @@ (format-search-value value))])) (apply concat))) +(defn collect-resources + "returns a sequence containing all of the resources contained in the given bundle" + [bundle] + (->> bundle + :entry + (map :content))) + (defn get-resource "gets a single resource from a FHIR server. can optionally get a specific version of a resource.