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

Misleading error message during $lookup for non-existent CodeSystem #2362

Closed
lmsurpre opened this issue May 13, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@lmsurpre
Copy link
Member

lmsurpre commented May 13, 2021

Describe the bug
I tried to use CodeSystem/$lookup to determine whether I had a given CodeSystem loaded on my server or not. I was surprised when the error response told me that the code I passed was not in the system (because it is). It turns out that this is just our response for doing a lookup on a system that doesn't exist in the registry.

Environment
main

To Reproduce

  1. issue a GET to [base]/CodeSystem/$lookup?system=fake&code=a

note that the response contains the following error details:
"text": "Code 'a' not found in system 'fake'"

Expected behavior
The error details should explain that the server could not perform the lookup because it does not support this particular system.

Additional context
We should check the other terminology services for similar issues.

@lmsurpre lmsurpre added the bug Something isn't working label May 13, 2021
@lmsurpre lmsurpre changed the title Misleading error message while performing $lookup on a non-existant CodeSystem Misleading error message during $lookup for non-existent CodeSystem May 13, 2021
JohnTimm added a commit that referenced this issue May 13, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@lmsurpre lmsurpre added this to the Sprint 2021-07 milestone May 13, 2021
JohnTimm added a commit that referenced this issue May 13, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue May 13, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue May 13, 2021
* Issue #2362 - check for CodeSystem availability

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2362 - update server integration test for lookup operation

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>

* Issue #2362 - update copyright header

Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
@lmsurpre
Copy link
Member Author

Confirmed that after these changed, a request like GET [base]/CodeSystem/$lookup?system=fake&code=a now returns a 400 Bad Request with a better error message:

{
    "resourceType": "OperationOutcome",
    "id": "7f-0-0-1-bcdb22d4-dbf1-4b19-a908-64268a141a97",
    "issue": [
        {
            "severity": "fatal",
            "code": "not-supported",
            "details": {
                "text": "CodeSystem with url 'fake' is not available"
            },
            "expression": [
                "<empty>"
            ]
        }
    ]
}

I also confirmed that a request with a valid system and an invalid code is still returning the Code 'test' not found in system 'http://ibm.com/fhir/CodeSystem/test' message.

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

No branches or pull requests

2 participants