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

Sorting patients by family name then given name does not seem to work. #198

Closed
travistcummings opened this issue Jul 17, 2015 · 11 comments
Closed

Comments

@travistcummings
Copy link

Hi, I am using this query:

/Patient/_search?name=&_count=25&_sort%3Aasc=family&_sort%3Aasc=given

To attempt to get all patients sorted by family name, then given name. I get a bundle back in an order I can't determine, but definitely isn't the right order. For example:

Aaron Alexis
Daniel Adams
Frank Taylor
Lisa Coleman
Anthony Coleman
Patrick Taylor

And am expecting:
Daniel Adams
Aaron Alexis
Anthony Coleman
Lisa Coleman
Frank Taylor
Patrick Taylor

Thanks!

@jamesagnew
Copy link
Collaborator

Thanks for reporting! Committing a fix shortly!

This was a pretty big bug in the way sorting worked, the sort was searching by all indexes of the same type as the parameter you used as opposed to just the specific one you selected. This has been fixed.

@travistcummings
Copy link
Author

Hi James,

Thanks for the quick response! Is this fix in 1.2-SNAPSHOT? I tried to install and use that version but get an error saying:

Could not find the HAPI-FHIR structure JAR on the classpath for version DSTU2_HL7ORG. Note that as of HAPI-FHIR v0.8, a separate FHIR strcture JAR must be added to your classpath (or project pom.xml if you a
/DSTU2

Another question for you, we have a client that is needing very much to have java.io.Serializable functionality in the FHIR resource implementation. I created a forum post for this:

https://groups.google.com/forum/#!topic/hapi-fhir/KXZ4n5zyIxc

Is this something you would be able to support quickly? Alternatively, we would branch from your 1.1 release and add this functionality ourselves to get our client unblocked.

Thank you,

Travis Cummings
travis@iSalusConsulting.com

On Jul 18, 2015, at 3:05 PM, James Agnew notifications@github.com wrote:

Closed #198 via 626f467.


Reply to this email directly or view it on GitHub.

@jamesagnew
Copy link
Collaborator

Hi Travis,

A recent change in the JPA server accidentally introduced a dependency on the RI structures project. Temporarily, if you want to use the 1.2-SNAPSHOT version of the server (where this fix got deployed) you need to also add that dependency on your project:

<dependency>
   <groupId>ca.uhn.hapi.fhir</groupId>
   <artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
   <version>1.2-SNAPSHOT</version>
</dependency>

Hoping to remove that dependency shortly, so this won't be a problem for long. Will reply to the Google Group post separately.

@travistcummings
Copy link
Author

I believe I am using the fix and it doesn't seem to work on the secondary sort of given name. I am using 1.2-SNAPSHOT and seeing these results now. As you can see, Lisa Coleman and Sarah Graham are out of order.

Daniel Adams
Aaron Alexis
Carol Allen
Ruth Black
Brian Brooks
Susan Clark
Amy Clark
Anthony Coleman
Steven Coleman
Lisa Coleman
Ruth Cook
Betty Davis
Joshua Diaz
Brian Gracia
Stephan Graham
Sarah Graham

jamesagnew added a commit that referenced this issue Jul 21, 2015
@jamesagnew
Copy link
Collaborator

Hi Travis,

Unfortunately I'm not able to reproduce this, even in a test using your exact data. A few questions:

  • Is this using Derby or another DB?
  • Do searches with only a sort for family and only a sort for given both return the expected results?

@jamesagnew jamesagnew reopened this Jul 21, 2015
@jamesagnew
Copy link
Collaborator

Closing old bugs. Please feel free to reopen if this is still happening.

@vlad-ignatov
Copy link

It seems like this is still broken. I am trying it on (STU3) https://sb-fhir-stu3.smarthealthit.org/smartstu3/open/Patient and I am not able to get sorted results no mather what query I use (_sort=name, _sort=given or _sort=family).

@jamesagnew
Copy link
Collaborator

Hmm. @travistcummings Any idea what version of HAPI that server is based on?

This definitely works for me on our reference server at least: http://fhirtest.uhn.ca/baseDstu3/Patient?_sort=name

@jamesagnew jamesagnew reopened this Jun 2, 2017
@vlad-ignatov
Copy link

According to the conformance statement it should be 2.4 while the reference server is 2.5-SNAPSHOT.

@jamesagnew
Copy link
Collaborator

So, HAPI 2.5 has been released, and it has fairly significant rewrites to the search code, including sorting. Probably the next thing to do is to test once the SMART server has been upgraded.

I'm not seeing this issue locally, so I'm going to assume whatever caused this has been fixed. Please feel free to comment or re-open if this continues.

@travistcummings
Copy link
Author

travistcummings commented Jun 28, 2017 via email

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

No branches or pull requests

3 participants