2017-03-12 12 views
0

hapi fhirを使用してclojureからdstu2クライアントを作成しようとしています。メソッドが見つかりませんでしたが、clojure.reflectorにそれ以外の場合があります

(def fhir-context (. FhirContext forDstu2)) 
=> #'emrspp.fhir-resources/fhir-context 
(def opts PerformanceOptionsEnum/DEFERRED_MODEL_SCANNING) 
=> #'emrspp.fhir-resources/opts 

しかし、その後followintが失敗した:

(.setPerformanceOptions fhir-context opts) 
=> 
CompilerException java.lang.IllegalArgumentException: No matching method found: setPerformanceOptions for class ca.uhn.fhir.context.FhirContext 
テンプレートとして私は何をすると、以下のとおりです。私は

https://github.com/jamesagnew/hapi-fhir/blob/master/examples/src/main/java/example/GenericClientExample.javaを使用しかし、私は

ctx.setPerformanceOptions(PerformanceOptionsEnum.DEFERRED_MODEL_SCANNING); 
in clojure 

を実行することはできませんよ

クロージャ反射は以下のようになります。

(pprint (filter #(= "setPerformanceOptions" (str (:name %))) (:members (r/reflect fhir-context)))) 

=> 
~ 
({:name setPerformanceOptions, 
    :return-type void, 
    :declaring-class ca.uhn.fhir.context.FhirContext, 
    :parameter-types [ca.uhn.fhir.context.PerformanceOptionsEnum<>], 
    :exception-types [], 
    :flags #{:varargs :public}} 
{:name setPerformanceOptions, 
    :return-type void, 
    :declaring-class ca.uhn.fhir.context.FhirContext, 
    :parameter-types [java.util.Collection], 
    :exception-types [], 
    :flags #{:public}}) 
nil 

輸入セクションがある:なしと

(:import [org.hl7.fhir.instance.model.api IBaseOperationOutcome IBaseResource ] 
    7   [ca.uhn.fhir.context FhirContext PerformanceOptionsEnum] 
    8   [ca.uhn.fhir.model.base.resource BaseOperationOutcome ] 
    9   [ca.uhn.fhir.model.dstu2.resource Bundle 
10            Conformance Observation 
11            OperationOutcome 
12            Organization Parameters 
13            Patient Provenance] 
14   [ca.uhn.fhir.model.dstu2.valueset AdministrativeGenderEnum IssueSeverityEnum] 
15    [ca.uhn.fhir.model.primitive DateDt IdDt InstantDt] 
16   [ca.uhn.fhir.rest.api MethodOutcome SummaryEnum ] 
17   [ca.uhn.fhir.rest.client IGenericClient ServerValidationModeEnum interceptor.LoggingInterceptor ] 
18   [ca.uhn.fhir.rest.method.SearchStyleEnum ] 
19   [ca.uhn.fhir.rest.param.DateRangeParam ] 
20   [ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException ] 
21   ) 

:PPRINTと反射

除いてそこに表示されますが実行され、メソッドsetPerformanceOptionsに関して何が起こるかのいずれかのヒットを必要と??? ?

答えて

1

私はそれを数時間後に見つけました。私は近い名前空間を見て:http://hapifhir.io/apidocs/ca/uhn/fhir/context/FhirContext.html は渡す引数はJavaのコレクションである必要がありますので、

(.setPerformanceOptions fhir-context opts) 

(.setPerformanceOptions fhir-context (java.util.ArrayList. [opts])) 

またはsimplier

(.setPerformanceOptions fhir-context [opts]) 
に変更しなければならないことが明らかになりました
関連する問題