0

I'm trying to figure out a basic approach to querying FHIR resources. My first task is to query using a REST interface. Using the information on the Search page, I see there are 7 search parameter types (NUMBER, DATE, STRING, TOKEN, REFERENCE, COMPOSITE, QUANTITY). My question is:

How does one determine a parameter's type when it's passed to the server in a URL's query string?

Since modifiers like :exact and :token only apply to certain parameter types, it seems important to identify the type of each parameter in the query string. I'm hoping the server is not expected to look up parameter types based on the resource being queried.

I'm using FHIR 0.81 with Java and JSON.

Thanks, Rich

Rich C.
  • 41
  • 1

1 Answers1

0

The server does need to look up the parameter types depending on the resource being queried. The server has to actually recognise the parameters to do anything with them anyway.

(and I assume you mean 0.0.81)

Grahame Grieve
  • 3,538
  • 3
  • 15
  • 17
  • Yes, we're using FHIR 0.0.81 with Java and JSON. If the key/value pairs in a query string were annotated with type information, then a separate server-side lookup would not be necessary to discover the value's type. When using XML, an XML schema makes looking up type information relatively easy. With JSON, however, the use of XML schema is less natural. – Rich C. Aug 12 '14 at 21:21
  • I'd be interested in hearing about different approaches to looking up type information for query string fields. The FHIR spec defines some 400 search fields across all its Resources. Having to check the type for each field would be laborious if that information had be separately encoded in some way. My inclination is to use FHIR's XML schemas to lookup up the type information on the fly. This should avoid having to enumerate in advance type information for each possible key. – Rich C. Aug 12 '14 at 21:21
  • well, we could make the information available directly in the java reference implementation. I'll do that soon – Grahame Grieve Aug 13 '14 at 01:34