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

如何使用Google Healthcare API Node.js按起止日期过滤Appointment

解决Google Healthcare API中Appointment日期范围过滤的重复参数问题

在Google Healthcare Node.js客户端中,重复的查询参数可以通过数组形式传递,客户端会自动将数组元素转换为多个同名的URL查询参数,完美匹配你需要的date=ge2023-02-03T04:00:00.000Z&date=le2023-02-05T04:00:00.000Z格式。

修改后的代码如下:

const parent = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`;

const params = {
   parent,
   resourceType,
   date: [`ge${start}`, `le${end}`] // 用数组传递多个date过滤条件
};

const resource = await healthcare.projects.locations.datasets.fhirStores.fhir.search(params);

这样设置后,客户端会自动生成包含两个date参数的查询字符串,实现日期范围(大于等于起始时间且小于等于结束时间)的过滤逻辑。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.01 16:50:18