1.10.4.1 XML によるリソース記法

logo fhir

XML 1.10.4.1

The XML syntax is closely based on XML notation:

XML によるリソース記法は、疑似 XML によるリソース定義に近いものとなります:

<name xmlns="http://hl7.org/fhir" (attrA="value")> <nameA><!-- 1..1 type description of content --><nameA> <nameB[x]><!-- 0..1 type1|type1 description --></nameB> <nameC> <!-- 1..* --> <nameD ><!-- 1..1 type>Relevant records --></nameD> </nameC> <name>

Notes:

注意:

  • To build a valid XML instance of a resource, simply replace the contents of the elements and attributes with valid content as described by the cardinality, type rules and content description found in the comment in each element
    • リソースの適正な XML インスタンスを生成するには、エレメントやアトリビュートを、各エレメントに設定されている、カーディナリティ、データタイプのルール、コメントでのコンテンツについての説明に従った、実際のコンテンツに入れ替えます。
  • Resource and Element names are case-sensitive (though duplicates that differ only in case are never defined)
    • リソースやエレメントの名前は大文字小文字の区別があります(ただし、大文字小文字の違いだけの同じ名前が定義されることはありません)
  • Note that the only properties that are represented as attributes are those defined in underlying specifications such as Atom (see below), which is used as the XML representation for bundles
    • アトリビュートとして表現されているプロパティは、バンドルの XML 表現として使われている Atom(下記参照)のように、元になった仕様で定義されているものだけであることに注意してください。
  • Specifying the character encoding in the XML is optional but recommended.
    • XML のキャラクターエンコーディング指定は省略可能ですが、指定することが推奨されています。
  • FHIR elements are always in the namespace http://hl7.org/fhir. This is usually specified as the default namespace on the root element. The only other namespaces that occur in FHIR resources are where some external content model is explicitly introduced into the resource content model. For example, XHTML is found in every resource - see below
    • FHIR のエレメントは常に http://hl7.org/fhir のネームスペースにあります。これは通常ルート・エレメントのデフォルトのネームスペースとして指定されています。FHIR リソースにその他のネームスペースが現れるのは、リソースのコンテンツの中に、FHIR の外部のコンテンツモデルが導入されたときだけです。たとえば、XMTML は全てのリソースに現れます。下記を参照してください。
  • Any of the XML elements may have an id attribute to serve as the target of an internal reference. The id attribute is not shown in this format
    • すべての XML エレメントは、内部リファレンスのリンク先として働く id アトリビュートを持つことができます。id アトリビュートはこのフォーマットでは示されていません。
  • FHIR elements are never empty. If an element is present in the resource, it must have either a value attribute, child elements as defined for its type, an id attribute that is the link target of narrative, or 1 or more extensions
  • FHIR のエレメントが空になることは決してありません。リソースの中にエレメントが現れた時には、値を持つアトリビュート、データタイプで定義されている下位エレメント、ナラティブからのリンク先になっている id アトリビュートあるいは 1 つ以上のエクステンションのいずれかを持つ必要があります。
  • Attributes can never be empty. Either they are absent, or they are present with at least one character of non-whitespace content
    • アトリビュートが空になることは決してありません。アトリビュートは、存在しないか、現れたときには 1 文字以上の空白文字を含むコンテンツを持つかのいずれかです。
  • The formal MIME-type for FHIR resources represented in XML is application/fhir+xml
    • XML 表記の FHIR リソースの公式な MIME タイプは application/fhir+xml です。

When represented as XML, resources may be validated by schema and schematron (see below), but operational systems are not required to do so (though the XML must always be valid against this specification and the schema and Schematron).

XML で表記されている場合には、リソースはスキーマやスキーマトロンで検証する(下記参照)ことができますが、実稼動システムがその検証を求められることはありません。(ただし、使われる XML は FHIR 仕様やそのスキーマやスキーマトロンに照らして適正である必要はあります。)

Atom Bundle Representation 「Atom によるバンドル表記」1.10.4.1.1

In XML bundles are represented using an Atom format (http://tools.ietf.org/html/rfc4287), following this template:

XML でのバンドルは、以下のテンプレートに従って Atom フォーマット(http://tools.ietf.org/html/rfc4287)を用いて表現されます:

<feed xmlns="http://www.w3.org/2005/Atom"> <title><!-- 1..1 string Text statement of purpose --></title> <id><!-- 1..1 uri Unique URI for this bundle --></id> <link rel="self" href="[building application url (Service base on REST)]"/><!-- 0..1 --> <link rel="first" href="[paging: url for first page of result]"/><!-- 0..1 --> <link rel="previous" href="[paging: url for previous page of result]"/><!-- 0..1 --> <link rel="next" href="[paging: url for next page of result]"/><!-- 0..1 --> <link rel="last" href="[paging: url for last page of result]"/><!-- 0..1 --> <os:totalResults xmlns:os="http://a9.com/-/spec/opensearch/1.1/"/><!-- 0..1 integer Paging: the total number of results --></os:totalResults> <updated><!-- 1..1 instant When the bundle was built --></updated> <author><!-- 0..1 Who created resource? --> <name><!-- 1..1 string Name of Human or Device that authored the resource --></name> <uri><!-- 0..1 uri Link to the resource for the author --></uri> </author> <entry><!-- Zero+ --> <title><!-- 1..1 string Text summary of resource content --></title> <id><!-- 1..1 uri Logical Id (URI) for this resource --></id> <link rel="self" href="Version Specific reference to Resource"><!-- 0..1 --></link> <updated><!-- 1..1 instant Last Updated for resource --></updated> <published><!-- 0..1 instant Time resource copied into the feed --></published> <author><!-- 0..1 Who created resource? --> <name><!-- 1..1 string Name of Human or Device that authored the resource --></name> <uri><!-- 0..1 uri Link to the resource for the author --></uri> </author> <!-- Tags affixed to the resource (0..*): --> <category term="[Tag URI]" label="[Tag Label]" scheme="http://hl7.org/fhir/tag"/> <content type="text/xml"><!-- 1..1 --> <[ResourceName] xmlns="http://hl7.org/fhir"> <!-- Content for the resource --> </[ResourceName]> </content> <summary type="xhtml"><!-- 0..1 --> <div xmlns="http://www.w3.org/1999/xhtml"><!-- Narrative from resource --></div> </summary> </entry> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <!-- 0..1 Enveloped Digital Signature (see Atom section 5.1) --> </Signature> </feed>

Notes「注意」 1.10.4.1.1.1

  • Logically, a bundle is a set of resources that are prepared to send somewhere for consumption - a "feed". There is no implication that the feed is a standing arrangement (though this is not precluded)
    • 論理的には、バンドルはどこかで処理するために用意されたリソースの集合「フィード」です。フィードには、固定した順番があるという含意はありません。(ただしその可能性は除外されません。)
  • The order of elements does not matter in an atom feed (but not entries: the order of the entries is important). The order of elements in the atom namespace as documented above does not need to be followed, though it is followed by the FHIR reference platforms
    • Atom フィードではエレメントの順番は問われません。(ただし、エントリーは別で、エントリーの順番は重要です。)上の例における Atom ネームスペースでのエレメントの順番には従う必要はありませんが、FHIR の参照実装プラットフォームでは、その順番に従っています。
  • The title for the feed and the entry are arbitrary human readable content and not to be used for any automated processing. Applications may populate these in any useful way
    • フィードやエントリのタイトルは自由に付けられる人間が読めるコンテンツで、自動化プロセスには一切使ってはいけません。
  • Every bundle must have a unique id and that id must be a valid absolute uri. UUIDs are recommended (urn:uuid:...)
    • どのバンドルも重複しない ID を持つ必要があり、その ID は有効な絶対 URL でなければなりません。UUID を使うことが推奨されます(urn:uuid:...)
  • The entry element carries the three pieces of resource metadata: Id (.id), Version Id (.link), Last Updated (.updated)
    • entry エレメントはリソースに関する 3 つのメタデータ、Id (.id)、Version Id (.link)、Last Updated (.updated) を保持します。
  • Each entry also carries all the Tags affixed to the resource in the category element. The category element can be used in other ways too
    • 各 entry は、そのリソースの category エレメントに付加されたすべてのタグも保持します。category エレメントを逆方向に使うこともできます。
  • The entry.id must be an absolute url, the tail element of which is the logical id of the resource. The id is a version independent reference
    • entry.id は絶対指定の URL でなければならず、その最後の要素はリソースの論理 ID になります。id はバージョンに無関係なリファレンスです。
  • The entry.link to self is a version specific reference to the resource.
    • self への entry.link は、そのリソースへのバージョン特定のリファレンスです。
  • When used in a RESTful implementation, the entry.link and entry.id are the URLs of the resource on the system; the version specific link can be used as the basis synchronizing pub/sub systems using the atom bundle with the updates operation. In other contexts, the values should be literal references to a server if one is available
    • RESTful 実装で用いられた時には、entry.link と entry.id は、システム上のリソースの URL です。バージョン特定のリンクを ATOM バンドルを update オペレーションで用いる pub/sub システム間の同期の基準として使うことができます。その他のコンテキストでは、サーバーが利用可能な場合には、値はそのサーバへのリテラルのリファレンスでなければなりません。
  • Note that the atom specification requires an author for each entry, but if an author is provided in the base feed element, an author is not needed on each entry
    • ATOM 仕様では、それぞれの entry に author が必要であることに注意してください。ただし基底の feed エレメントに author が与えられている場合には、個々の entry に author を入れる必要はありません。
  • The author of a resource is not explicit in the FHIR resource model; instead it is delegated to the infrastructure. The name is the name of a human author or a device. The uri is a link to the author (possibly a Practitioner resource)
    • リソースの author は FHIR のリソースモデルには明示的に示されていません。その代わりにインフラストラクチャに任されています。name は人間またはデバイスである author の名前です。url は author への(可能性としては Practitioner リソースへの)リンクです。
  • xml:base elements SHOULD NOT be used and implementations do not need to support it
    • xml:base エレメントは使ってはいけません。実装システムもそれに対応する必要はありません。
  • The entire bundle can be signed with a single Enveloped Digital Signature as described in the Atom specification (section 5.1)
    • バンドル全体は ATOM 仕様 (5.1 節)で記述されるように、エンベロープデジタル署名することができます。
  • The mime type for an bundle when represented in XML is application/atom+xml
    • XML 表現されたバンドルの MIME タイプは application/atom+xml です。
  • The feed.link element with relationship "self" is assigned no particular meaning the FHIR specification, except in the case of a search operation, but may be used to provide a reference to the source of the feed
    • "self" を指す feed.link エレメントには FHIR 仕様では search オペレーション以外では特定の意味を割り当てられていませんが、feed の送信元へのリファレンスを示すために使うことはできます。
  • The feed.link elements with relationship "first", "last", "previous" and "next" are used to implement paging in the RESTful interface and allow a client to browse through a multi-page result. See search/query
    • ”first"、"last"、"previous" そして "next" を指す feed.link は RESTful インタフェースでページングを実装するために使われ、クライアントが複数ページの結果をブラウズできるようにします。search/query を参照。

Bundling versions - deletion 「バンドルのバージョン−削除」1.10.4.1.1.2

When returning a set of resources or versions of a resource, an entry might indicate that the entry has been deleted. Deleted resources are represented in an atom feed as defined by rfc6721.txt:

複数のリソースの集合や、ひとつのリソースの複数バージョンを返す時に、その entry が既に削除されたことを示す entry を含むことがあります。ATOM feed では削除されたリソースは rfc6721.txt で定義された通り表現されます:

<feed xmlns="http://www.w3.org/2005/Atom"> ... feed elements and other entries ... <at:deleted-entry xmlns:at="http://purl.org/atompub/tombstones/1.0" ref="[Logical Id for deleted resource]" when="instant [when deleted]"> <link rel="self" href="[Version Specific reference to Resource]"><!-- 0..1 --></link> </at:deleted-entry> ... other entries ...

A deleted resource returns a 410 error if it is accessed through the RESTful interface.

削除されたリソースは RESTful インタフェースでアクセスされた場合には 410 エラーを返します。

Implementation Notes 「実装上の注意」 1.10.4.1

  • Atom Feeds may be signed following the rules described in the Atom specification. One consequence of signing the document is that URLs, Identifiers and internal references are frozen and cannot be changed. This might be a desired feature, but it may also cripple interoperability between closed ecosystems where re-identification frequently occurs. For this reason, it is recommended that only Document Bundles are signed and then only when all the related resources are found in the bundle.
    • ATOM フィードは ATOM 仕様に記述されている規則に従ってデジタル署名されている場合があります。デジタル署名の影響のひとつは URL や ID や内部リファレンスが凍結されていて変更できないという点です。これは望まれることかもしれませんが、一方で、複数の閉じたシステム連係環境の間では ID の再発行が頻発して相互運用性を損なう場合があります。
  • FHIR resources make use of id attributes as targets for internal references with resources. These id attributes are unique and resolved within the context of a single resource. When resources are combined into a bundle, different resources may contain duplicate id attributes. Thus it is important to limit the scope of resolution of an id attribute to the resource in which the id attribute is declared.
    • FHIR のリソースでは、リソースの内部リファレンスのリンク先として id アトリビュートを使用しています。ここで用いられる ID アトリビュートは単一リソースの範囲で重複せず、その範囲で解釈されます。複数のリソースがバンドルにまとめられた時には、別々のリソースが重複する id アトリビュートを含むことがあり得ます。そのため id アトリビュートの有効範囲をその id が宣言されたリソースの内部に限定することが重要です。

Binary Resources 「バイナリ・リソース」 1.10.4.1.0.1

There are situations where it is useful or required to handle pure binary content as resources. Typically, this is when the binary content is referred to from other FHIR Resources. The resource can contain any content, whether text, image, pdf, zip archive, etc. These resources are served in their native form on the rest interface, but can also be represented in XML or JSON, such as when including these resources in a bundle (used when it is convenient to include these in the feed directly rather than leaving them by reference).

時には、純然たるバイナリのコンテンツをリソースとして扱うことが有用または必要なことがあります。よくあるのは、他の FHIR リソースからバイナリのコンテンツがリファレンスされる場合です。そのようなバイナリを直接扱うリソースには、テキスト、画像、PDF、ZIP 書庫などといった、どんな種類のコンテンツも格納できます。このような各種のコンテンツは REST インタフェースでは元々のデータ形式で提供されますが、(これらのコンテンツをリファレンスで済ますより ATOM フィードに取り込んだ方が便利な場合に用いられる)バンドルにバイナリ形式のリソースを内包する場合のように XML や JSON 形式で表現される場合もあります。

When binary resources is represented as XML, it is represented as base64 encoded content along with a content-type, which is the mime-type as it would be specified in HTTP:

バイナリリソースが XML で表現される場合には、BASE64 エンコードで表現され、HTTP で規定された MIME タイプである content-type がが付加されます。

<Binary xmlns="http://hl7.org/fhir" contentType="[mime type]"> [Base64 Content] </Binary>

Binary resources can also be embedded as contained resources. If there's a desire to capture metadata about a binary object, an appropriate resource type must be used such as DocumentReference or Media.

バイナリ・リソースは、内包されたリソースとしてリソース内部に格納される場合もあります。バイナリ・オブジェクトのメタデータを保持したい場合には、DocumentReference または Media と行った適切なリソース・タイプを使わなければなりません。

XML Schema and Schematron 1.10.4.1

「XMLスキーマとスキーマトロン」

This specification provides schema definitions for all of the content models described here. The base schema is called "fhir-base.xsd" and defines all of the datatypes and also the base infrastructure types described on this page. In addition, there is a schema for each resource and a common schema fhir-all.xsd that includes all the resource schemas. A customised atom schema fhir-atom.xsd is provided for validating bundles.

FHIR 仕様で定義されるすべてのコンテンツモデルにはスキーマ定義が提供されます。基本スキーマは "fhir-base.xsd" という名前で、すべてのデータタイプと共にインフラストラクチャに関する基本リソースが定義されています。その他に、リソースごとの個別のスキーマと、それらと内容は共通で全てのリソースのスキーマを含んだ fhir-all.xsd があります。バンドルを検証するためには、カスタマイズされた ATOM のスキーマ fhir-atom.xsd が用意されています。

In addition to the w3c schema files, this specification also provides Schematron files that enforce the various constraints defined for the datatypes and resources. These are packaged as files for each resource as well as a combined fhir-atom.sch file that incorporates the rules for all resources.

W3C 準拠のスキーマファイルの他に、FHIR 仕様ではデータタイプやリソースに定義されたさまざまな制約がきちんと守られているか検証するためにスキーマトロンファイルが用意されています。スキーマトロンファイルは、リソースごとの個別のファイルにまとめられているほか、全てのリソースの規則を集約した fhir-atom.sch も用意されています。

XML that is exchanged must be valid against the w3c schema and Schematron, nor is being valid against the schema and Schematron sufficient to be a conformant instance. (This specification makes several rules that cannot be checked by either mechanism.) Exchanged content must not specify the schema or even the schema instance namespace in the resource itself.

FHIR 仕様に基づいて交換される XML は、仕様で提供されている W3C 形式のスキーマおよびスキーマトロンに対して正当でなければなりませんが、スキーマやスキーマトロンに対して正当であるだけでは、FHIR 準拠の XML インスタンスであるとは限りません。(FHIR 仕様ではいくつかこれらの機構では検証できない規則を含んでいます。)情報交換されるコンテンツでは、リソースそれ自身に、スキーマあるいはスキーマのインスタンスのネームスペースすらも指定してはいけません。

© HL7.org 2011 - 2013. FHIR v0.11-1712 generated on Fri, Sep 6, 2013 23:04+1000.

Warning: This version of FHIR is the DSTU ballot, and the stable version for the September/October connectathons. Implementers are welcome to experiment with the content defined here, but should note that the contents are subject to change without prior notice.

この日本語訳は、上記のバージョンの FHIR ドラフト仕様に基づいています。この内容に基づいてシステムを試作実装することは奨励されていますが、現在の仕様の性質上、事前の通知なしに内容の変更が行われることは、ご理解ください。