1.12.6.1 FHIR 仕様拡張の参考例

logo fhir

HomeDocumentationResource Definitions > Extensibility > Examples [extensibility-examples]

FHIR DSTU (v0.80-2286)

1.12.6.1 Extensibility Examples 「エクステンションの適用例」

In order to use an extension, there is a three step process:

エクステンションを使うには、次の 3 段階の手順を踏みます:

  1. Define the extension
    1. エクステンションを定義する
  2. Register the extension
    1. エクステンションを登録する
  3. Use it in the instance
    1. 情報インスタンスに使用する

This page contains examples of how this process executes.

このページでは上記のtをどのように実行するかの例を紹介します。

1.12.6.1.1 Patient Consent for Record Sharing 「記録共有に関する患者の同意」

The basic patient resource contains no information relating to patient consent, and/or the policy under which the patient to their registration details. A social web provider of personal healthcare record (PHR) services might be obliged to to keep track of the particular policy under which a patient has created their relationship with the PHR provider, and share this with their partipcants via their FHIR api. If they wish, they can extend the patient resource to represent the patient's participation agreeement. Note that other approaches to this problem are possible, but it suffices to demonstrate the extension process.

標準の Patient リソースには患者の同意に関する情報や、どのポリシーに従って患者基本情報を登録ししているかについての情報は含まれていません。患者保険医療記録 (PHR = Personal Healthcare Record) サービスを一般に提供するウェブ事業者には、PHR サービスに対する患者の個別のサービス利用ポリシーの変遷を記録しておく義務が課せられることが考えられ、その情報をFHIR の API を通じて PHR サービスの提携先と共有する必要があるかもしれません。このような場合、Patient リソースを拡張して、患者のサービス利用にかんする合意内容を表現できるようにすることができます。この問題については他の手法で解決することもできることに注意してください。ただ、エクステンションの利用方法の例としては十分使えるということです。

For the purposes of this example, we assume that the patient agrees to a participation policy as part of their sign up, and that as the provider has to change their policy, they ask patients to agree to new participation details. Each participation agreement has a URI by which it is identified, and the patient resource will carry this URI for each policy agreement that the patient has agreed to.

ここであげる例では、患者は、サービスへの参加手続きの一環として、サービス利用ポリシーに同意し、サービス提供者がポリシーを改訂する際には、患者へ新しいサービス利用ポリシーへの同意を求めることことを想定しています。サービス利用ポリシーへの同意はそれぞれが持つ URI で識別され、Patient リソースは、患者がサービス利用ポリシーに同意するごとに、ひとつの同意への URI を保持します。

1.12.6.1.1.1 Define the Extension 「エクステンションの定義」

For each extension, the first thing to do is to fill out the definitional properties of the extension:

あるエクステンションを定義する時に、最初にすべきことは、以下のような属性の一覧表を埋めることです。:

1.12.6.1.1.2 Write the Profile 「プロファイルを記述する」

From this table, we can build an actual profile.

上の表を参照して、実際のプロファイルを作成することができます。

This is all then represented formally in a profile. Such profiles do not need to include constraint statements of resources; instead, they include just extension declarations and their associated bindings. In this case, the profile looks like this:

上の表の内容はすべて、正式のプロファイルに反映されます。このようなプロファイルにはリソースの制約宣言を含める必要はなく、エクステンションの宣言と関連するバインディングを書くだけでかまいません。この例では、プロファイルは以下のようになります:

<Profile xmlns="http://hl7.org/fhir"> <name value="Example Extension Definition" /> <!-- snip other metadata --> <extensionDefn> <code value="participation-agreement" /> <contextType value="resource" /> <context value="Patient" /> <definition> <short value="Agreed agreement/policy" /> <formal value="A URI that identifies a participation agreement/policy to which the patient has agreed" /> <comments value="URI is a literal reference to agreement text (html). Systems SHALL conform to the policies as indicated. For further information, see the partnership agreement..." /> <min value="1" /> <max value="*" /> <type> <code value="uri" /> </type> <mustSupport value="true" /> <isModifier value="false" /> </definition> </extensionDefn> <!-- snip narrative --> </Profile>

Note that usually you would build the actual profile using some tool. This example was built by hand for this example.

注意すべきことは、実際にはプロファイルは何らかのツールによって作成されることです。この例については、手動で生成されました。

1.12.6.1.1.3 Register the Extension 「エクステンションを登録する」

This means the profile shown above that defines the extension is placed on the web somewhere. By preference, it will be hosted in a FHIR Profile endpoint, and the best location of all is the HL7 Profile registry (yet to be implemented).

エクステンションを登録するとは、エクステンションを定義した上記のプロファイルを、どこかのウェブに置く事です。で専用の FHIR プロファイルの格納サイトにすることが好ましく、HL7 のプロファイル・データベースが一番よい場所です。(ただし、まだ開設されていません。)

For this example, we assume that it has been uploaded to the PHR provider's own website at http://example.org/phr/documents/fhir/extensions.

この例では、PHR のプロバイダ自身のウェブサイト http://example.org/phr/documents/fhir/extensions に置かれるものとします。

1.12.6.1.1.4 Use it in the instance 「インスタンスで使用する」

To using the extension in an instance, the extension is placed in the root of the resource. Note that the url of the extension refers to the registered location, with the id of the extension as a fragment identifier.

エクステンションをインスタンスの中で使用する時は、エクステンションはリソースのルートに置かれます。エクステンションの URL は、エクステンションを登録したデータベースのウェブ上の場所を示し、エクステンションの ID が、部分 ID として吹かされることに注意してください。

<Patient xmlns="http://hl7.org/fhir"> <extension url="http://example.org/phr/documents/fhir/extensions#participation-agreement" > <valueUri value="http://example.org/phr/documents/patient/general/v1" /> </extension> </Patient>

1.12.6.1.1.5 Adding it to Patient Profile 「エクステンションを Patient プロファイルに追加する」

The profile definition above simply defines the extension "participation-agreement", and says that it is used with patient. But the profile above doesn't say that the server actually uses it. For the PHR provider to indicate that all the patients resources will use this resource, a profile on the patient resource is used:

上記のプロファイル定義はエクステンション "participation-agreement" (参加同意)を定義し、それが patient リソースで使われることを宣言しただけです。しかし、上記のプロファイルではサーバで実際にこのプロファイルが使われているかに付いては宣言していません。PHR プロバイダがすべての patient リソースがこのエクステンション付きのリソースを使用している事を示すには、patient リソースのプロファイルが使われます:

<Profile xmlns="http://hl7.org/fhir"> <name value="iso-21090" /> <!-- snip other metadata, narrative --> <structure> <!-- first, the patient root element - can be copy/paste from the base patient profile --> <element> <path value="Patient"/> <!-- snip definition --> </element> <!-- now, the general definition for extensions - can be copy/paste from the base patient profile, with changes for slicing --> <element> <path value="Patient.extension"/> <name value="base extension"/> <!-- we're going to slice the extension element, and one of the extensions is one we have defined --> <slicing> <!-- extension is always sliced on url --> <discriminator value="url"/> <!-- we don't care what the order of any extensions is --> <ordered value="false"/> <!-- Other extensions are allowed in addition to this one --> <rules value="open"/> </slicing> <!-- snip definition --> </element> <!-- now, the slice that contains our extension --> <element> <path value="Patient.extension"/> <definition> <!-- clone information from the extension definition. duplicative, but this duplication makes it over all simpler --> <short value="Agreed agreement/policy"/> <formal value="A URI that identifies a participation agreement/policy to which the patient has agreed"/> <!-- min has to be 1, since the extension itself has min = 1 --> <min value="1"/> <max value="*"/> <type> <!-- obviously it has to be an extension --> <code value="Extension"/> <!-- and here is the link to the extension definition: this extension has to conform to the rules laid down in it's definition --> <profile value="http://example.org/phr/documents/fhir/extensions#participation-agreement"/> </type> <isModifier value="false"/> </definition> </element> <!-- snip the rest of the profile --> </structure> </Profile>

Note - this step is optional.

この手続きは、省略可能である事に注意してください。

1.12.6.1.2 Patient Name Parts 「患者名の部分」

ISO 21090 (Healthcare Data Types) defines a concept called a "name part qualifier" that contains extra information about how a particular name part should be used or interpreted. In practice, this field is used rarely, except in particular cultural contexts, where certain part qualifiers are used as a matter of practice. Following the FHIR design policy, such a field is not included in the overall definition of the core name data type, instead is it added as an extension.

ISO 21090(Healthcare Data Types 医療用データタイプ)では "name part qualifier"(人名の部分の種別)と呼ばれる、特定の人名の部分がどのように使われ解釈されるべきかについての追加情報を保持する概念が定義されています。実際には、診療業務で決まった名前の構成部分が使われる特別な文化的コンテキストを除いて、このフィールドが使われる事は稀です。FHIR の設計思想に基づいて、このようなフィールドは、コアの人名データタイプ全般には含まれず、代わりにエクステンションとして追加されます。

In practice, for cases such as these in ISO 21090, HL7 provides common extensions, and these are defined at [location still to be finalized].

実際には、この ISO 21090 に見られる例のような場合には、HL7 は共通のエクステンションを提供し、それらは(まだ最終決定していません)で定義されます。

1.12.6.1.2.1 Define the Extension 「エクステンションの定義」

For each extension, the first thing to do is to fill out the definitional properties of the extension:

それぞれのエクステンションで、最初にするべき事は、以下のエクステンションの定義プロパティを埋めることです:

Not all the codes of the EntityNamePartQualifierR2 are required in this context, because prefix and suffix are explicitly part of the name types. Rather than simply refer to the OID for EntityNamePartQualifierR2 (2.16.840.1.113883.5.1122), in this case we enumerate the available codes, and set the type of the extension to code. The type of "code" is only allowed if the profile itself defines the codes that can be used. Here is a table of the codes (see the EntityNamePartQualifierR2 reference for the full definitions):

プリフィックスやサフィックスはすでに名前の部分として定義されているので、このコンテキストでは EntityNamePartQualifierR2 のすべてのコードが必要になるわけではありません。EntityNamePartQualifierR2 の OID (2.16.840.1.113883.5.1122) を単純にリファレンスする代わりに、この場合では、使用できるコードを列挙し、エクステンションのタイプを code とすることにします。タイプを "code" にするのは、プロファイル自身が使用できるコードを定義する場合に限られます。以下にコード表を示します(すべての定義については EntityNamePartQualifierR2 を参照してください):

This is all then represented formally in a profile. Such profiles do not need to include constraint statements of resources; instead, they include just extension declarations and their associated bindings. In this case, the profile looks like this:

上に示した表の内容は次にプロファイルに公式に記述されます。そのようなプロファイルには、リソースの制約についての記述を含める必要はなく、その代わりに、エクステンションの宣言と関連するバインディングを記述するだけで構いません。この例の場合は、次のようなプロファイルになります:

<Profile xmlns="http://hl7.org/fhir"> <name value="iso-21090" /> <!-- snip other metadata, including definition of RIM Mapping --> <extensionDefn> <code value="name-qualifier" /> <contextType value="datatype" /> <context value="HumanName.given" /> <context value="HumanName.prefix" /> <context value="HumanName.family" /> <context value="HumanName.suffix" /> <definition> <short value="LS | AC | NB | PR | HON | BR | AD | SP | MID | CL | IN" /> <formal value="A set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type" /> <comments value="Used to indicate additional information about the name part and how it should be used" /> <min value="0" /> <max value="*" /> <type> <code value="code" /> </type> <mustSupport value="false" /> <isModifier value="false" /> <binding> <name value="EntityNamePartQualifier" /> <isExtensible value="codelist" /> <conformance value="required" /> <description value="A set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type" /> <referenceResource> <reference value="ValueSet/name-part-qualifier" /> </referenceResource> </binding> <mapping> <identity value="RIM" /> <map value="ENXP.qualifier" /> </mapping> </definition> </extensionDefn> <!-- snip narrative --> </Profile>

Note that usually you would build the actual profile using some tool. This example was built from a spreadsheet definition by the FHIR build tooling.

実際のプロファイルは、何らかのツールを用いて作成されることに注意してください。この例はスプレッドシートによる定義から、FHIR の構築ツールを使って作成されました。

1.12.6.1.2.2 Register the Extension 「エクステンションの登録」

For this example, it is registered at http://hl7.org/fhir/Profile/iso-21090. This is the url that will appear in the definition element when the extension is used.

この例では、http://hl7.org/fhir/Profile/iso-21090 に登録されます。この URL は、エクステンションが用いられる際に、定義エレメントに記されます。

1.12.6.1.2.3 Use it in the instance 「インスタンスでエクステンションを用いる」

To using the extension in an instance, the extension is nested within the attribute that is extended. Note that the url of the extension refers to the registered location, with the id of the extension as a fragment identifier.

エクステンションをインスタンスで用いるには、エクステンションは、拡張されるアトリビュートの中に入れ子になります。エクステンションの URL は登録されたウェブ上の場所をリファレンスし、エクステンションの ID は部分 ID として含まれます。

<name> <use value="official" /> <given value="Östlund"> <extension url="http://hl7.org/fhir/Profile/iso-21090#name-qualifier" > <valueCode value="MID" /> </extension> </given> </name>

This particular example is a Scandinavian mellannamn. See Datatypes examples for additional examples.

この例は、スカンジナビアのミドルネームの例です。データタイプの実例のページに他にも例があります。

© HL7.org 2011 - 2014. FHIR DSTU (v0.80-2286) generated on Mon, Feb 3, 2014 23:47+1100 から翻訳しました。