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

Throw an exception when a value set include filter cannot be applied or a concept filter cannot be created #2163

Closed
JohnTimm opened this issue Mar 28, 2021 · 7 comments
Assignees

Comments

@JohnTimm
Copy link
Collaborator

In GraphTermServiceProvider and CodeSystem we currently log a warning when a value set include filter cannot be applied or a concept filter cannot be created. A better approach would be to throw a FHIRTermException and/or a FHIRTermServiceException. One issue that I ran into with throwing an exception is something I found in the spec artifacts:
https://chat.fhir.org/#narrow/stream/179202-terminology/topic/ValueSet.20with.20is-not-a.20filter.20refers.20to.20a.20CodeSystem.20that.20do

@JohnTimm JohnTimm self-assigned this Mar 28, 2021
@lmsurpre
Copy link
Member

Discussed this one with John a bit and we think that we can add special case logic to handle IS-A and IS-NOT-A like an identity filter in cases where hierarchyMeaning is not defined.

@JohnTimm
Copy link
Collaborator Author

The special case logic would also be required for GENERALIZES.

JohnTimm added a commit that referenced this issue Mar 30, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 30, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 30, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 30, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
prb112 added a commit that referenced this issue Mar 30, 2021
Issue #2163 - throw exception when filter cannot be applied / created
@lmsurpre
Copy link
Member

@JohnTimm is this one done?

@lmsurpre
Copy link
Member

John confirmed that this should be under QA because the corresponding change has already been merged.

@lmsurpre lmsurpre added this to the Sprint 2021-05 milestone Apr 12, 2021
@lmsurpre
Copy link
Member

lmsurpre commented Apr 12, 2021

During QA I found that our valueset-expand operation doesn't support input parameters at this time (as expected) and that, when passed, it leads to a 500 server error. I think we should change that to a 4xx error with an OperationOutcome.issue of "not-supported" (which is currently mapped to a 400 bad request error at this time).

Sample request that was failing: https://localhost:9443/fhir-server/api/v4/ValueSet/test/$expand?filter=Concept (where the test ValueSet exists).

@lmsurpre
Copy link
Member

I posted the following to https://localhost:9443/fhir-server/api/v4/ValueSet/$expand

{
    "resourceType": "ValueSet",
    "id": "test",
    "url": "http://ibm.com/fhir/ValueSet/test",
    "version": "1",
    "name": "Test ValueSet",
    "status": "active",
    "compose": {
        "include": [
            {
                "system": "http://ibm.com/fhir/CodeSystem/test",
                "filter": [
                    {
                        "property": "concept",
                        "op": "regex",
                        "value": "a"
                    }
                ]
            }
        ]
    }
}

The result was a 400 bad request:

{
    "resourceType": "OperationOutcome",
    "id": "7f-0-0-1-8d5ecb1f-699e-454f-83b8-0b502ff3c68e",
    "issue": [
        {
            "severity": "error",
            "code": "not-supported",
            "details": {
                "text": "RegexFilter not created (property: concept, op: regex, value: a)"
            }
        }
    ]
}

This part seems to be working as desired.

@lmsurpre
Copy link
Member

Sample request that was failing: https://localhost:9443/fhir-server/api/v4/ValueSet/test/$expand?filter=Concept (where the test ValueSet exists).

Confirmed that, with the latest change, this one now returns a 400 Bad Request with a body like the following:

{
    "resourceType": "OperationOutcome",
    "id": "7f-0-0-1-c84acefa-349b-4e05-b3d9-ee7a22dc90ea",
    "issue": [
        {
            "severity": "fatal",
            "code": "not-supported",
            "details": {
                "text": "Expansion parameters are not supported"
            },
            "expression": [
                "<empty>"
            ]
        }
    ]
}

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

No branches or pull requests

2 participants