Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

gte and lte do not generate DateRangeParam query #120

Closed
col-panic opened this issue Aug 28, 2018 · 4 comments
Closed

gte and lte do not generate DateRangeParam query #120

col-panic opened this issue Aug 28, 2018 · 4 comments

Comments

@col-panic
Copy link

col-panic commented Aug 28, 2018

I have the following server side method

	@Search
	public List<Appointment> findAppointmentsByDate(
			@RequiredParam(name = Appointment.SP_DATE) DateRangeParam dateParam) {

see https://github.com/elexis/elexis-server/blob/2175592a4922fdb1b3d238fedc8f549077d2b7c9/bundles/es.fhir.rest.core/src/es/fhir/rest/core/resources/AppointmentResourceProvider.java#L69-L70

a query with

smart.api.search({ type: "Appointment", query: { date: {$gt: startDate, $lt: endDate} } })

does work, while the same query with

smart.api.search({ type: "Appointment", query: { date: {$gte: startDate, $lte: endDate} } })

is answered by the server with

Failure during REST processing: ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: Can not have multiple date range parameters for the same param without a qualifier

Where do I have to look for the error here? On client or server side?!

@niquola
Copy link
Member

niquola commented Aug 28, 2018

I think, that's why - https://github.com/FHIR/fhir.js/blob/master/src/middlewares/search.js#L14

By spec we le and ge is expected.

@niquola
Copy link
Member

niquola commented Aug 28, 2018

I've updated master with $le & $ge operators

@col-panic
Copy link
Author

Thanks for that - the build seems to be failing - could you provide an up-to-date release including this patch?

@col-panic
Copy link
Author

I manually patched my installation, and could verify that with these changes the code works as expected! A minor release would be very much welcomed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants