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

chained search with modifier :missing causes internal error #1413

Closed
kmbarton423 opened this issue Aug 14, 2020 · 2 comments
Closed

chained search with modifier :missing causes internal error #1413

kmbarton423 opened this issue Aug 14, 2020 · 2 comments
Assignees
Labels
bug Something isn't working search
Milestone

Comments

@kmbarton423
Copy link
Contributor

Working on cloud tenant running IBM FHIR server 4.3.2

Issued via Postman
GET {{base}}{{contextRoot}}Observation?subject:Patient.gender:missing=true

Response (500 Internal Server Error):
{
"resourceType": "OperationOutcome",
"id": "ac-1e-f9-a6-e634f01e-1476-4690-8c08-a53d18328c50",
"issue": [
{
"severity": "fatal",
"code": "exception",
"details": {
"text": "FHIRPersistenceDataAccessException: Server error: failure retrieving count"
}
}
]
}

Expected successful search attempt.

Info from LogDNA provided.
2020Aug14LogDNA.txt

@kmbarton423 kmbarton423 added the bug Something isn't working label Aug 14, 2020
@lmsurpre
Copy link
Member

Got around to searching this one and it turns out we already had an issue for it: #473
That said, I think we should turn that one into the "feature request" for supporting this properly and keep this one (#1413) to fix the error message...specifically, we should return a good message that indicates that we don't support modifiers on chained parameters.

@lmsurpre lmsurpre self-assigned this Aug 14, 2020
@lmsurpre lmsurpre added this to the Sprint 16 milestone Aug 14, 2020
lmsurpre added a commit that referenced this issue Aug 14, 2020
…t it

1. uncomment the chained_missing search tests from the fhir-persistence module
2. update FHIRPersistenceJDBCImpl.checkModifiers to throw a FHIRPersistenceNotSupportedException for chained params with a modifier
3. override these search tests in the fhir-persistence-jdbc concrete subtypes and add an exception expectation

separately, i found and opened issue #1415 and made a similar fix:
4. add a search test to AbstractWholeSystemSearchTest
5. update FHIRPersistenceJDBCImpl.checkModifiers to throw a FHIRPersistenceNotSupportedException for whole-system search params with the missing modifier
6. override that search test in JDBCWholeSystemSearchTest to expect that exception

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Aug 14, 2020
1. added javadoc for Element.is

2. added issue of type NOT_SUPPORTED to
FHIRPersistenceNotSupportedException for unsupported modifiers

3. added not-supported-detail extension for requests to unsupported
resource type endpoints and flipped logic in IssueTypeToHttpStatusMapper
so that only NOT_SUPPORTED issues with the "resource" extension are
turned into 404 (NOT_FOUND) errors

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Aug 15, 2020
1. added javadoc for Element.is

2. added issue of type NOT_SUPPORTED to
FHIRPersistenceNotSupportedException for unsupported modifiers

3. added not-supported-detail extension for requests to unsupported
resource type endpoints and flipped logic in IssueTypeToHttpStatusMapper
so that only NOT_SUPPORTED issues with the "resource" extension are
turned into 404 (NOT_FOUND) errors

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@kmbarton423
Copy link
Contributor Author

Verified the following behavior on cloud tenant:
"version": "4.4.0",
"name": "IBM FHIR Server",
"status": "active",
"date": "2020-08-24T18:02:12.529Z",
"publisher": "IBM Corporation",
"description": "IBM FHIR Server version 4.4.0 build id development"

GET {{base}}{{contextRoot}}Observation?subject:Patient.gender:missing=true

Returned status -> 400 Bad Request
{
"resourceType": "OperationOutcome",
"id": "ac-1e-ce-12-85028320-9037-4d8f-b945-20fb16e318e0",
"issue": [
{
"severity": "fatal",
"code": "not-supported",
"_code": {
"extension": [
{
"url": "http://ibm.com/fhir/extension/not-supported-detail",
"valueCode": "interaction"
}
]
},
"details": {
"text": "Modifier 'missing' is not yet supported for chained parameters [code=subject]"
}
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working search
Projects
None yet
Development

No branches or pull requests

2 participants