FHIR Chat · valueSet according to property · shorthand

Stream: shorthand

Topic: valueSet according to property


view this post on Zulip Kippi Bordowitz (Apr 10 2022 at 09:44):

Let's say I have a codeSystem where every concept has a property we'll call "type". Each concept can be either a procedure or a diagnosis. I need to make separate valueSets according to this property where one valueSet is for procedures and the other is for diagnoses. I've tried to get this to work but cannot figure out the actual way to write this is FSH. Usually when this happens I find an example of this somewhere, goFsh it and learn from that. But I can't find something like this so I was wondering if anyone can give me the line of code I'm looking for.
Something along the lines of:
* include concepts from $code-system where concept.property.valueCode="Diagnosis"

view this post on Zulip Kippi Bordowitz (Apr 10 2022 at 13:54):

more information:
This is what the VS I'm trying to create looks like:
image.png

This is what the CodeSystem looks like (partial):
image.png

and this is the small codeSystem containing the type codes:
image.png

The error I'm getting when I run sushi is:
error Code "procedure" is not defined for system ICD9IL. File: C:\FHIR\IsraelCoreProfile - Current working\input\fsh\ValueSet-icd9il-procedures.fsh Line: 9

view this post on Zulip Michael Lawley (Apr 11 2022 at 02:21):

That ValueSet definition looks off to me: you want the type property to = the value "procedure".
But the error you're seeing suggests your code system is not right -- is procedure a valid code in $icd9-il ? It may be that you should define this property as string-typed?

view this post on Zulip Kippi Bordowitz (Apr 11 2022 at 07:00):

@Michael Lawley Sorry, I'm not sure I understand. The main CS ($icd9-il) refers to another CS (icd9-il-code-types) created specially for this purpose: 2 codes - not strings - that allow me to then define for each concept a property, as defined in the smaller CS.
We have done this once before without a hitch.
here:
image.png
image.png

view this post on Zulip Kippi Bordowitz (Apr 11 2022 at 07:03):

also - is the line of code I'm using in the valueSet correct? Because that's something we've never tried

view this post on Zulip Michael Lawley (Apr 11 2022 at 13:36):

The ValueSet definition is definitely not right. It should be something like:

ValueSet: ICD9ILProcedures
Id: icd9il-procedures
Title: "ICD9 IL Procedures"
Description: "codes of procedures from ICD9-IL"
* ^language = #he-IL
* ^url = $icd9-il-procedures
* ^status = #draft
* ^version = "0.7.0"
* codes from system $icd9-il where type = #procedure

which translates to

{
  "resourceType": "ValueSet",
  "status": "draft",
  "name": "ICD9ILProcedures",
  "id": "icd9il-procedures",
  "title": "ICD9 IL Procedures",
  "description": "codes of procedures from ICD9-IL",
  "version": "0.7.0",
  "url": "http://example.com/i9p",
  "language": "he-IL",
  "compose": {
    "include": [
      {
        "system": "http://example.com/i9",
        "filter": [
          {
            "property": "type",
            "op": "=",
            "value": "procedure"
          }
        ]
      }
    ]
  }
}

view this post on Zulip Michael Lawley (Apr 11 2022 at 13:41):

Note that the ^property.uri in your CodeSystem definition is not defining a system for the code-typed property. It is instead a unique identifier for the property itself.
When you define a property of type code, it is assumed to be a code from the same CodeSystem. Since it is no, you have two choices -- define it to be of type Coding (which is cumbersome and verbose), or define it to be of type string (which is direct & pragmatic, but not really "the right way").

view this post on Zulip Kippi Bordowitz (Apr 11 2022 at 15:07):

@Michael Lawley thanks.
I think you meant * codes from system $icd9-il where type = "procedure", no? (i.e. - "procedure" instead of #procedure).
Then I redid the codeSystem like so:
image.png

It seems to work but how would I go about testing it? Like, there should be 31 concepts in this valueSet but obviously the valueset doesn't hold them in any way.

view this post on Zulip Chris Moesel (Apr 11 2022 at 20:27):

Hi @Kippi Bordowitz. Some of this is starting to go outside my realm of expertise -- as we're beyond the FSH part of this and into straight-up CodeSystem and ValueSet design. One thing I've noted is that CodeSystem has a filter property on it, described as "a filter that can be used in a value set compose statement when selecting concepts using a filter." So, I wonder if you need to specify that as well. You might try something like:

* ^filter.code = #type
* ^filter.operator = #=
* ^filter.value = "the type to filter on:  procedure or diagnosis"

But, again, this is outside my wheelhouse, so at this point I am guessing. Since you're into CodeSystem design now, you might consider asking on #terminology or #IG creation.

view this post on Zulip Michael Lawley (Apr 11 2022 at 21:00):

Every property defined in a CodeSystem can be used as a simple filter, so you could declare it like above, but it is not required.
@Kippi Bordowitz If you're able to successfully generate the resources (ICD9-IL CodeSystem and the ValueSet), then you can test using the $expand operation.
I believe the igpublisher effectively does this when it generates the page for the ValueSet. However, if you need/want to test by hand, then you can upload to our Ontoserver public sandbox (https://r4.ontoserver.csiro.au/fhir) and test it there.

view this post on Zulip Kippi Bordowitz (Apr 12 2022 at 09:15):

@Michael Lawley thanks!
I made a small mistake while uploading the valueSet to our hapi-fhir server. once corrected, the testing seems to have worked.
I'm not familiar with $expand so I will have to read up on it.


Last updated: Apr 12 2022 at 19:14 UTC