在FHIR REST API中,有一些标准参数可用于“搜索”端点中的所有资源。
我需要在搜索操作中使用'_profile‘参数:https://www.hl7.org/fhir/search.html#profile
关于实现搜索操作(https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_search.html)的HAPI FHIR文档有很多示例,但没有提到适用于所有资源的参数,比如'_profile‘。
我还检查了他们的在线测试服务器(http://hapi.fhir.org/resource?serverId=home_r4&pretty=true&resource=Observation),但我找不到一种方法来指定那里的'_profile‘,看看它是如何工作的。
在代码级别,我想要做的是:
@Search
public List<Observation> getObservationsByProfile(??? profile)
{
...
if (profile == '...')
{
...
}
else
{
...
}
...
}我不知道如何指定参数的注释和类型,所以它绑定到请求的URL的'_profile‘参数中提供的值。
有没有我可以参考的示例代码或文档?谢谢。
发布于 2020-06-25 06:42:00
使用"_profile“参数进行搜索的方法如下:
@Search
public List<Observation> getObservationsByProfile(@OptionalParam(name="_profile) UriParam profile)
{
...
if (profile == '...')
{
...
}
else
{
...
}
...
}尽管_xxx参数适用于所有的FHIR资源,但HAPI FHIR文档中并没有包含如何在搜索中使用这些资源的示例。希望这篇文章能为其他人提供参考。
https://stackoverflow.com/questions/62522131
复制相似问题