Hello,
I having trouble understanding how
to use XML paths with the XNAT Subject API to include custom demographic
data in the output of the XNAT subject list API.
I have a custom variable set up for my subjects, called `keyid`, you can see it's configuration below:
It appears in the output of the
Single Subject Record API endpoint, eg:
$
curl -s -u admin:admin
http://xnat.snet-apps.local/xnat/data/projects/asclepiostestproject/subjects/demo-subject-000?format=json
| jq .
{
"items": [
{
"children": [
{
"field": "fields/field",
"items": [
{
"children": [],
"meta": {
"create_event_id": 23,
"xsi:type": "xnat:subjectData_field",
"isHistory": false,
"start_date": "Thu Oct 21 09:05:56 UTC 2021"
},
"data_fields": {
"field": "94df7b7e-a106-43cd-bd8d-767973ffc14b",
"name": "keyid",
"xnat_subjectData_field_id": 3
}
}
]
},
{
"field": "experiments/experiment",
"items": [
{
"children": [
{
"field": "scans/scan",
"items": [
{
"children": [],
"meta": {
"create_event_id": 27,
"xsi:type": "snet02:encPsgScanData",
"isHistory": false,
"start_date": "Thu Oct 21 09:24:57 UTC 2021"
},
"data_fields": {
"xnat_imagescandata_id": 2,
"keyid": "94df7b7e-a106-43cd-bd8d-767973ffc14b",
"project": "asclepiostestproject",
"ID": "514fd482-8fae-4f9d-80a3-1e6aed8cfd86",
"image_session_ID": "XNAT3_E00001",
"xnat_imageScanData_id": 2
}
}
]
}
],
"meta": {
"create_event_id": 26,
"xsi:type": "snet02:sleepResearchSessionData",
"isHistory": false,
"start_date": "Thu Oct 21 09:24:57 UTC 2021"
},
"data_fields": {
"date": "2022-09-10",
"subject_ID": "XNAT3_S00001",
"project": "asclepiostestproject",
"ID": "XNAT3_E00001",
"label": "211020211124",
"id": "XNAT3_E00001"
}
}
]
}
],
"meta": {
"create_event_id": 23,
"xsi:type": "xnat:subjectData",
"isHistory": false,
"start_date": "Thu Oct 21 09:05:56 UTC 2021"
},
"data_fields": {
"project": "asclepiostestproject",
"ID": "XNAT3_S00001",
"label": "demo-subject-000"
}
}
]
}
Is this actually possible with to do with the All Subjects In A Project API endpoint? If so how can I accomplish it?
I would really appreciate some advice.
Regards
,
James