FHIR 发布者因 java NullPointerException 而失败

FHIR publisher fails on a java NullPointerException

我第一次尝试使用 publishler.jar 构建我们的 IG,但遇到了 NullPointerException。我知道无法在 CodeSystem 中找到一些代码存在一些问题,但我无法弄清楚。 当我粘贴输出时你会看到一个明显的问题是,出于某种原因它正在与 r5 一起工作,但我们需要 r4 (4.0.1),我有一种预感这会导致问题,因为在 r5 中我们做CodeSystems 似乎有一些我们还没有弄清楚的问题。也许有人可以找出我做错了什么。

我实际上尝试了两种不同的方法。第一个:

java -jar publisher.jar -ig "c:\FHIR\outburn\fsh-generated\resources\ImplementationGuide-outburn.json" 输出:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FHIR IG Publisher Version 1.1.104 (Git# 036db5f8f83b). Built 2022-02-16T06:43:23.823Z (13 hours old)
Detected Java version: 1.8.0_275 from C:\Program Files\AdoptOpenJDK\jdk-8.0.275.1-hotspot\jre on Windows 10/amd64 (64bit). 1796MB available
dir = C:\FHIR\outburn\input-cache, path = C:\Python39\Scripts\;C:\Python39\;C:\Program Files\AdoptOpenJDK\jdk-8.0.275.1-hotspot\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Calibre2\;C:\hapi-fhir-cli;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Ruby27-x64\bin;C:\Users\amosr\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\amosr\AppData\Local\Programs\Python\Python38-32\;C:\Users\amosr\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\PyCharm 2019.3.4\bin;;C:\Users\amosr\AppData\Roaming\npm
Parameters: -ig c:\FHIR\outburn\fsh-generated\resources\ImplementationGuide-outburn.json
Start Clock @ Wednesday, February 16, 2022 9:53:20 PM IST (2022-02-16T21:53:20+02:00)

API keys loaded from C:\Users\amosr\fhir-api-keys.ini                            (00:00.0010)
Package Cache: C:\Users\amosr\.fhir\packages                                     (00:00.0014)
Load Configuration from c:\FHIR\outburn\fsh-generated\resources\ImplementationGuide-outburn.json (00:00.0030)
Root directory: C:\FHIR\outburn\fsh-generated\resources                          (00:00.0060)
Publishing Content Failed: null                                                  (00:00.0064)
                                                                                 (00:00.0065)
Use -? to get command line help                                                  (00:00.0070)
                                                                                 (00:00.0072)
Stack Dump (for debugging):                                                      (00:00.0073)
java.lang.NullPointerException
        at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:2920)
        at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:2162)
        at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:850)
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:10005)

第二次尝试是使用 _geounce.bat(看起来像 this(link)

when run correctly it starts off with running SUSHI, which takes FHIR Shorthand files and turns them to JSON. That part's fine so I am removing that part of the output:
C:\FHIR\outburn>_genonce.bat -ig "c:\FHIR\outburn\fsh-generated\resources\ImplementationGuide-outburn.json"
Checking internet connection...
Reply from 104.196.166.17: bytes=32 time=161ms TTL=115
We're online
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FHIR IG Publisher Version 1.1.104 (Git# 036db5f8f83b). Built 2022-02-16T06:43:23.823Z (12 hours old)
Detected Java version: 1.8.0_275 from C:\Program Files\AdoptOpenJDK\jdk-8.0.275.1-hotspot\jre on Windows 10/amd64 (64bit). 1796MB available
dir = C:\FHIR\outburn, path = C:\Python39\Scripts\;C:\Python39\;C:\Program Files\AdoptOpenJDK\jdk-8.0.275.1-hotspot\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Calibre2\;C:\hapi-fhir-cli;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Ruby27-x64\bin;C:\Users\amosr\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\amosr\AppData\Local\Programs\Python\Python38-32\;C:\Users\amosr\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\JetBrains\PyCharm 2019.3.4\bin;;C:\Users\amosr\AppData\Roaming\npm
Parameters: -ig . -ig c:\FHIR\outburn\fsh-generated\resources\ImplementationGuide-outburn.json
Start Clock @ Wednesday, February 16, 2022 8:46:45 PM IST (2022-02-16T20:46:45+02:00)

API keys loaded from C:\Users\amosr\fhir-api-keys.ini                            (00:00.0009)
Package Cache: C:\Users\amosr\.fhir\packages                                     (00:00.0014)
Run Sushi on C:\FHIR\outburn                                                     (00:00.0016)
--this was SUSHI output --
Load Template from hl7.base.template                                             (00:30.0410)
2022-02-16 20:47:24.317 [main] INFO  o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:232] Failed to determine latest version of package hl7.base.template from server: http://packages.fhir.org
 Load Template from fhir.base.template#0.2.2                                     (00:40.0309)

onLoad.findSpreadsheets:

onLoad.updateIg:
     [xslt] Processing C:\FHIR\outburn\template\onLoad-ig-working.xml to C:\FHIR\outburn\template\onLoad-ig-updated.xml
     [xslt] Loading stylesheet C:\FHIR\outburn\template\scripts\onLoad.xslt

onLoad.extend:

onLoad:
Root directory: C:\FHIR\outburn                                                  (00:45.0121)
Core Package hl7.fhir.r4.core#4.0.1
Terminology Cache is at C:\FHIR\outburn\input-cache\txcache. 1 files in cache    (00:50.0633)
Connect to Terminology Server at http://tx.fhir.org                              (00:50.0637)
Load Package hl7.fhir.pubpack#0.0.9
Load Package hl7.fhir.xver-extensions#0.0.8
Load Package hl7.terminology.r4#3.0.0
Initialization complete                                                          (00:56.0996)
Fetch http://fhir.outburn.co.il/package-list.json for version check              (00:56.0999)
Load Content                                                                     (00:58.0044)
loadPrePages from FetchedFile[C:\FHIR\outburn\fsh-generated\includes] as C:\FHIR\outburn\fsh-generated\includes
Processing Conformance Resources                                                 (00:59.0527)
Generating Snapshots                                                             (01:00.0197)
Making device-mappings.html#udi relative to 'http://hl7.org/fhir/R4/'
Making event.html relative to 'http://hl7.org/fhir/R4/'
Making servicerequest-example-di.html relative to 'http://hl7.org/fhir/R4/'
Making servicerequest-example-di.html relative to 'http://hl7.org/fhir/R4/'
Generating Narratives                                                            (01:01.0699)
Publishing Content Failed: null                                                  (01:02.0700)
                                                                                 (01:02.0701)
Use -? to get command line help                                                  (01:02.0704)
                                                                                 (01:02.0709)
Stack Dump (for debugging):                                                      (01:02.0710)
java.lang.NullPointerException
        at org.hl7.fhir.r5.terminologies.CodeSystemUtilities.hasCode(CodeSystemUtilities.java:441)
        at org.hl7.fhir.r5.terminologies.CodeSystemUtilities.hasCode(CodeSystemUtilities.java:433)
        at org.hl7.fhir.r5.renderers.CodeSystemRenderer.showPropertyInTable(CodeSystemRenderer.java:248)
        at org.hl7.fhir.r5.renderers.CodeSystemRenderer.generateCodeSystemContent(CodeSystemRenderer.java:153)
        at org.hl7.fhir.r5.renderers.CodeSystemRenderer.render(CodeSystemRenderer.java:60)
        at org.hl7.fhir.r5.renderers.CodeSystemRenderer.render(CodeSystemRenderer.java:43)
        at org.hl7.fhir.r5.renderers.ResourceRenderer.render(ResourceRenderer.java:77)
        at org.hl7.fhir.igtools.publisher.Publisher.generateNarratives(Publisher.java:1806)
        at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:4671)
        at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:1005)
        at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:856)
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:10005)
Press any key to continue . . .

我真的希望有人能帮助我,因为我开始失去它:) 希望 post 不会太长。如果是,请告诉我,我会把输出结果放到一个片段网站上。

这肯定是 IG 发布者中的一个错误。将在下一个版本中修复。但原因是因为 属性 有一个 URL,它只是一个 URL。这可能是有效的和你想要的,也可能不是。

解释:

属性 定义有一个正式标识 属性 的 uri。 IGPublisher 期望采用 {code-system-uri}#{code} 格式,但该格式不是必需的。