I'd like to start a conversation on how we'd like to approach queries within the FHIR specification - it concerns Patient searches specifically, but the changes we are going to propose could affect query support across all resources.
Situation: In DSTU1, all FHIR Search operations are implemented using query string key/value parameters, allowing you to easily create a search for a specific set of resources. This is an awesome way to access data, but it brings up a concern in actual implementation - query strings aren't encrypted even when transacting via HTTPs, and they're logged in pretty much every possible location they can be - web server logs, browser history, devices, proxies, etc.
Note that in DSTU1, there are other means to perform searches, but I'd consider them not well-defined, and not viable alternatives compared to the ease of querying the resource directly. They're also deprecated or marked as to-dos in DSTU2, so they're clearly unstable.
This causes a clear concern when performing a patient demographic query via the Patient resource - PHI is transmitted in clear text in the request, and is stored in all variety of logs between the API server and the client application. When there's only test data backing the API server, it's not a concern, but it's something we need to address for production databases.
In DSTU2, searches can be performed either via HTTP GETs w/ data contained in the query string, or as url encoded HTTP POSTs, with the search parameters contained within the body. From
2.1.1 Search:
For this RESTful search (see definition in RESTful API), the parameters are a series of name=[value] pairs encoded in the URL or as an application/x-www-form-urlencoded submission for a POST.
However, there doesn't at this point appear to be any ability to document in the Conformance statement which of the methods are supported by the server; the presumption is that both are supported, I imagine.
Searches via form-urlencoded submissions allow us to provide much of the same benefits as a query string-encoded search via HTTP GET, are well supported in the browser and native application frameworks, and are already part of the upcoming standard.
Here are the options Epic is considering:
1. For PDQ, and potentially some other subset of all available resource queries, we will only accept form-urlencoded POSTs at our endpoint. This minimizes the overall changes to the API, although I'm concerned that it adds more complexity to the API than really makes sense, and we'd need to have a means of declaring which endpoints only accept POSTs, likely in the Conformance resource for the API server.
2. Only support form-urlencoded POSTs on the API endpoints for searches, requiring clients to re-implement search logic wholesale, with the benefit of not needing to maintain the different search mechanisms in client libraries. We'd provide feedback to HL7 that this is should be the only considered mechanism for searches, and deprecate HTTP GETs to perform searches.
I'm interested in hearing feedback on these proposed solutions, or in hearing other alternatives.