FirelyTeam / spark

Firely and Incendi's open source FHIR server
BSD 3-Clause "New" or "Revised" License
260 stars 166 forks source link

Invalid implementation of GT,GTE,LT,LTE search parameters #540

Closed mikolaj-jankowski closed 5 months ago

mikolaj-jankowski commented 1 year ago

There is a bug when searching resources based on dates. If I send a resource that has some dates range i.e from 2022-12-01 to 2022-12-10 and then try to find it using built-in search parameters: ge2022-12-02 and le2022-12-08, spark does not return previously created resource.

To Reproduce Steps to reproduce the behavior:

  1. Send a request to create a resource of type Appointment with date range: 2022-12-01 to 2022-12-10
  2. Send a request to find an appoinment in above range i.e: http://localhost:5000/fhir/Appointment?date=ge2022-12-02&date=le2022-12-08
  3. Nothing is returned.

Expected behavior Server should return the appoinment created in 1st step.

Spark version

Additional context Sample appointment: { "resourceType" : "Appointment", "id" : "example", "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI results discussion</div>" }, "status" : "booked", "serviceCategory" : [{ "coding" : [{ "system" : "http://example.org/service-category", "code" : "gp", "display" : "General Practice" }] }], "specialty" : [{ "coding" : [{ "system" : "http://snomed.info/sct", "code" : "394814009", "display" : "General practice" }] }], "appointmentType" : { "coding" : [{ "system" : "http://terminology.hl7.org/CodeSystem/v2-0276", "code" : "FOLLOWUP", "display" : "A follow up visit from a previous appointment" }] }, "description" : "Discussion on the results of your recent MRI", "start" : "2022-12-01", "end" : "2022-12-10", "created" : "2013-10-10", "basedOn" : [{ "reference" : "ServiceRequest/myringotomy" }], "participant" : [{ "actor" : { "reference" : "Patient/example", "display" : "Peter James Chalmers" }, "status" : "accepted" }, { "type" : [{ "coding" : [{ "system" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code" : "ATND" }] }], "actor" : { "reference" : "Practitioner/example", "display" : "Dr Adam Careful" }, "status" : "accepted" }, { "actor" : { "reference" : "Location/1", "display" : "South Wing, second floor" }, "status" : "accepted" }] }

whyfate commented 1 year ago

This issue may help you. https://github.com/FirelyTeam/spark/issues/390

kennethmyhra commented 5 months ago

This can not be reproduced on current r4/master.