[英]HL7 HAPI-FHIR adding a new search param to resource provider
我正在使用HAPI-FHIR庫,並且嘗試向資源提供者引入新的搜索參數,例如:
@Read
public Patient getResourceById(@IdParam IdDt id,
@RequiredParam(name="session") String session){}
但是我有一個例外
"ca.uhn.fhir.rest.server.ConfigurationException: Method[public ca.uhn.fhir.model.dstu.resource.Patient PatientResourceProvider.getResourceById(ca.uhn.fhir.model.primitive.IdDt,java.lang.String)] is not allowed to have a parameter annotated with @ca.uhn.fhir.rest.annotation.RequiredParam(compositeTypes=[], chainBlacklist=[], targetTypes=[], chainWhitelist=[*], name=session)"
有什么建議怎么做嗎?
這里的問題是此方法使用@Read注釋,因此它是“ read” /“ vread”而不是“ search”。 要創建接受該參數的搜索方法,請復制現有方法,刪除第一個參數,然后將@Read更改為@Search。
請注意,由於搜索可以返回多個結果,因此您可能還想返回“列表”而不只是“患者”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.