如何按属性值筛选ValueSet?

huangapple go评论90阅读模式
英文:

How to filter ValueSet by property value?

问题

I'm trying to use FHIR terminology for my terminology service. I created a CodySystem/ValueSet pair:

{
    "resourceType": "CodeSystem",
    "url": "<my host>/gender-codesystem",
    "version": "1",
    "content": "complete",
    "property": [
        {
            "code": "laboratory_type",
            "type": "string"
        }
    ],
    "concept": [
        {
            "code": "male",
            "display": "Male",
            "property": [
                {
                    "code": "laboratory_type",
                    "valueString": "1"
                }
            ]
        },
        {
            "code": "female",
            "display": "Female"
        }
    ]
}
{
    "resourceType": "ValueSet",
    "url": "<my host>/gender",
    "compose": {
        "include": [
            {
                "system": "<my host>/gender-codesystem",
                "version": 1
            }
        ]
    }
}

In ValueSet/$expand?url=.../gender, I see the section 'expansion.contains' with all concepts. They have 'code' and 'display' but do not have information about the additional property 'laboratory_type'.

  • hapi-fhir-jpaserver-starter
  • hapi-fhir 6.4.0
  1. How to filter concepts in ValueSet by additional property?
  2. How to get additional property value in ValueSet/$expand result?
英文:

I'm trying to use FHIR terminology for own terminology service. I created CodySystem/ValueSet pair:

{
    &quot;resourceType&quot;: &quot;CodeSystem&quot;,
    &quot;url&quot;: &quot;&lt;my host&gt;/gender-codesystem&quot;,
    &quot;version&quot;: &quot;1&quot;,
    &quot;content&quot;: &quot;complete&quot;,
    &quot;property&quot;: [
        {
            &quot;code&quot;: &quot;laboratory_type&quot;,
            &quot;type&quot;: &quot;string&quot;
        }
    ],
    &quot;concept&quot;: [
        {
            &quot;code&quot;: &quot;male&quot;,
            &quot;display&quot;: &quot;Male&quot;,
            &quot;property&quot;: [
                {
                    &quot;code&quot;: &quot;laboratory_type&quot;,
                    &quot;valueString&quot;: &quot;1&quot;
                }
            ]
        },
        {
            &quot;code&quot;: &quot;female&quot;,
            &quot;display&quot;: &quot;Female&quot;
        }
    ]
}
{
    &quot;resourceType&quot;: &quot;ValueSet&quot;,
    &quot;url&quot;: &quot;&lt;my host&gt;/gender&quot;,
    &quot;compose&quot;: {
        &quot;include&quot;: [
            {
                &quot;system&quot;: &quot;&lt;my host&gt;/gender-codesystem&quot;,
                &quot;version&quot;: 1
            }
        ]
    }
}

In ValueSet/$expand?url=.../gender I see section 'expansion.contains' with all concepts. They have 'code' and 'display', but do not have information about additional property 'laboratory_type'.

  • hapi-fhir-jpaserver-starter
  • hapi-fhir 6.4.0
  1. How to to filter concepts in ValueSet by additional property?
  2. How to get additional property value in ValueSet/$expand result?

答案1

得分: 1

在FHIR中,当您使用**$expand**操作扩展一个ValueSet时,生成的扩展包含有关概念的基本信息,包括它们的代码和显示。然而,默认情况下,不会自动将CodeSystem中定义的附加属性包含在扩展中。

要根据附加属性筛选ValueSet中的概念,您可以在**$expand操作中使用$filter参数。$filter**参数允许您根据其属性指定筛选概念的条件。

要在扩展结果中包含附加属性“laboratory_type”,您需要通过在**$expand操作中使用_include参数来明确请求它。您可以在_include**参数中指定附加属性的代码(在此示例中为“laboratory_type”),以将其包含在扩展结果中。

以下是如何使用$expand操作以及_filter和_include参数来筛选概念并在扩展结果中包含附加属性的示例:

GET [base]/ValueSet/$expand?url=<my host>/gender&filter=laboratory_type=1&_include=ValueSet:compose.include.concept.property

英文:

In FHIR, when you expand a ValueSet using the $expand operation, the resulting expansion contains the basic information about the concepts, including their code and display. However, additional properties defined in the CodeSystem are not automatically included in the expansion by default.

To filter concepts in a ValueSet based on additional properties, you can use the $filter parameter in the $expand operation. The $filter parameter allows you to specify criteria for filtering the concepts based on their properties.

To include the additional property "laboratory_type" in the expansion result, you need to explicitly request it by using the _include parameter in the $expand operation. You can specify the additional property's code ("laboratory_type" in this case) in the _include parameter to include it in the expansion result.

Here's an example of how you can use the $expand operation with the _filter and _include parameters to filter concepts and include additional properties in the expansion result:

GET [base]/ValueSet/$expand?url=<my host>/gender&filter=laboratory_type=1&_include=ValueSet:compose.include.concept.property

huangapple
  • 本文由 发表于 2023年5月26日 13:23:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76337866.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定