メインコンテンツまでスキップ
Version: v2.2.0

バリデーション

FRUCtoS サーバへの登録・更新を行う前に、基底仕様、及び指定されたプロファイルに対してリソースを検証します。
リソースが仕様に準拠していない場合は、処理を中断し、検証エラーの内容を含むレスポンスを返却します。

エラーメッセージ

検証結果がエラーの場合はエラーの内容を含む OperationOutcome リソースが返却されます。

(例)Bundle リソースの制約(bdl-8)に反していた場合

{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:6, location:Bundle, message:bdl-8: fullUrl cannot be a version specific reference [fullUrl.contains('/_history/').not()], type:INVARIANT, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:6, location:Bundle, message:bdl-8: fullUrl cannot be a version specific reference [fullUrl.contains('/_history/').not()], type:INVARIANT, level:ERROR"
}
]
}

検証実行中に予期しないエラーが発生し、検証を続行できなかった場合は以下のエラーメッセージを含む OperationOutcome リソースが返却されます。

{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed."
},
"diagnostics": "Resource validation failed."
}
]
}

検証項目

FHIR 仕様に従って、以下の項目を検証します。

#検証項目詳細
1リソース構造の妥当性リソース内の全てのコンテンツが仕様で定義されており、余分な要素が出現していないことを検証する
2多重度全ての要素の多重度が定義された多重度に反していないことを検証する
3データ型全ての要素の値が定義されたデータ型の仕様に準拠していることを検証する
4バインディング用語バリデーションとも。Coding または CodeableConcept 型で指定されたコードが有効であることを検証する
※外部 TerminologyService の利用設定を「 ON 」に設定している場合のみ
5制約定義された制約に準拠していることを検証する
6プロファイルプロファイルで定義された仕様に準拠していることを検証する
7QuestionnairesQuestionnaire リソースに対して、QuestionnaireResponse リソースが有効であることを検証する
8BundleDocument, Message のリファレンス要素を検証する

リソース構造の妥当性

仕様で定義されていない要素を含む場合はエラーを返却します。

(例)リソース内に不正な要素が存在する場合

  • リクエストボディ
    • Patient リソースに仕様で定義されていない test 要素を指定
{
"resourceType": "Patient",
"id": "1",
"active": true,
"test": "example",
"gender": "male"
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:5, location:Patient, message:Unrecognised property '@test', type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:5, location:Patient, message:Unrecognised property '@test', type:STRUCTURE, level:ERROR"
}
]
}

多重度

多重度が仕様に準拠していない場合はエラーを返却します。

(例)必須要素が存在しない場合

  • リクエストボディ
    • Observation リソースに status 要素(1..1)を指定していない
{
"resourceType": "Observation",
"id": "f001",
"identifier": [
{
"use": "official",
"system": "http://www.bmc.nl/zorgportal/identifiers/observations",
"value": "6323"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "15074-8",
"display": "Glucose [Moles/volume] in Blood"
}
]
},
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:1, location:Observation, message:Profile http://hl7.org/fhir/StructureDefinition/Observation, Element 'Observation.status': minimum required = 1, but only found 0, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:1, location:Observation, message:Profile http://hl7.org/fhir/StructureDefinition/Observation, Element 'Observation.status': minimum required = 1, but only found 0, type:STRUCTURE, level:ERROR"
}
]
}

(例)複数指定不可の要素が1つ以上存在する場合

  • 独自 Observation プロファイル

    • Observation.categorymax 値を「 1 」と定義
  • リクエストボディ

    • Observation リソースの category 要素(1..1)を複数指定
{
"resourceType": "Observation",
"id": "f005",
"meta": {
"profile": [
"http://jpfhir.jp/fhir/StructureDefinition/JP_Observation_LabResult"
]
},
"identifier": [
{
"use": "official",
"system": "http://www.bmc.nl/zorgportal/identifiers/observations",
"value": "6327"
}
],
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
],
"text": "Laboratory"
},
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
],
"text": "Vital Signs"
}
],
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:1, location:Observation, message:Profile http://jpfhir.jp/fhir/StructureDefinition/JP_Observation_LabResult, Element 'Observation.category': max allowed = 1, but found 2, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:1, location:Observation, message:Profile http://jpfhir.jp/fhir/StructureDefinition/JP_Observation_LabResult, Element 'Observation.category': max allowed = 1, but found 2, type:STRUCTURE, level:ERROR"
}
]
}

データ型

要素の値がその要素が許可するデータ型の仕様に準拠していない場合はエラーを返却します。

(例)要素の値がデータ型の仕様に準拠していない場合

  • リクエストボディ
    • Patient リソースの active 要素( boolean 型)の値に文字列(「 example 」)を指定
{
"resourceType": "Patient",
"id": "1",
"active": "example",
"gender": "male"
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:4, location:Patient.active, message:Error parsing JSON: the primitive value must be a boolean, type:INVALID, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:4, location:Patient.active, message:Error parsing JSON: the primitive value must be a boolean, type:INVALID, level:ERROR"
}
]
}

(例)要素の型がその要素が許可するデータ型でない場合

{
"resourceType": "Patient",
"id": "1",
"name": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation",
"valueString": "IDE"
}
],
"family": "山田",
"given": [
"太郎"
]
}
],
"gender": "male"
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:7, location:Patient.name[0].extension[0][url='http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation'], message:The Extension 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation' definition allows for the types [code] but found type string, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:7, location:Patient.name[0].extension[0][url='http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation'], message:The Extension 'http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation' definition allows for the types [code] but found type string, type:STRUCTURE, level:ERROR"
}
]
}

要素のデータ型が仕様に準拠していないリソースは、検証を行う前にエラーとなる場合があり、以下のメッセージを含むエラーを返却します。
※ バリデーションの実行設定が「 OFF 」の場合もエラーになります。

(例)要素のデータ型が仕様に準拠していない場合

  • リクエストボディ
    • Patient リソースの deceased 要素( boolean / dateTime 型)を string 型で指定
{
"resourceType": "Patient",
"id": "1",
"active": true,
"gender": "male",
"deceasedString": "example"
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Failed to parse request body as JSON resource."
},
"diagnostics": "Failed to parse request body as JSON resource."
}
]
}

バインディング

外部 TerminologyService の利用有無が「 ON 」の場合のみ有効です。

バインディングでは「外部 TerminologyService のエンドポイント」に設定された外部 TerminologyService に対して以下のリクエストを実行し、用語の検証を行います(用語バリデーション)。
自サーバに登録されているTerminology関連リソースを参照して用語を検証したい場合は、エンドポイントに自サーバのベース URL([base])を設定してください。

  • GET [base]/CodeSystem?url=[url]&_format=application/fhir+json
  • GET [base]/ValueSet?url=[url]&_format=application/fhir+json
  • GET [base]/CodeSystem/$validate-code?url=[url]&code=[code]&_format=application/fhir+json
  • GET [base]/ValueSet/$validate-code?url=[url]&system=[system]&code=[code]&_format=application/fhir+json

バインディングの動作

Coding または CodeableConcept 型で指定された値が有効でない場合にエラーを返却します。

(例)coding.system で指定した CodeSystem に存在しないコードを指定した場合

  • リクエストボディ
    • Patient リソースの identifier.type.coding.code 要素に存在しないコード(「 EXAMPLE 」)を指定
{
"resourceType": "Patient",
"id": "example",
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "EXAMPLE"
}
]
},
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}
],
"active": true
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "The concept details supplied are invalid.Details: The specified code 'EXAMPLE' is not known to belong to the specified code system 'http://terminology.hl7.org/CodeSystem/v2-0203'"
},
"diagnostics": "The concept details supplied are invalid.Details: The specified code 'EXAMPLE' is not known to belong to the specified code system 'http://terminology.hl7.org/CodeSystem/v2-0203'"
}
]
}

制約

リソース毎に定義された制約に準拠していない場合はエラーを返却します。

(例)Patient リソースの制約( pat-1 )に準拠していない場合

  • リクエストボディ
    • Patient リソースの contact 要素内に name, telecom, address, organization 要素をいずれも指定しない
{
"resourceType": "Patient",
"id": "animal",
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0131",
"code": "C"
}
]
}
]
}
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:5, location:Patient, message:pat-1: SHALL at least contain a contact's details or a reference to an organization [name.exists() or telecom.exists() or address.exists() or organization.exists()], type:INVARIANT, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:5, location:Patient, message:pat-1: SHALL at least contain a contact's details or a reference to an organization [name.exists() or telecom.exists() or address.exists() or organization.exists()], type:INVARIANT, level:ERROR"
}
]
}

プロファイル

多重度・データ型・制約以外のプロファイルで定義された仕様に対して準拠していない場合はエラーを返却します。
以下の項目を検証します。

固定値

要素の値がプロファイルで定義された固定値に一致しない場合はエラーを返却します。

(例)MedicationRequest リソースの status 要素に定義された固定値と、実際の値が一致しない場合

  • 独自 MedicationRequest プロファイル

    • MedicationRequest.status に固定値「 active 」を定義
  • リクエストボディ

{
"resourceType": "MedicationRequest",
"id": "example",
"meta": {
"profile": [
"http://jpfhir.jp/fhir/core/1.0/StructureDefinition/JP_MedicationRequest"
]
},
"status": "unknown",
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:7, location:MedicationRequest.status, message:Value does not match fixed or pattern value, type:VALUE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:7, location:MedicationRequest.status, message:Value does not match fixed or pattern value, type:VALUE, level:ERROR"
}
]
}

拡張

パッケージに含まれる拡張定義に対してデータ型や多重度を検証します。

(例)必須要素が存在しない場合

  • リクエストボディ
    • animal 拡張の Extension.extension(species)(1..1)を指定しない
{
"resourceType": "Patient",
"id": "animal",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-animal",
"extension": [
{
"url": "breed",
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "58108001",
"display": "Golden retriever"
},
{
"system": "http://example.org/fhir/CodeSystem/animal-breed",
"code": "gret",
"display": "Golden Retriever"
}
]
}
},
{
"url": "genderStatus",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/animal-genderstatus",
"code": "neutered"
}
]
}
}
]
}
],
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:Profile http://hl7.org/fhir/StructureDefinition/patient-animal, Element 'Patient.extension[0].extension[species]': minimum required = 1, but only found 0, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:Profile http://hl7.org/fhir/StructureDefinition/patient-animal, Element 'Patient.extension[0].extension[species]': minimum required = 1, but only found 0, type:STRUCTURE, level:ERROR"
}
]
}

パッケージに定義が存在しない拡張を指定した場合はエラーを返却します。

(例)パッケージに定義が存在しない拡張を指定した場合

{
"resourceType": "Patient",
"id": "example",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/extension-example",
"valueString": "example"
}
],
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:The extension http://hl7.org/fhir/StructureDefinition/extension-example is unknown, and not allowed here, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:The extension http://hl7.org/fhir/StructureDefinition/extension-example is unknown, and not allowed here, type:STRUCTURE, level:ERROR"
}
]
}

独自に定義したリソースプロファイルに対して検証する場合は、そのプロファイルで定義する独自の拡張定義が全てパッケージ内に存在している必要があります。

(例)リソースプロファイルで定義されている独自拡張( UsageDuration )の定義がパッケージに存在しない場合

  • 独自 MedicationRequest プロファイル

    • MedicationRequest.extension に、パッケージに存在しない独自拡張( UsageDuration )とパッケージに存在する独自拡張( PeriodOfUse )を定義
  • リクエストボディ

    • MedicationRequest リソースの extension 要素にパッケージに存在する独自拡張( PeriodOfUse )を指定
{
"resourceType": "MedicationRequest",
"id": "example",
"meta": {
"profile": [
"http://jpfhir.jp/fhir/core/1.0/StructureDefinition/JP_MedicationRequest"
]
},
"extension": [
{
"url": "http://jpfhir.jp/fhir/core/1.0/StructureDefinition/JP_MedicationRequestPeriodOfUse",
"valuePeriod": {
"start": "2021-02-01"
}
}
],
"status": "active",
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:10, location:MedicationRequest.extension[0], message:Problem with use of resolve() - profile '[CanonicalType[http://jpfhir.jp/fhir/core/1.0/StructureDefinition/JP_MedicationRequestUsageDuration]]' on MedicationRequest.extension:UsageDuration could not be resolved, type:PROCESSING, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:10, location:MedicationRequest.extension[0], message:Problem with use of resolve() - profile '[CanonicalType[http://jpfhir.jp/fhir/core/1.0/StructureDefinition/JP_MedicationRequestUsageDuration]]' on MedicationRequest.extension:UsageDuration could not be resolved, type:PROCESSING, level:ERROR"
}
]
}

また、Context の整合性を検証し、 拡張の出現位置が定義に一致しない場合はエラーを返却します。

(例)Gene 拡張Patient リソースに指定した場合

  • リクエストボディ
    • Patient リソースの extension 要素に Gene 拡張を指定
{
"resourceType": "Patient",
"id": "example",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene",
"valueCodeableConcept": {
"coding": [
{
"system": "http://www.genenames.org",
"code": "3236",
"display": "EGFR"
}
]
}
}
],
"active": true,
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:The extension http://hl7.org/fhir/StructureDefinition/observation-geneticsGene is not allowed to be used on the logical path set [Patient] (allowed: resource=element:Observation), type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:5, location:Patient.extension[0], message:The extension http://hl7.org/fhir/StructureDefinition/observation-geneticsGene is not allowed to be used on the logical path set [Patient] (allowed: resource=element:Observation), type:STRUCTURE, level:ERROR"
}
]
}

スライス

スライス要素に対して定義した順序での出現を求められている場合は、正しい順序でなければエラーを返却します。

(例)定義された順序と異なる順序で Patient リソースの name 要素を記述した場合

  • 独自 Patient プロファイル

    • Patient.nameslicing.ordered を「 true 」と定義
    • Patient.name のスライス要素を「 IDE 」、「 SYL 」の順に定義
  • リクエストボディ

    • Patient リソースの name 要素を「 SYL 」、「 IDE 」の順に指定
{
"resourceType": "Patient",
"id": "example",
"meta": {
"profile": [
"http://example.org/fhir/StructureDefinition/Patient-example"
]
},
"identifier": [
{
"use": "usual",
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}
],
"name": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation",
"valueCode": "SYL"
}
],
"family": "ヤマダ",
"given": [
"タロウ"
]
},
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation",
"valueCode": "IDE"
}
],
"family": "山田",
"given": [
"太郎"
]
}
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:26, location:Patient.name[1], message:As specified by profile http://example.org/fhir/StructureDefinition/Patient-example, Element 'name' is out of order in ordered slice, type:INVALID, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:26, location:Patient.name[1], message:As specified by profile http://example.org/fhir/StructureDefinition/Patient-example, Element 'name' is out of order in ordered slice, type:INVALID, level:ERROR"
}
]
}

最小値 / 最大値

要素に対して最小値 / 最大値が定義されている場合は、その条件を満たしていることを検証します。
要素の値が定義された最小値 / 最大値に対して不正である場合は、エラーを返却します。

(例)Patient リソースの birthDate 要素に対して定義された最小値に反した値を指定した場合

  • 独自 Patient プロファイル

    • Patient.birthDate に最小値「1850-01-01」(1850年1月1日)を定義
  • リクエストボディ

    • birthDate 要素に最小値より値の小さい「1800-10-01」(1800年10月1日)を指定
{
"resourceType": "Patient",
"id": "example",
"meta": {
"profile": [
"http://example.org/fhir/StructureDefinition/Patient-example"
]
},
"identifier": [
{
"use": "usual",
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345"
}
],
"gender": "male",
"birthDate": "1800-10-01",
[etc]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:17, location:Patient.birthDate, message:value is less than permitted minimum value of DateType[1850-01-01], type:INVALID, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:17, location:Patient.birthDate, message:value is less than permitted minimum value of DateType[1850-01-01], type:INVALID, level:ERROR"
}
]
}

Questionnaires

Questionnaire リソース

Questionnaire リソースの item.type 要素と item.answerOption.value 要素の整合性を検証します。

(例)item.type 要素の値が「 integer 」で item.answerOption.value 要素のデータ型が valueInteger ではない場合

  • リクエストボディ
{
"resourceType": "Questionnaire",
"id": "zika-virus-exposure-assessment",
"url": "http://example.org/Questionnaire/zika-virus-exposure-assessment",
"name": "ExampleZikaVirusExposureAssessment",
"title": "Example Zika Virus Exposure Assessment",
"status": "draft",
"item": [
{
"linkId": "1",
"code": [
{
"system": "http://example.org/questionnaires",
"code": "CDE: Resident of or Frequent Traveler to Zika Area"
}
],
"text": "Are you a resident of, or do you travel frequently to, an area with active Zika transmission?",
"type": "integer",
"answerOption": [
{
"valueDate": "2021-01-01"
}
]
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:-1, location:Questionnaire.item[0].answerOption[0].value.ofType(date), message:The data type of value must agree with the item.type: integer, type:BUSINESSRULE, level:WARNING"
},
"diagnostics": "Resource validation failed. Details: line:-1, location:Questionnaire.item[0].answerOption[0].value.ofType(date), message:The data type of value must agree with the item.type: integer, type:BUSINESSRULE, level:WARNING"
}
]
}

item.enableWhen.question 要素で指定した値が 既出の item.linkId 要素内に出現していない場合はエラーを返却します。

(例)item.enableWhen.question 要素に、既出の item 要素に存在しない値「 10 」を指定した場合

  • リクエストボディ
{
"resourceType": "Questionnaire",
"id": "zika-virus-exposure-assessment",
"url": "http://example.org/Questionnaire/zika-virus-exposure-assessment",
"name": "ExampleZikaVirusExposureAssessment",
"item": [
{
"linkId": "1",
"code": [
{
"system": "http://example.org/questionnaires",
"code": "CDE: Resident of or Frequent Traveler to Zika Area"
}
],
"text": "Are you a resident of, or do you travel frequently to, an area with active Zika transmission?",
"type": "boolean"
},
{
"linkId": "2",
"code": [
{
"system": "http://example.org/questionnaires",
"code": "CDE: Recent Travel to Zika Area"
}
],
"text": "Have you recently traveled to an area with active Zika transmission?",
"type": "boolean",
"enableWhen": [
{
"question": "10",
"operator": "=",
"answerBoolean": false
}
]
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:-1, location:Questionnaire.item[1], message:Unable to find 10 target for this question enableWhen, type:BUSINESSRULE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:-1, location:Questionnaire.item[1], message:Unable to find 10 target for this question enableWhen, type:BUSINESSRULE, level:ERROR"
}
]
}

QuestionnaireResponse リソース

パッケージ内に存在する Questionnaire リソース、または QuestionnaireResponse リソース内に contained リソースとして指定された Questionnaire リソースが存在する場合に、以下の検証を行います。

QuestionnaireResponse リソース内の item.linkId 要素の値が Questionnaire リソースの item 要素に存在しない場合はエラーを返却します。

(例)QuestionnaireResponse リソースの item.linkId 要素に Questionnaire リソースの item 要素に存在しない値「 10 」を指定した場合

  • リクエストボディ
{
"resourceType": "QuestionnaireResponse",
"id": "f201",
"contained": [
{
"resourceType": "Questionnaire",
"id": "f201",
"url": "http://hl7.org/fhir/Questionnaire/f201",
"status": "active",
[etc]
"item": [
{
"linkId": "1",
"text": "Do you have allergies?",
"type": "boolean"
},
{
"linkId": "2",
"text": "General questions",
"type": "group",
"item": [
{
"linkId": "2.1",
"text": "What is your gender?",
"type": "string"
}
]
}
]
}
],
"questionnaire": "#f201",
"status": "completed",
"item": [
{
"linkId": "10",
"text": "Do you have allergies?",
"answer": [
{
"valueBoolean": true
}
]
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:80, location:QuestionnaireResponse, message:LinkId \"10\" not found in questionnaire, type:NOTFOUND, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:80, location:QuestionnaireResponse, message:LinkId \"10\" not found in questionnaire, type:NOTFOUND, level:ERROR"
}
]
}

item.answer.value 要素のデータ型が Questionnaire リソースの item.type 要素で指定したタイプに一致しない場合はエラーを返却します。

(例)QuestionnaireResponse リソースの item.answer.value 要素のデータ型が Questionnaire リソースの item.type 要素で指定された「 boolean 」でない場合

  • リクエストボディ
{
"resourceType": "QuestionnaireResponse",
"id": "f201",
"contained": [
{
"resourceType": "Questionnaire",
"id": "f201",
"url": "http://hl7.org/fhir/Questionnaire/f201",
"status": "active",
[etc]
"item": [
{
"linkId": "1",
"text": "Do you have allergies?",
"type": "boolean"
},
{
"linkId": "2",
"text": "General questions",
"type": "group",
"item": [
{
"linkId": "2.1",
"text": "What is your gender?",
"type": "string"
}
]
}
]
}
],
"questionnaire": "#f201",
"status": "completed",
"item": [
{
"linkId": "10",
"text": "Do you have allergies?",
"answer": [
{
"valueString": "I am allergic to house dust"
}
]
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:86, location:QuestionnaireResponse.item[0].answer[0].value.ofType(string), message:Answer value must be of type boolean, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:86, location:QuestionnaireResponse.item[0].answer[0].value.ofType(string), message:Answer value must be of type boolean, type:STRUCTURE, level:ERROR"
}
]
}

item.answer.value 要素の値が Questionnaire リソースで指定された item.answerOption.value 要素で指定された値を満たしていない場合はエラーを返却します。

(例)QuestionnaireResponse リソースの item.answer.value 要素の値が Questionnaire リソースの item.answerOption.value 要素の値と一致しない場合

  • リクエストボディ
{
"resourceType": "QuestionnaireResponse",
"id": "example",
"contained": [
{
"resourceType": "Questionnaire",
"id": "example",
"url": "http://hl7.org/fhir/Questionnaire/example",
"status": "draft",
"item": [
{
"linkId": "birthDetails",
"text": "Birth details - To be completed by health professional",
"type": "group",
"item": [
{
"linkId": "group",
"type": "group",
"item": [
{
"linkId": "sex",
"text": "Sex",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"code": "F"
}
},
{
"valueCoding": {
"code": "M"
}
}
]
},
[etc]
]
}
]
}
]
}
],
"questionnaire": "#example",
"status": "completed",
"item": [
{
"linkId": "birthDetails",
"text": "Birth details - To be completed by health professional",
"item": [
{
"linkId": "group",
"item": [
{
"linkId": "sex",
"text": "Sex",
"answer": [
{
"valueCoding": {
"system": "http://example.org/gender-example",
"code": "f"
}
}
]
},
[etc]
]
}
]
}
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:131, location:QuestionnaireResponse.item[0].item[0].item[0].answer[0].value.ofType(Coding), message:The code http://example.org/gender-example::f is not a valid option, type:STRUCTURE, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:131, location:QuestionnaireResponse.item[0].item[0].item[0].answer[0].value.ofType(Coding), message:The code http://example.org/gender-example::f is not a valid option, type:STRUCTURE, level:ERROR"
}
]
}

Bundle

ドキュメントとメッセージングでは、FHIR 仕様に従って以下の検証を行います。

Document (Bundle.type=document)

Composition リソースによって参照されるリソースが Bundle リソース内に存在しない場合はエラーを返却します。

(例)Composition.subject 要素で指定した値に一致する Patient リソースが Bundle リソースのいずれのエントリにも存在しない場合

  • リクエストボディ
{
"resourceType": "Bundle",
"id": "father",
"meta": {
"lastUpdated": "2013-05-28T22:12:21Z"
},
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0"
},
"type": "document",
"timestamp": "2013-05-28T22:12:21Z",
"entry": [
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Composition/180f219f-97a8-486d-99d9-ed631fe4fc57",
"resource": {
"resourceType": "Composition",
"id": "180f219f-97a8-486d-99d9-ed631fe4fc57",
"meta": {
"lastUpdated": "2013-05-28T22:12:21Z"
},
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "28655-9"
}
],
"text": "Discharge Summary from Responsible Clinician"
},
"subject": {
"reference": "http://fhir.healthintersections.com.au/open/Patient/d1",
"display": "Eve Everywoman"
},
[etc]
}
}
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:33, location:Bundle.entry[0].resource.subject.reference, message:Can't find 'http://fhir.healthintersections.com.au/open/Patient/d1' in the bundle (Composition.subject), type:INVALID, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:33, location:Bundle.entry[0].resource.subject.reference, message:Can't find 'http://fhir.healthintersections.com.au/open/Patient/d1' in the bundle (Composition.subject), type:INVALID, level:ERROR"
}
]
}

Composition リソース、及び Composition リソースによって参照されるリソースのいずれからも参照されないリソースが Bundle リソース内に存在する場合はエラーを返却します。

(例)いずれのリソースからも参照されない Organization リソースが Bundle リソース内に存在する場合

  • リクエストボディ
{
"resourceType": "Bundle",
"id": "father",
"meta": {
"lastUpdated": "2013-05-28T22:12:21Z"
},
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0"
},
"type": "document",
"timestamp": "2013-05-28T22:12:21Z",
"entry": [
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Composition/180f219f-97a8-486d-99d9-ed631fe4fc57",
"resource": {
"resourceType": "Composition",
"id": "180f219f-97a8-486d-99d9-ed631fe4fc57",
"meta": {
"lastUpdated": "2013-05-28T22:12:21Z"
},
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "28655-9"
}
],
"text": "Discharge Summary from Responsible Clinician"
},
"subject": {
"reference": "http://fhir.healthintersections.com.au/open/Patient/d1",
"display": "Eve Everywoman"
},
"encounter": {
"reference": "http://fhir.healthintersections.com.au/open/Encounter/doc-example"
},
[etc]
}
},
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Organization/example",
"resource": {
"resourceType": "Organization",
"id": "example",
"name": "Health Level Seven International",
"alias": [
"HL7 International"
],
[etc]
}
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:105, location:Bundle.entry[1], message:Entry 'http://fhir.healthintersections.com.au/open/Organization/example' isn't reachable by traversing from first Bundle entry, type:INFORMATIONAL, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:105, location:Bundle.entry[1], message:Entry 'http://fhir.healthintersections.com.au/open/Organization/example' isn't reachable by traversing from first Bundle entry, type:INFORMATIONAL, level:ERROR"
}
]
}

Messaging (Bundle.type=message)

MessageHeader リソースの focus 要素によって参照されるリソースが Bundle リソース内に存在しない場合はエラーを返却します。

(例)MessageHeader.focus 要素で指定した値に一致する Patient リソースが Bundle リソースのいずれのエントリにも存在しない場合

  • リクエストボディ
{
"resourceType": "Bundle",
"id": "10bb101f-a121-4264-a920-67be9cb82c74",
"type": "message",
"timestamp": "2015-07-14T11:15:33+10:00",
"entry": [
{
"fullUrl": "urn:uuid:267b18ce-3d37-4581-9baa-6fada338038b",
"resource": {
"resourceType": "MessageHeader",
"id": "267b18ce-3d37-4581-9baa-6fada338038b",
"eventCoding": {
"system": "http://example.org/fhir/message-events",
"code": "patient-link"
},
"source": {
"endpoint": "http://example.org/clients/ehr-lite"
},
"responsible": {
"reference": "http://acme.com/ehr/fhir/Practitioner/2323-33-4"
},
"focus": [
{
"reference": "http://acme.com/ehr/fhir/Patient/example"
},
{
"reference": "http://acme.com/ehr/fhir/Patient/pat12"
}
]
}
},
{
"fullUrl": "http://acme.com/ehr/fhir/Patient/pat12",
"resource": {
"resourceType": "Patient",
"id": "pat12",
[etc]
}
},
[etc]
]
}
  • レスポンスボディ
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Resource validation failed. Details: line:23, location:Bundle.entry[0].resource.focus[0].reference, message:Can't find 'http://acme.com/ehr/fhir/Patient/example' in the bundle (MessageHeader.focus), type:INVALID, level:ERROR"
},
"diagnostics": "Resource validation failed. Details: line:23, location:Bundle.entry[0].resource.focus[0].reference, message:Can't find 'http://acme.com/ehr/fhir/Patient/example' in the bundle (MessageHeader.focus), type:INVALID, level:ERROR"
}
]
}

検証対象外項目

以下の項目は個別の実装が必要であり、現在未実装のため、検証対象外です。

#検証対象外詳細
1Must SupportMust Support 要素に対する検証-
2Implementation GuideImplementation Guide に対する検証-
3Best PracticesBest Practices として定義された制限事項に対する検証DomainResource の制約 dom-6 (リソースに text 要素を含めるべきである)を満たしていない場合
{
 "resourceType": "Patient",
 "id": "example",
 "active": true,
 [etc]
}