【发布时间】:2021-12-18 06:09:41
【问题描述】:
我是 JsonPath 的新手,正在使用 Java 端口 https://github.com/json-path/JsonPath。
我有一个看起来像这样的 JSON 对象(实际上有很多条目,但为简洁起见,我删除了额外的条目)。
{
"entry": [{
"fullUrl": "urn:uuid:42627ef0-ea02-4323-8059-c8dfb6125314",
"resource": {
"resourceType": "Patient",
"id": "42627ef0-ea02-4323-8059-c8dfb6125314",
"meta": {
"profile": [
"http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-patient",
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Generated by <a href=\"https://github.com/synthetichealth/synthea\">Synthea</a>.Version identifier: v2.5.0-340-gabc9fc4a\n . Person seed: -7528621318134299240 Population seed: 1586172373839</div>"
}
}
}]
}
我正在尝试在配置文件数组中查找包含特定 URI 的条目。我似乎无法获得正确的语法以使其正常工作,并且在这一点上有点难过。
这是我迄今为止尝试过的,但没有成功。
$..entry[?(@.resource.meta[?(@.profile.indexOf('http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient') > -1)])]
任何指针都非常感谢!
【问题讨论】:
标签: jsonpath