FHIR Chat · SearchParameter with ValueSet · implementers

Stream: implementers

Topic: SearchParameter with ValueSet


view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 13:44):

hi everyone,

i have the following ValueSet

{
  "resourceType": "ValueSet",
  "id": "acme-code",
  "url": "http://terminology.hl7.org/ValueSet/acme-code",
  "identifier": [
    {
      "system": "http://acme.com/identifiers/valuesets",
      "value": "acme-code"
    }
  ],
  "version": "20211111",
  "name": "ACMECodes",
  "title": "ACME Codes",
  "status": "draft",
  "experimental": true,
  "date": "2021-11-11",
  "publisher": "Acme Co",
  "compose": {
    "include": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/acme-code",
        "version": "20211111",
        "concept": [
          {
            "code": "10000002_1",
            "display": "11-beta",
            "designation": [
              {
                "language": "en",
                "value": "synonym in english"
              },
              {
                "language": "de",
                "value": "synonym in german"
              }
            ]
          },
          {
            "code": "10000002_2",
            "display": "12-beta",
            "designation": [
              {
                "language": "sq",
                "value": "some value"
              }
            ]
          }
        ]
      }
    ]
  }
}

and the following SearchParameter :

  {
    "resourceType": "SearchParameter",
    "status": "active",
    "url": "http://raylytic.com/fhir/SearchParameter/synonym",
    "description": "prove",
    "name": "synonym",
    "code": "synonym",
    "base": [
      "ValueSet"
    ],
    "modifier": [
      "contains",
      "text"
    ],
    "type": "string",
    "expression": "ValueSet.compose.include.concept.designation.value"
  }

My aim is to search for code 10000002_2 using display or designation.value via the usage of a SearchParameter. But it turns out I got
it wrong how it works since it returns the whole ValueSet and not the specific entry. Is there a way I can do that?
Thank you
Gjergj

view this post on Zulip Josh Mandel (Nov 18 2021 at 13:46):

Can you pride an example of what kind of search you are trying to write and what kind of result you expect to see?

view this post on Zulip Josh Mandel (Nov 18 2021 at 13:48):

It's possible you don't want to search for ValueSets at all, but rather you want to be calling one of the custom operations to determine whether a specific code exists in a ValueSet.

view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 13:49):

hi Josh,
a sample is http://localhost:8080/fhir/ValueSet?synonym:contains=some value&url=http://terminology.hl7.org/ValueSet/acme-code and with that I want to get

{
            "code": "10000002_2",
            "display": "12-beta",
            "designation": [
              {
                "language": "sq",
                "value": "some value"
              }
            ]
          }

thank you

view this post on Zulip Josh Mandel (Nov 18 2021 at 13:52):

Cool, so what you are looking for is not directly supported by the API. When you search for a value sets using the syntax in your query, the result will be a search bundle where each entry in the bundle is a value set.

view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 13:53):

yes, basically it will return the whole ValueSet :frown:
question is how to do it :smile:

view this post on Zulip Josh Mandel (Nov 18 2021 at 13:56):

You may want to look at http://build.fhir.org/codesystem-operation-lookup.html if you want to be able to look up a code and get details about it -- but I don't think the accounts for synonyms.

The only out of the box approach I think is to run the query as you currently are running it, and then filter down the results on the client side. Otherwise you may need a new custom operation.

view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 13:58):

Looked already in the CodeSystem, same issue :frown:
Think in this case will have to go for a custom operation since the ValueSet is huge.
A learning opportunity :grinning:
thank you again for your time

view this post on Zulip Yunwei Wang (Nov 18 2021 at 14:06):

Are you searching for a code or a valueset that contains the code?

view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 14:07):

i'm searching for a valueset that contains that code

view this post on Zulip Yunwei Wang (Nov 18 2021 at 14:12):

You can use this operation http://build.fhir.org/codesystem-operation-find-matches.html to find the code provided synonym as property, then using ValueSet?code=xxxx to find the valueSet.

view this post on Zulip Gjergj Sheldija (Nov 18 2021 at 14:30):

have to check it you, thank you @Yunwei Wang


Last updated: Apr 12 2022 at 19:14 UTC