簡體   English   中英

fhir.executeBundle 替換資源 id...如何防止這種情況?

[英]fhir.executeBundle replacing resource id…How to prevent this?

我正在使用此Java 代碼將資源上傳到 FHIRstore。 資源如下

{
  "resourceType": "Bundle",
  "id": "bundle-transaction",
  "meta": {
    "lastUpdated": "2018-03-11T11:22:16Z"
  },
  "type": "transaction",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient", "id" : 123456,
        "name": [
          {
            "family": "Smith",
            "given": [
              "Darcy"
            ]
          }
        ],
        "gender": "female",
        "address": [
          {
            "line": [
              "123 Main St."
            ],
            "city": "Anycity",
            "state": "CA",
            "postalCode": "12345"
          }
        ]
      },
      "request": {
        "method": "POST",
    "url": "Patient"
      }
    }
  ]
}

但是我正在使用的 id (123456) 被十六進制數字取代。

使用fhirstores.import 方法時不會發生這種情況有沒有辦法阻止 executeBundle 方法替換我的 id...因為我想在我的資源中使用自定義 id?

任何幫助,將不勝感激。 謝謝

當您執行事務時,效果將與您單獨發布資源相同。 在 POST 上,服務器確定資源 ID。 在常規 POST 中,id 會被忽略或引發錯誤。 在事務中,id 用於管理跨事務的引用解析,但服務器仍然選擇持久資源的 id(並相應地更新所有引用)。 如果要控制事務中的資源 id 值,請使用 PUT 而不是 POST。 (請注意,並非所有服務器都允許“upsert” - 即在特定資源位置執行創建的 PUT。)有關詳細信息,請參閱http://hl7.org/fhir/http.html#upsert

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM