2016-04-28 16 views
3

FHIRのxsdからJavaコードを生成しようとしています。FHIR JAXB XJCコードの生成

私はhereからのコード生成スキーマをダウンロードして、私は走った:

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 

を私はすべてのxsdをEclipseにインポートしたと私はfhir-base.xsdにも同じエラーがあると思う。たとえば、account.xsdが同じディレクトリにあるため、解決方法がわかりません。

+0

関連するxsdファイル(patient.xsdとfhir-base.xsd)を投稿すると便利です。 – rmlan

+0

@rmlanファイルが巨大なので、ここのリンクからダウンロードできます。ありがとう。 – gerardribas

答えて

0

fhir-all.xsdという別のスキーマがあります。コード生成プログラムは、すべてがすべて1つのファイルに含まれていると、より幸せになる傾向があります。そのため、このスキーマを公開します。

1

私は同じ問題を抱えていました。私はfhirのウェブサイト上で提供アーカイブから3つのリソースを試してみた:

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

すべてのエラーがfhir-base.xsdに対して同じ形式(これらのエントリの73)を取るように見える...

[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 

問題を提起するために「official」、たとえばgithubなどの場所を見つけることができませんでした。私は確かにxhtmlの内容を最初から理解しようとはしていませんが、ここで何が起こっているのかは、fhirデータ型 'LanguageCode'と言語コードのhtml仕様の間に矛盾があるのでしょうか?

幸運を祈る!

関連する問題