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

reason for $cql evaluation failure should be returned to the end user #3195

Closed
kmbarton423 opened this issue Jan 13, 2022 · 2 comments
Closed
Labels
bug Something isn't working cql

Comments

@kmbarton423
Copy link
Contributor

Running with 4.11.0-SNAPSHOT in local docker container.
Attempting inline $cql where the "subject" does not exist:
GET .../$cql?expression=[Patient] p where p.gender = 'male' &subject=Patient/bogus

Received 500 Internal Server Error:
{
"resourceType": "OperationOutcome",
"id": "ac-11-0-2-61e18333-1ed9-4cf1-9fc2-e8da1ada0661",
"issue": [
{
"severity": "fatal",
"code": "exception",
"details": {
"text": "FHIROperationException: Evaluation failed"
}
}
]
}

From the log, you can see that the reason for the failure is known (see attached "tracePatientBogus.txt"):
java.lang.RuntimeException: com.ibm.fhir.persistence.exception.FHIRPersistenceResourceNotFoundException: Resource 'Patient/bogus' not found.

Suggest a better explanation to the end user about the failure.

@kmbarton423 kmbarton423 added bug Something isn't working cql labels Jan 13, 2022
@kmbarton423
Copy link
Contributor Author

tracePatientBogus.txt

csandersdev added a commit that referenced this issue Jan 19, 2022
The CQL operations were wrapping the exception from the CQL engine in a
FHIROperationException as assuming that the nested exception would
automatically be included in the issues list which isn't the case at
all. I added logic to manually add the details from the CQLException to
the issues list so that it shows up in the OperationOutcome.

Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
lmsurpre pushed a commit that referenced this issue Jan 19, 2022
* #3195 - Bubble up exception message from CQL engine

The CQL operations were wrapping the exception from the CQL engine in a
FHIROperationException as assuming that the nested exception would
automatically be included in the issues list which isn't the case at
all. I added logic to manually add the details from the CQLException to
the issues list so that it shows up in the OperationOutcome.

Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>

* Update copyrights, remove obsolete println

Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
@kmbarton423
Copy link
Contributor Author

Confirmed new messaging:

{
"resourceType": "OperationOutcome",
"id": "ac-11-0-2-c10186e2-9662-4559-8986-40be09bf8f3e",
"issue": [
{
"severity": "fatal",
"code": "exception",
"details": {
"text": "Unexpected exception caught during execution: java.lang.RuntimeException: com.ibm.fhir.persistence.exception.FHIRPersistenceResourceNotFoundException: Resource 'Patient/Patient-Bones' not found. [probeId=ac-11-0-2-af0debf9-0a23-481f-82fe-7243e15482e9]"
}
}
]
}

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

No branches or pull requests

1 participant