簡體   English   中英

FHIR JAXB XJC代碼生成

[英]FHIR JAXB XJC Code generation

我正在嘗試從xsd為FHIR生成java代碼。

我從這里下載了代碼生成模式,然后運行:

xjc patient.xsd

但我有以下例外:

parsing a schema...
[ERROR] src-resolve: Cannot resolve the name 'Account' to a(n) 'type definition' component.
  line 332 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'DetectedIssue' to a(n) 'type definition' component.
  line 354 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'ImplementationGuide' to a(n) 'type definition' component.
  line 380 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'MedicationOrder' to a(n) 'type definition' component.
  line 387 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'QuestionnaireResponse' to a(n) 'type definition' component.
  line 409 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'Parameters' to a(n) 'type definition' component.
  line 425 of file:/Users/gerard/Downloads/fhir-codegen-xsd/fhir-base.xsd

[ERROR] src-resolve: Cannot resolve the name 'MeasuredQuantity' to a(n) 'type definition' component.
  line 225 of file:/Users/gerard/Downloads/fhir-codegen-xsd/questionnaireanswers.xsd

我已經導入了eclipse所有的xsd,我在fhir-base.xsd中看到了相同的錯誤。 不知道如何解決它,因為例如account.xsd在同一目錄中。

有一個名為fhir-all.xsd的獨立模式。 當一切都在一個文件中時,代碼生成器往往會更快樂,所以我們為此目的發布了這個模式。

我遇到了同樣的問題。 我從fhir網站上提供的檔案中嘗試了三種資源:

fhir-base.xsd
fhir-all.xsd
fhir-single.xsd

每個錯誤似乎采取相同的形式(這些條目中的73個)對fhir-base.xsd ...

[ERROR] Property "Lang" is already defined. Use <jaxb:property> to resolve this conflict.
  line 323 of file:/E:/fhir-spec/resources/fhir-all-xsd/fhir-xhtml.xsd

[ERROR] The following location is relevant to the above error
  line 324 of file:/E:/fhir-spec/resources/fhir-all-xsd/fhir-xhtml.xsd

只是嘗試一些蠻力戰術..我在fhir-xhtml.xsd中發現並注釋了幾行:

Lines 323, 324
<xs:attribute name="lang" type="LanguageCode"/>
<xs:attribute ref="xml:lang"/>

Line 1351
<xs:attribute name="lang" type="LanguageCode"/>

在此之后,我能夠成功生成代碼。

mkdir gen
xjc -d gen fhir-base.xsd

我找不到“官方”的任何地方,例如github等提出問題。 我不完全確定xhtml內容的意圖,但我想知道這里可能發生的是fhir數據類型'LanguageCode'和語言代碼的html規范之間的沖突嗎?

祝好運!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM