client-py icon indicating copy to clipboard operation
client-py copied to clipboard

Cannot perform search with more than one instance of same param

Open nbfowler opened this issue 6 years ago • 1 comments

Because the search parameters are received as a dictionary, it is impossible to construct a search query where the same parameter is used twice, because a dictionary requires unique keys. This makes it impossible to construct a search URL for results between two values, which is actually a pretty normal use case, e.g. when searching for results between two dates:

http://fhirtest.uhn.ca/baseDstu3/MedicationDispense?whenprepared=gt2018-05-21T00%3A00%3A00-05%3A00&whenprepared=lt2018-05-24T23%3A59%3A59-05%3A00

Is there an undocumented trick for this, or is this not possible at the moment?

nbfowler avatar Apr 20 '19 19:04 nbfowler

@nbfowler You can try something like this: .where(struct={'whenprepared': {'$and': ['gt2018-05-21', 'lt2018-05-25']}})

ruscoder avatar Jun 17 '19 04:06 ruscoder