Module: FHIR::Sections::Search
- Included in:
- Client
- Defined in:
- lib/fhir_client/sections/search.rb
Instance Method Summary collapse
-
#search(klass, options = {}, format = @default_format) ⇒ Object
Search a set of resources of a given type.
- #search_all(options = {}, format = @default_format) ⇒ Object
-
#search_existing(klass, id, options = {}, format = @default_format) ⇒ Object
It does not appear that this is part of the specification (any more?) Investigate removing in next major version.
Instance Method Details
#search(klass, options = {}, format = @default_format) ⇒ Object
Search a set of resources of a given type.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fhir_client/sections/search.rb', line 11 def search(klass, = {}, format = @default_format) [:resource] = klass [:format] = format reply = if .dig(:search, :flag) != true && .dig(:search, :body).nil? get resource_url(), fhir_headers else [:search][:flag] = true post resource_url(), .dig(:search, :body), fhir_headers({content_type: 'application/x-www-form-urlencoded'}) end reply.resource = parse_reply(klass, format, reply) reply.resource_class = klass reply end |
#search_all(options = {}, format = @default_format) ⇒ Object
34 35 36 37 |
# File 'lib/fhir_client/sections/search.rb', line 34 def search_all( = {}, format = @default_format) [:format] = format search(nil, , format) end |
#search_existing(klass, id, options = {}, format = @default_format) ⇒ Object
It does not appear that this is part of the specification (any more?) Investigate removing in next major version.
29 30 31 32 |
# File 'lib/fhir_client/sections/search.rb', line 29 def search_existing(klass, id, = {}, format = @default_format) [:id] = id search(klass, , format) end |