![](/img/trans.png)
[英]HL7-Fhir : when posting a resource, is it allowed to reference to another resources by search criteria?
[英]HL7-Fhir : Nested (child) resources and _include supported/allowed in read result from a single resource
本頁介紹簡單閱讀。
但是我不清楚是否支持_include ( web-page )(請參閱第2.2.4.1節“包含路徑”)以及是否還可以返回嵌套資源 ?
以下是請求:
https://example.com/MedicationOrder/5?_include=MedicationOrder.medication有效嗎?
並且json-response應該像這樣:
{
"resourceType": "MedicationOrder",
"id": "5",
"detail" : "abc",
"medication":
{
"resourceType": "Medication",
"id": "example",
"otherDetails": "xyz"
}
}
_include僅在搜索過程中受支持。 所以
https://example.com/MedicationOrder/5?_include=MedicationOrder.medication
無效。 這是:
https://example.com/MedicationOrder?_id=5&_include=MedicationOrder:medication
然后,您將獲得包含MedicationOrder和葯物的捆綁包(如果有)。
您所說的“嵌套資源”-是指包含資源嗎? -好吧,如果MedicationOrder中包含資源,它們總是隨資源一起返回-它們是其中的一部分。 但是它們沒有像您在上面的示例中顯示的那樣出現在葯物中。 代替:
{
"resourceType": "MedicationOrder",
"id": "5",
"detail" : "abc",
"medication": {
"reference" : "#m1"
},
"contained": [
{
"resourceType": "Medication",
"id": "m1",
"otherDetails": "xyz"
}
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.