You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过HL7 FHIR RESTful API获取资源类型列表及对应端点

获取FHIR服务器资源类型列表及对应API端点的方法

针对你使用的https://r4.smarthealthit.org这个R4版本FHIR服务器,可通过以下方式实现需求:

1. 读取服务器元数据(Metadata)

FHIR规范要求服务器暴露元数据端点,请求该端点即可获取服务器支持的所有资源类型信息:

  • 发送GET请求到:https://r4.smarthealthit.org/metadata
  • 返回的结构中,rest[0].resource数组包含所有支持的资源类型(如Patient、Condition、Immunization),每个资源对象的type字段为资源类型名,对应API端点为服务器地址拼接类型名,例如https://r4.smarthealthit.org/Patient

2. 直接构造标准资源端点

FHIR API端点遵循固定格式:{服务器地址}/{资源类型名},基于FHIR R4的标准资源类型,可直接构造常用端点:

  • Patient:https://r4.smarthealthit.org/Patient
  • Condition:https://r4.smarthealthit.org/Condition
  • Immunization:https://r4.smarthealthit.org/Immunization

3. 验证资源是否被服务器支持

若不确定某资源类型是否可用,可发送HEAD请求到对应端点,比如HEAD https://r4.smarthealthit.org/Medication,返回200状态码表示支持,404则表示不支持。

内容的提问来源于stack exchange,提问作者RehmanSarwar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 17:14:53