运行 US Core Patient 示例中的 FHIR Validator 时出错

Errors when running the FHIR Validator on the US Core Patient example

当我执行以下操作时...

我预计不会出现任何错误,但会收到以下信息:

mark@redacted:~/Downloads$ java -Xmx2g -jar validator_cli.jar Patient-example.json -version 4.0.1 -ig hl7.fhir.us.core
FHIR Validation tool Version 5.6.21 (Git# 0394b96b1431). Built 2021-12-28T17:45:36.935Z (7 days old)
  Java:   11.0.11 from /usr/lib/jvm/java-11-openjdk-amd64 on amd64 (64bit). 2048MB available
  Paths:  Current = /home/mark/Downloads, Package Cache = /home/mark/.fhir/packages
  Params: Patient-example.json -version 4.0.1 -ig hl7.fhir.us.core
Loading
  Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:05.0094)
  Load hl7.terminology#3.0.0 - 3795 resources (00:01.0305)
  Terminology server http://tx.fhir.org - Version 2.0.10 (00:01.0777)
  Load hl7.fhir.uv.bulkdata#2.0.0 - 6 resources (00:00.0188)
  Load hl7.fhir.uv.smart-app-launch#2.0.0 - 0 resources (00:00.0007)
  Load us.nlm.vsac#0.3.0 - 8916 resources (00:01.0314)
  Load hl7.fhir.uv.sdc#2.7.0 - 60 resources (00:00.0014)
  Load hl7.fhir.us.core#4.1.0 - 177 resources (00:00.0022)
  Get set...  go (00:00.0873)
Validating
  Validate Patient-example.json   ..Detect format for Patient-example.json
 00:26.0837
Done. Times: Loading: 00:10.0951, validation: 00:26.0838. Memory = 1Gb

*FAILURE*: 9 errors, 0 warnings, 8 notes
  Error @ Patient.extension[0].extension[0].value.ofType(Coding) (line 29, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2106-3) is not in the value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category)
  Error @ Patient.extension[0].extension[1].value.ofType(Coding) (line 37, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#1002-5) is not in the value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category)
  Error @ Patient.extension[0].extension[2].value.ofType(Coding) (line 45, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2028-9) is not in the value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/omb-race-category)
  Error @ Patient.extension[0].extension[3].value.ofType(Coding) (line 53, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#1586-7) is not in the value set http://hl7.org/fhir/us/core/ValueSet/detailed-race, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/detailed-race)
  Error @ Patient.extension[0].extension[4].value.ofType(Coding) (line 61, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2036-2) is not in the value set http://hl7.org/fhir/us/core/ValueSet/detailed-race, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/detailed-race)
  Error @ Patient.extension[1].extension[0].value.ofType(Coding) (line 78, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2135-2) is not in the value set http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category)
  Error @ Patient.extension[1].extension[1].value.ofType(Coding) (line 86, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2184-0) is not in the value set http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity)
  Error @ Patient.extension[1].extension[2].value.ofType(Coding) (line 94, col57): The Coding provided (urn:oid:2.16.840.1.113883.6.238#2148-5) is not in the value set http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity, and a code is required from this value set.  (error message = Not in value set http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity)
  Error @ Patient.extension[2].value.ofType(code) (line 109, col6): The value provided ('F') is not in the value set 'Birth Sex' (http://hl7.org/fhir/us/core/ValueSet/birthsex), and a code is required from this value set) (error message = Error from server: Unable to find value set http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.103)
  Information @ Patient.extension[0].extension[0].value.ofType(Coding) (line 29, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[0].extension[1].value.ofType(Coding) (line 37, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[0].extension[2].value.ofType(Coding) (line 45, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[0].extension[3].value.ofType(Coding) (line 53, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[0].extension[4].value.ofType(Coding) (line 61, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[1].extension[0].value.ofType(Coding) (line 78, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[1].extension[1].value.ofType(Coding) (line 86, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
  Information @ Patient.extension[1].extension[2].value.ofType(Coding) (line 94, col57): Code System URI 'urn:oid:2.16.840.1.113883.6.238' is unknown so the code cannot be validated
mark@redacted:~/Downloads$

这对我来说没有意义,因为指定的系统和代码是有效的。为了正确验证美国核心扩展,我还需要做些什么吗?

一个可能相关也可能不相关的额外细节是,我包含此命令的脚本一直在运行,直到我清除了 ~/.fhir 缓存目录,这可能是多年来的第一次。我在验证器的输出中注意到的唯一显着差异是加载的术语版本从 2.0.0 更改为 3.0.0

问题是验证器正在选择预发布包 (4.1.0) 进行验证,而不是正式版本 4.0.0。 4.1.0 定义比赛类别的方式存在一些问题。

您可以通过指定要验证的 US 核心版本来解决此问题:

java -Xmx2g -jar validator_cli.jar Patient-example.json -version 4.0.1 -ig hl7.fhir.us.core#4.0.0

有关引擎盖下发生的事情的进一步讨论(这是违反直觉的),请参阅https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Package.20Access.20Issue