FHIR Chat · CS property=inactive and VS $expand · terminology

Stream: terminology

Topic: CS property=inactive and VS $expand


view this post on Zulip M Crenshaw (Jun 12 2018 at 18:19):

Hello,

I have a question on the inactive property of codeSystems how it affects $expand for valueSets.

In my test scenario I have added property attributes in my local codeSystem for a few concepts that I believe should mark those as inactive.

{
"code": "orange",
"display": "Orange",
"property": [
{
"code": "inactive",
"valueBoolean": true
}
]
},
{
"code": "purple",
"display": "Purple",
"property": [
{
"code": "inactive",
"valueBoolean": true
}
]
},

Other concepts I did not add any property attributes.

In my valueSet, I'm extending LOINC to also include my local codeSystem
I have set the compose section like:
"compose": {
"inactive": "false",
"include": [
{
"system": "http://loinc.org",
"concept": [
{
"code": "64290-0",
"display": "My Patient’s insurance card"
}
]
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"concept": [
{
"code": "red",
"display": "Red from vs"
},
{
"code": "orange",
"display": "Orange from vs"
},
{
"code": "purple",
"display": "Purple from vs"
},
{
"code": "blue",
"display": "Blue from vs"
},
{
"code": "yellow",
"display": "Yellow from vs"
},
{
"code": "cyan",
"display": "Cyan from vs"
}
]
}
]
},
"expansion": {
"contains": [
{
"inactive": "false"
}
]
}
}
I believe I also have tried setting the expansion.contains.inactive to "true" as well.

I query the server via a Postman Get
{{FHIR_SERVER}}/ValueSet/my-zuilp-test/$expand?activeOnly=true

And I am getting the "code": "purple" and "code": "orange" concepts in the expanded list. I had expected that those would not be in the result (below)
Am I setting something incorrectly?

Thanks!

{
"resourceType": "ValueSet",
"meta": {
"lastUpdated": "2018-06-12T13:51:28.851-04:00"
},
"status": "active",
"compose": {
"include": [
{
"system": "http://loinc.org",
"concept": [
{
"code": "64290-0",
"display": "My Patient’s insurance card"
}
]
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"concept": [
{
"code": "red",
"display": "Red from vs"
},
{
"code": "orange",
"display": "orange from vs"
},
{
"code": "purple",
"display": "Purple from vs"
},
{
"code": "blue",
"display": "Blue from vs"
},
{
"code": "yellow",
"display": "yellow from vs"
},
{
"code": "cyan",
"display": "Cyan from vs"
}
]
}
]
},
"expansion": {
"identifier": "urn:uuid:7eddc7e6-2f5d-480b-a338-ad3707b817a6",
"timestamp": "2018-06-12T13:53:46-04:00",
"total": 6,
"parameter": [
{
"name": "version",
"valueUri": "https://my-zuilp/code-system/my-zuilp-test|1.0.0"
}
],
"contains": [
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "red",
"display": "Red from vs"
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "orange",
"display": "Orange from vs"
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "purple",
"display": "Purple from vs"
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "blue",
"display": "Blue from vs"
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "yellow",
"display": "Yellow from vs"
},
{
"system": "https://my-zuilp/code-system/my-zuilp-test",
"code": "cyan",
"display": "Cyan from vs"
}
]
}
}

view this post on Zulip Michael Lawley (Jun 12 2018 at 20:02):

Which terminology server is this. If you've set activeOnly=true in the $expand call then you should not be getting inactive codes in the resulting expansion

view this post on Zulip Yunwei Wang (Jun 12 2018 at 22:59):

Those "inactive" concept are from your local defined code system. Unless the server knows that code system, it cannot identify which concept is "inactive". Also, it is not necessary to specify expansion.contains.inactive = false in your definition. That value is filled by $expand operation.

view this post on Zulip Yunwei Wang (Jun 12 2018 at 23:03):

Also, at least on my implementation, I only check inactive for intensional value set.

view this post on Zulip M Crenshaw (Jun 15 2018 at 18:28):

Sorry for the delay in getting back on this, and thank you both for your responses.

We are using Hapi and it is a local server.

Yumwei, I removed the expansion.contains.inactive = false and it still behaves the same.
Is there a good example of how to configure this on one of the public server that I can reference ?
It does not seem like the filters for VS.compse.include or exclude are working as I would expect them to as well.

view this post on Zulip Rob Hausam (Jun 15 2018 at 18:43):

Some of this behavior is dependent on the particular server implementation, and detailed aspects of the terminology-specific behavior are likely not discoverable from the capability statement. That should improve when the TerminologyCapabilities metadata endpoint is available (I'm sure that's not implemented by anyone yet), but even that might not necessarily address this. I don't know how far HAPI is in implementing this. I'm working with it now doing some extensive work with filtering for defining LOINC group value sets in FHIR, but I haven't actually looked at this aspect. I think this is a question that would be good to raise in the HAPI Google group.

view this post on Zulip M Crenshaw (Mar 01 2019 at 20:45):

Hello,

I'm looking again at codeSystems and ValueSets and then 'Gets' on those ValueSet with $expand.
I'm attempting set a 'property' in the CS that will allow the VS to exclude items in the CS. I have tried a property of 'status' and 'inactive' and several other configs as well. However, no success in my tests yet. I have tested scenarios on hapi 3.1, 3.4, and 3.6 running FHIR 3.1.

I've loaded some of my test on http://fhirtest.uhn.ca/baseDstu3. The CS has a small group of concepts (6).

In the CS id 'test-birds-S' I set the property 'status' with type 'string'
"property": [
{
"code": "status",
"uri": "http://hl7.org/fhir/concept-properties#status",
"description": "A property that indicates the status of the concept",
"type": "string"
}
],

    In two of the concepts I set the property of status = "retired"
     "property": [
                  {
                    "code": "status",
                    "valueString": "retired"
                  }
                ]

    In the associated VS,  'test-birds-S-exclude', I'm used an exclude filter
         "filter": [
                                    {
                                        "property": "status",
                                        "op": "=",
                                        "value": "retired"
                                    }
                                ]
    The 'Get' on that VS(/ValueSet/test-birds-S-exclude/$expand) does not filter out the retired concepts as expected.

In my second test I created a similar CS ('test-birds-I')with a property of 'inactive' and type 'boolean'
"property": [
{
"code": "inactive",
"uri": "http://hl7.org/fhir/concept-properties#inactive",
"description": "True if the concept is not considered active - e.g. not a valid concept any more",
"type": "boolean"
}
],

I set the same two elements to 'inactive' (and true) with that property
Example:
            "property": [
              {
                "code": "inactive",
                "valueBoolean": true
              }
            ]

In the VS  ('test-birds-I-exclude' ) I set exclude with the filter for 'inactive'
    "exclude": [
          {
            "system":  "http://hl7.org/fhir/CodeSystem/test-birds-I",
                                "filter": [
                                    {
                                        "property": "inactive",
                                        "op": "=",
                                        "value": true
                                    }
                                ]
          }
       ….

Again, the 'Get' on that VS(/ValueSet/test-birds-I-exclude/$expand) does not filter out the inactive concepts as expected.

I've looked through several hapi FHIR test servers, and I have not found any examples of valuesets that leverage ValueSet.compose.exclude.filter. ( or ValueSet.compose.include.filter)
It would be nice to see some samples of CS and the related VS's with filters.

In my testing, I also tried these scenarios with the ValueSet.compose.include.filter looking for values of false, where the CS had the property set for 'inactive' on each concept. . ( 'inactive' set to false for 4 of the 6 concepts, and 'inactive = true - as they are set in the example above).

I have also tried scenarios with ValueSet.compose.inactive set to true/false

I have been successful to explicitly exclude a concept
"exclude": [
{
"system": "http://hl7.org/fhir/CodeSystem/test-birds-S", but I don't think that is the correct way to support these types of CS changes.

    "concept": [
        {
            "code": "CP"
        },
        {
            "code": "LD"
        }

]
….

There is also a posted on the google groups to request examples as well https://groups.google.com/forum/#!topic/hapi-fhir/tq8jwfOMY8o

Any help in understanding this configuration is appreciated!

view this post on Zulip Lloyd McKenzie (Mar 01 2019 at 20:49):

@Rob Hausam ?

view this post on Zulip Michael Lawley (Mar 06 2019 at 00:01):

@M Crenshaw Have you tried any other terminology servers? What you're doing sounds right. Perhaps try with https://stu3.ontoserver.csiro.au/fhir to confirm.

view this post on Zulip Rob Hausam (Mar 06 2019 at 02:49):

Apologies for the slow response. I'm not sure that I've followed every detail, but I agree with Michael that what you've been doing seems likely reasonable. Trying with Ontoserver is a good idea, as what you're seeing may be a HAPI issue.

view this post on Zulip M Crenshaw (Mar 07 2019 at 20:50):

Hello,

Thank you @Michael Lawley and @Rob Hausam for your responses.

Yesterday, I was able to create some tests on the Ontoserver instance.
I tested 3 scenarios:
1. CS with a property - 'inactive' type Boolean (the 'inactive' property set to true on 2 concepts, the other concepts do not have a property)/VS exclude filter on 'inactive' = true
○ CS: test-birds-I
○ VS: test-birds-I-exclude
2. CS with a property - 'inactive' type Boolean (the 'inactive' property set to true on 2 concepts, the other concepts do not have a property)/VS with "inactive":false and no exclude statement,
○ CS: test-birds-I
○ VS: test-birds-II-include
3. CS with a property - 'status' type string (the 'status' property set to('retired' on 2 concepts, the other concepts do not have a property)/VS exclude filter on 'status' = 'retired'
○ CS: test-birds-S
○ VS: test-birds-S-exclude

Scenarios 2, 3 worked, the request on the VS with $expand produced the expected results.
Scenario 1 did not exclude with the filter as expected. This VS, however, will return the expect results with the operation $expand?activeOnly=true

I retested on a local HAPI 3.6 and I did not get the expected results.

I believe the Ontoserver is just FHIR 3.0.1, so this looks like this is a HAPI issue.

Thanks for your help!

view this post on Zulip Rob Hausam (Mar 08 2019 at 01:52):

I assume you're probably aware of the HAPI FHIR Google group? That would be a good place to raise this issue with James Agnew and the HAPI community and see about getting it addressed.

view this post on Zulip Jim Steel (Mar 08 2019 at 01:53):

Or use Ontoserver :wink: (disclaimer: I'm a bit biased on that one! :grinning_face_with_smiling_eyes: )

view this post on Zulip Rob Hausam (Mar 08 2019 at 01:54):

No problem with that!

view this post on Zulip Michael Lawley (Mar 08 2019 at 11:54):

Interestingly you've uncovered a bug in Ontoserver; scenario 1 should have worked.
This is now fixed.


Last updated: Apr 12 2022 at 19:14 UTC