Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort in distance inaccurate #6776

Open
patrick-werner opened this issue Mar 6, 2025 · 0 comments · May be fixed by #6777
Open

Sort in distance inaccurate #6776

patrick-werner opened this issue Mar 6, 2025 · 0 comments · May be fixed by #6777

Comments

@patrick-werner
Copy link
Member

Describe the bug
When sorting search results with the near SearchParameter the usage of the manhattan distance leads to unexpected ordering of results.

We are using this to return e.g. the nearest pharmacy to a user.

To Reproduce
Steps to reproduce the behavior:

  1. calculate euclidian distances for locations in: ResourceProviderR4DistanceTest.shouldSortPractitionerRolesByLocationNear
  2. "PractitionerRole-Hamilton" & "PractitionerRole-Oshawa" are returned in a different order.

Expected behavior
Locations are sorted by their "real" distance. Haversine seems to be unnecessary complex, but the euclidian distance is expected by most users on _sort.

Environment (please complete the following information):

  • HAPI FHIR 8.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant