IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
204 stars 80 forks source link

Inline ValueSet expansion causes NullPointerException #396

Closed johngrimes closed 1 year ago

johngrimes commented 2 years ago

The following request:

POST /fhir/ValueSet/$expand HTTP/1.1
Host: snowstorm-fhir.snomedtools.org
Accept: application/fhir+json
Content-Type: application/json
Content-Length: 269

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "valueSet",
      "resource": {
        "resourceType": "ValueSet",
        "compose": {
          "include": [
            {
              "valueSet": "http://snomed.info/sct?fhir_vs=ecl/<410607006"
            }
          ]
        }
      }
    }
  ]
}

Results in the following 500 error:

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Failed to call access method: java.lang.NullPointerException"
    }
  ]
}

I would expect this to return the same result as:

GET /fhir/ValueSet/$expand?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Decl%2F%3C410607006
pgwilliams commented 2 years ago

Yup, thanks John, that's just straight forwardly wrong there. I'll get that fixed in our next release. Thanks for spotting.

pgwilliams commented 2 years ago

Raised MAINT-1947 internally to fix. Scheduled for Thurs 5 May.

kaicode commented 1 year ago

The null pointer has been fixed in the latest, Snowstorm 8.1.0. Nesting SNOMED CT ValueSets is still not supported. Consider using includes/excludes with an ECL filter instead:

POST /fhir/ValueSet/$expand
{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "valueSet",
            "resource": {
                "resourceType": "ValueSet",
                "compose": {
                    "include": [
                        {
                            "system": "http://snomed.info/sct",
                            "filter": [
                                {
                                    "property": "constraint",
                                    "op": "=",
                                    "value": "<410607006"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    ]
}