-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
LastN not working when providing max parameter (6.1.0) #3986
Comments
Hi @ZuSe, I am running into the same issue. It seems that HapiFhir is matching the The actual code where this goes wrong can be found in the if (theMax != null) {
paramMap.setLastNMax(theMax.getValue());
}
...
getDao().translateRawParameters(theAdditionalRawParams, paramMap); The if (theMax != null) {
paramMap.setLastNMax(theMax.getValue());
theAdditionalRawParams.remove("max"); // Possible fix to skip the validation
}
...
getDao().translateRawParameters(theAdditionalRawParams, paramMap); It will skip the @Description(shortDefinition="The maximum number of observations to return for each observation code")
@OperationParam(name = "max", typeName = "integer", min = 0, max = 1)
IPrimitiveType<Integer> theMax I have not yet made any contributions to hapi-fhir, so I will see if I can verify this locally and potentially create a PR. Wondering what your view is on these findings. |
NOTE: Before filing a ticket, please see the following URL:
https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help
Describe the bug
Trying to use lastn with elastic enabled fails when adding a max parameter.
To Reproduce
Steps to reproduce the behavior:
https://my-server.com/fhir/Observation/$lastn?max=5&patient=Patient/73577357-7357-7357-7357-3b31c2506538&code=9279-1,8867-4,85354-9
Expected behavior
It should return 5 entries (if found) per code
Actual behavior
We receive an error that max as parameter is not know. Doing the same request without max gives us the latest Observation for each code :/
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: