共用方式為


FHIR 服務中的存放區設定檔

HL7 Fast Healthcare 互通性資源 (FHIR®) 定義儲存和交換醫療保健資料的標準和互通性方式。 即使在基底 FHIR 規格中,根據使用 FHIR 的內容來定義其他規則或延伸模組會很有説明。 對於 FHIR 這類內容特定用途, FHIR 設定檔 會用於額外的規格層。 FHIR 設定檔 可讓您使用條件約束和延伸模組來縮小和自訂資源定義。

Azure Health Data Services 中的 FHIR 服務 (稱為 FHIR 服務) 允許對設定檔驗證資源,以查看資源是否符合設定檔。 本文會引導您瞭解 FHIR 設定檔的基本概念,以及如何加以儲存。 如需本文外部 FHIR 設定檔的詳細資訊,請造訪 HL7.org

FHIR 設定檔:基本概念

設定檔會在以資源表示 StructureDefinition 的資源上設定其他內容。 StructureDefinition定義資源內容或資料類型的一組規則,例如資源擁有的專案,以及這些元素可以採用的值。

以下是設定檔如何修改基底資源的一些範例:

  • 限制基數:例如,您可以將元素上的基數上限設定為 0,這表示元素在特定內容中已排除。
  • 將專案的內容限制為單一固定值。
  • 定義資源的必要擴充功能。

StructureDefinition由其標準 URL 識別:http://hl7.org/fhir/StructureDefinition/{profile}

例如:

  • http://hl7.org/fhir/StructureDefinition/patient-birthPlace 是一個基底設定檔,需要病患的已登入位址相關資訊。
  • http://hl7.org/fhir/StructureDefinition/bmi 是另一個基底設定檔,定義如何代表主體品質索引 (BMI) 觀察。
  • http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance 是一個 US Core 設定檔,可設定與病患相關聯之資源的最低期望 AllergyIntolerance ,並識別延伸模組和值集等必要欄位。

當資源符合設定檔時,會在資源的 元素內 profile 指定設定檔。 您可以在下方查看具有 http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Patient 設定檔的「病患」資源開頭範例。

{
  "resourceType" : "Patient",
  "id" : "ExamplePatient1",
  "meta" : {
    "lastUpdated" : "2020-10-30T09:48:01.8512764-04:00",
    "source" : "Organization/PayerOrganizationExample1",
    "profile" : [
      "http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-Patient"
    ]
  },

注意

設定檔必須建置在基底資源之上,且無法與基底資源衝突。 例如,如果元素的基數為 1..1,設定檔就無法將其設為選擇性。

設定檔也會由各種實作指南 (IG) 指定。 以下列出一些常見的 IG。 如需詳細資訊,請造訪特定的 IG 網站,以深入瞭解 IG 及其內定義的設定檔:

注意

FHIR 服務預設不會儲存實作指南中的任何設定檔。 您必須將它們載入 FHIR 服務。

存取設定檔和儲存設定檔

儲存設定檔

若要將設定檔儲存在 FHIR 服務中,您可以在 PUTStructureDefinition 要求主體中使用設定檔內容。 標準 PUT 或條件式更新都是將設定檔儲存在 FHIR 服務的良好方法。 如果您不確定要使用哪一項,請使用條件式更新。

標準 PUTPUT http://<your FHIR service base URL>/StructureDefinition/profile-id

or

條件式更新: PUT http://<your FHIR service base URL>/StructureDefinition?url=http://sample-profile-url

{ 
"resourceType" : "StructureDefinition",
"id" : "profile-id",
"url": "http://sample-profile-url"
	…
}

例如,如果您想要儲存 us-core-allergyintolerance 設定檔,您會使用下列 rest 命令搭配本文中的 US Core 存檔設定檔。 在此範例中,我們已包含此設定檔的程式碼片段。

PUT https://<your FHIR service base URL>/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
{
    "resourceType" : "StructureDefinition",
    "id" : "us-core-allergyintolerance",
    "text" : {
        "status" : "extensions"
    },
    "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance",
    "version" : "3.1.1",
    "name" : "USCoreAllergyIntolerance",
    "title" : "US  Core AllergyIntolerance Profile",
    "status" : "active",
    "experimental" : false,
    "date" : "2020-06-29",
        "publisher" : "HL7 US Realm Steering Committee",
    "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.healthit.gov"
        }
      ]
    }
  ],
    "description" : "Defines constraints and extensions on the AllergyIntolerance resource for the minimal set of data to query and retrieve allergy information.",

如需更多範例,請參閱開放原始碼網站上的 US Core 範例 REST 檔案 ,以逐步解說儲存 US Core 設定檔。 若要取得最新的設定檔,您應該直接從 HL7 取得設定檔,以及定義這些設定檔的實作指南。

檢視設定檔

您可以使用要求來 GET 存取現有的自訂設定檔, GET http://<your FHIR service base URL>/StructureDefinition?url={canonicalUrl} 其中 {canonicalUrl} 是設定檔的正式 URL。

例如,如果您想要檢視 US Core 目標資源設定檔:

GET https://<your FHIR service base URL>/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal

這會傳回 StructureDefinition US Core 目標設定檔的資源,這會像這樣開始:

{
  "resourceType" : "StructureDefinition",
  "id" : "us-core-goal",
  "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal",
  "version" : "3.1.1",
  "name" : "USCoreGoalProfile",
  "title" : "US Core Goal Profile",
  "status" : "active",
  "experimental" : false,
  "date" : "2020-07-21",
  "publisher" : "HL7 US Realm Steering Committee",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.healthit.gov"
        }
      ]
    }
  ],
  "description" : "Defines constraints and extensions on the Goal resource for the minimal set of data to query and retrieve a patient's goal(s).",

}

注意

您只會看到您已載入 FHIR 服務的設定檔。

FHIR 服務不會傳回 StructureDefinition 基底設定檔的實例,但可以輕鬆地在 HL7 網站上找到這些實例,例如:

  • http://hl7.org/fhir/Observation.profile.json.html
  • http://hl7.org/fhir/Patient.profile.json.html

功能語句中的設定檔

Capability Statement 列出 FHIR 服務的所有可能行為。 FHIR 服務會以下列形式更新功能語句,其中包含預存設定檔的詳細資料:

  • CapabilityStatement.rest.resource.profile
  • CapabilityStatement.rest.resource.supportedProfile

例如,若您 POST 是 US Core Patient 設定檔,其開頭如下:

{
  "resourceType": "StructureDefinition",
  "id": "us-core-patient",
  "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",
  "version": "3.1.1",
  "name": "USCorePatientProfile",
  "title": "US Core Patient Profile",
  "status": "active",
  "experimental": false,
  "date": "2020-06-27",
  "publisher": "HL7 US Realm Steering Committee",

並傳送 GETmetadata 的要求:

GET http://<your FHIR service base URL>/metadata

您將會傳回 , CapabilityStatement 其中包含您上傳至 FHIR 伺服器之 US Core Patient 設定檔的下列資訊:

...
{
    "type": "Patient",
    "profile": "http://hl7.org/fhir/StructureDefinition/Patient",
    "supportedProfile":[
        "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
    ],

設定檔中的系結

術語服務是一組函式,可對醫療「術語」執行作業,例如驗證程式代碼、翻譯程式碼、擴充值集等。FHIR 服務不支援術語服務。 如需支援作業的資訊 ($) 、資源類型和互動,請參閱服務的 CapabilityStatement。 基本 CRUD 作業和 Search (支援 ValueSet、StructureDefinition 和 CodeSystem 資源類型,如 CapabilityStatement) 中所定義,以及系統用於$validate。

ValueSets 可以包含一組複雜的規則和外部參考。 目前,服務只會考慮預先擴充的內嵌程式碼。 客戶必須先將支援的 ValueSet 上傳至 FHIR 伺服器,才能使用$validate作業。 ValueSet 資源必須使用 PUT 或條件式更新上傳至 FHIR 伺服器,如上述儲存設定檔一節所述。

下一步

在本文中,您已瞭解 FHIR 設定檔。 接下來,您將瞭解如何使用$validate來確保資源符合這些設定檔。

FHIR® 是 HL7 的注冊商標,可與 HL7 的許可權搭配使用。