这是我在 jmeter 中运行 http 请求后得到的 json 数据。
{
"entry": [
{
"search": {
"mode": "match"
},
"resource": {
"meta": {
"lastUpdated": "2018-10-29T08:37:53.351+00:00",
"versionId": "aa1e1cc3-8018-408e-a70a-4885004720fa",
"tag": [
{
"system": "http:\/\/hl7.org\/fhir\/v3\/ObservationValue",
"code": "SUBSETTED"
}
]
},
"name": [
{
"given": [
"Aaron697"
],
"use": "official",
"prefix": [
"Mr."
],
"family": "Abernathy524"
}
],
"id": "176b8fef-5a62-48da-b82e-4722843d9f2d",
"resourceType": "Patient"
},
"fullUrl": "http:\/\/localhost:4080\/Patient\/176b8fef-5a62-48da-b82e-4722843d9f2d"
},
{
"search": {
"mode": "match"
},
"resource": {
"meta": {
"lastUpdated": "2018-10-29T08:09:33.67+00:00",
"versionId": "c852310e-8894-45dd-a87c-9e449950caf4",
"tag": [
{
"system": "http:\/\/hl7.org\/fhir\/v3\/ObservationValue",
"code": "SUBSETTED"
}
]
},
"name": [
{
"given": [
"Aaron697"
],
"use": "official",
"prefix": [
"Mr."
],
"family": "Abernathy524"
}
],
"id": "8bbb3bb7-4e5b-48bd-82af-8463c4060de3",
"resourceType": "Patient"
},
"fullUrl": "http:\/\/localhost:4080\/Patient\/8bbb3bb7-4e5b-48bd-82af-8463c4060de3"
}
]
}
现在我必须将所有 id 和 name.use、name.given、name.family、name.prefix 提取到相应的 csv 文件中。例如:将 id 放入 id.csv 文件;name.given 到 name_given.csv 文件等... http 请求可以包含 n 个 id 和名称。怎么做?我尝试过使用 json 提取和正则表达式但失败了。