英文:
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
- How to filter concepts in ValueSet by additional property?
- 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:
{
"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 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
- How to to filter concepts in ValueSet by additional property?
- 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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论