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

Comments

Projects
None yet
3 participants
@travistcummings

travistcummings commented Jul 17, 2015

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

This comment has been minimized.

Owner

jamesagnew commented Jul 18, 2015

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

This comment has been minimized.

travistcummings commented Jul 20, 2015

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

This comment has been minimized.

Owner

jamesagnew commented Jul 20, 2015

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

This comment has been minimized.

travistcummings commented Jul 20, 2015

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

This comment has been minimized.

Owner

jamesagnew commented Jul 21, 2015

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

This comment has been minimized.

Owner

jamesagnew commented Aug 24, 2015

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

@jamesagnew jamesagnew closed this Aug 24, 2015

@vlad-ignatov

This comment has been minimized.

vlad-ignatov commented Jun 2, 2017

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

This comment has been minimized.

Owner

jamesagnew commented Jun 2, 2017

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

This comment has been minimized.

vlad-ignatov commented Jun 2, 2017

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

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Jun 9, 2017

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.

@jamesagnew jamesagnew closed this Jun 9, 2017

@travistcummings

This comment has been minimized.

travistcummings commented Jun 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment