问题描述
我正在使用Google Healthcare API并尝试按时区按日期搜索FHIR资源,如下例所示:
https://healthcare.googleapis.com/v1/projects/project-id/locations/us-central1/datasets/dataset/fhirstores/fhirstore/fhir/Appointment?date=2020-01-23T08:29:00+03:00
我收到此错误:
{
"issue": [
{
"code": "value","details": {
"text": "invalid_query"
},"diagnostics": "error parsing date \"2020-01-23T08:29:00 03:00\": invalid dateTime: 2020-01-23T08:29:00 03:00","severity": "error"
}
],"resourceType": "OperationOutcome"
}
Date searches on any type of date,time,or period. The date parameter format is yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm],and the same prefix modifiers used for number also apply here.
它应该可以工作,但是当时区信号是“ +”时。引发错误。 什么时候是“减号-”,例如:/ Appointment?date = 2020-01-23T08:29:00-03:00。可以。
我错过了什么吗?对我来说似乎是个虫子。
谢谢!
解决方法
看起来像是URL的转义问题-加号是URL中的特殊字符之一。
尝试日期= 2020-01-23T08:29:00%2B03:00,这在我尝试时有效。