【问题标题】:Compartment Search is not working in Hapi Fhir JPA Server隔间搜索在 Hapi Fhir JPA 服务器中不起作用
【发布时间】:2020-05-13 08:46:45
【问题描述】:

我正在为 R4 使用 Hapi FHIR Jpa Server 实现。我正在尝试在此服务器上进行隔间搜索。它正在抛出错误。我正在使用通用客户端执行隔间搜索。

response = client.search()
  .forResource(FamilyMemberHistory.class)
  .withIdAndCompartment("b3126407-6d25-4fc1-a8b2-d0d6f629be92", "Patient")
  .returnBundle(Bundle.class)
  .execute();

我已将LoggingInterceptor 注册到我的 GenericClient 以查看请求是如何形成的。它看起来像http://localhost:8090/fhir/FamilyMemberHistory/b3126407-6d25-4fc1-a8b2-d0d6f629be92/Patient。当 Hapi Fhir JPA Server 收到此请求时,它会抛出以下错误。

2020-05-13 14:03:49.033 TRACE 52512 --- [io-8090-exec-10] c.u.f.r.s.method.SearchMethodBinding     : Method public ca.uhn.fhir.rest.api.server.IBundleProvider ca.uhn.fhir.jpa.rp.r4.FamilyMemberHistoryResourceProvider.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,ca.uhn.fhir.rest.api.server.RequestDetails,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.HasAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.DateRangeParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.ReferenceAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.ReferenceAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,java.util.Map,java.util.Set,ca.uhn.fhir.rest.param.DateRangeParam,java.util.Set,ca.uhn.fhir.rest.api.SortSpec,java.lang.Integer,ca.uhn.fhir.rest.api.SummaryEnum,ca.uhn.fhir.rest.api.SearchTotalModeEnum) doesn't match because ID is not null: FamilyMemberHistory/b3126407-6d25-4fc1-a8b2-d0d6f629be92
2020-05-13 14:03:49.033 TRACE 52512 --- [io-8090-exec-10] ca.uhn.fhir.rest.server.ResourceBinding  : Handler public ca.uhn.fhir.rest.api.server.IBundleProvider ca.uhn.fhir.jpa.rp.r4.FamilyMemberHistoryResourceProvider.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,ca.uhn.fhir.rest.api.server.RequestDetails,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.HasAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.StringAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.DateRangeParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.ReferenceAndListParam,ca.uhn.fhir.rest.param.UriAndListParam,ca.uhn.fhir.rest.param.ReferenceAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,ca.uhn.fhir.rest.param.TokenAndListParam,java.util.Map,java.util.Set,ca.uhn.fhir.rest.param.DateRangeParam,java.util.Set,ca.uhn.fhir.rest.api.SortSpec,java.lang.Integer,ca.uhn.fhir.rest.api.SummaryEnum,ca.uhn.fhir.rest.api.SearchTotalModeEnum) does not match
2020-05-13 14:03:49.033 DEBUG 52512 --- [io-8090-exec-10] ca.uhn.fhir.rest.server.ResourceBinding  : Looking for a handler for ca.uhn.fhir.rest.server.servlet.ServletRequestDetails@25b24c89
2020-05-13 14:03:49.033  WARN 52512 --- [io-8090-exec-10] c.u.f.r.s.i.ExceptionHandlingInterceptor : Failure during REST processing: ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[FamilyMemberHistory/b3126407-6d25-4fc1-a8b2-d0d6f629be92/Patient] with parameters [[]]

【问题讨论】:

    标签: hl7-fhir hapi-fhir


    【解决方案1】:

    看起来 Hapi 库以错误的方式构建了搜索 URL。我原以为您的代码会生成GET [base]/Patient/[id]/FamilyMemberHistory,因为隔间搜索应该首先列出隔间(即患者)。

    也许您可以通过切换代码中的资源类型来解决这个问题?

    【讨论】:

    • 是的,你是对的。它构造了错误的 URL。但是,我在 Postman 的 Hapi FHIR JPA 服务器上尝试了GET [base]/Patient/[id]/FamilyMemberHistory。它不起作用并引发类似的错误。我认为 Hapi FHIR JPA Server 不支持分区搜索。
    【解决方案2】:

    正如您在评论中指出的那样,HAPI FHIR JPA 服务器实现不支持分区搜索。请参阅 2017 年 HAPI FHIR Google Group 中的this post

    如果您希望返回特定患者的所有 FamilyMemberHistory 资源,FamilyMemberHistory 资源确实提供了 search parameterpatient

    [base]/FamilyMemberHistory?patient=[id]

    例子:

    http://hapi.fhir.org/baseR4/FamilyMemberHistory?patient=697321&_pretty=true

    【讨论】:

    • 是的,分区搜索和搜索参数方法产生相同的输出。但是,我想尝试隔间搜索技术来获取 fhir 资源。现在,看来我必须坚持使用搜索参数方法。
    猜你喜欢
    • 2020-08-20
    • 2020-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多