0

I'm working on a server query engine that will return FHIR resources and I've run into a problem.

I can successfully receive an Get and Search queries that use simple parameters (like Composition/4 or Patient?name=smith) but I can't get it to recognize more complex, and useful, parameters like Composition?subject:Patient=4 or type=[system]|[value].

How are these types of parameters passed and what should I be looking for on the server?

Patel
  • 1,478
  • 1
  • 13
  • 24
  • Can you provide details? The specific URLs - including which server you're going against would help. Not all servers support all capabilities. Also, are you getting errors back or are the parameters just being ignored? (You can see what parameters were processed by looking at the self link in the response bundle.) – Lloyd McKenzie Jul 17 '15 at 21:19
  • @lmckenzi - that's part of my problem. I'm making my own server that will be able to respond to the query. I tested the basic structure of my query using http://fhir-dev.healthintersections.com.au/open/Composition?subject:Patient=123412316&type=www.loinc.org|60591-5 and that worked just fine. I'm trying the query http://[myserver-base-url]/Composition?subject:Patient=4&type=www.loinc.org|60591-5 which is the server I'm developing. I've got simple queries working because those endpoints are just looking for strings. I'm just not sure how the endpoint for my Composition should be coded. – Jeff Danford Jul 20 '15 at 11:58
  • What you look for on the server will depend on what http processing library you're using. Most will be capable of passing you the individual parameters. You'll have to handle parsing the value yourself. – Lloyd McKenzie Jul 23 '15 at 22:54
  • I'm not asking this very well, let me start again. If I send http://[myserver.baseurl]/Composition/4 and my server code has a public HttpResponseMessage Get(string id) method everything works fine. For my complex search http://[myserver.baseurl]/Composition?subject:Patient=4&type=[system]|[code] I've tried public HttpResponseMessage Get(Resource Patient, token type), HttpResponse Get(Patient patient, token type) and HttpResponseMessage Get(string id, string type) and those don't work. I'm trying to find out what parameters I should be using in the Get method. – Jeff Danford Jul 28 '15 at 19:23

1 Answers1

0

if you look at the bottom of the Composition page, you'll see this has a search param called "type", which is of type "token". As you already found out yourself, this has the form

[system]|[value]

where the system is a full url. Some common systems in use can be found here: http://hl7.org/fhir/2015May/terminologies-systems.html

In this case, you should be using

type=http://loinc.org|60591-5

The formats of all more complex search params can be found on the search documentation page (http://hl7.org/fhir/2015May/search.html#2.1.1.1).

If you need an example of how to implement search for this, take a look at the open-source .NET implementation called Spark: https://github.com/furore-fhir/spark

Ewout Kramer
  • 984
  • 6
  • 9