Skip to main content

API for Cases

GET /cases

Performs search and retrieves a list of cases.

Required setting: Readable Projects

Request

This API allows filtering and sorting by query parameters. See Making Search Queries for more information.

filter (query parameter, optional)
Specifies the search criterion in JSON string. See Forming Filters and Available Filter Keys.
sort (query parameter, optional)
Sort order of search results.
limit (query parameter, optional)
Number of search results per page.
page (query parameter, optional)
Page number starting from 1.
Example
GET /api/cases HTTP/1.1

Available Filter Keys

Filter keys & How to use

Filter keys

projectId
ID of the project that the case to be searched belongs to. (string)
caseId
ID of the case to be searched. (string)
patientInfo.patientId
ID of the patient in the case. (string)
patientInfo.patientName
Name of the patient in the case. (string)
patientInfo.age
Age of the patient in the case. (number)
patientInfo.sex
Sex of the patient in the case, one of "M", "F" and "O". (string)
tags
Markers to accompany the case. (array)
createdAt
The date the case was created, in ISO format. (date)
updatedAt
The date the case was updated, in ISO format. (date)

How to use

This filter is used to search for cases of men aged 50.

{ "patientInfo.age": { "$gte": 50 } }

URL-encode the above filter and assign it to <filter>.

Example
GET /api/cases?filter=<filter> HTTP/1.1

Response

Returns an array of objects with the following properties.

caseId
ID of the case. (string)
projectId
ID of the project to which the case belongs. (string)
latestRevision
Last saved revision. (object)
tags
Markers to accompany the case. (array)
domains
Used to check access privileges of series belonging to the case. (array)
createdAt
The date the case was created, in ISO format. (date)
updatedAt
The date the case was updated, in ISO format. (date)
Example
HTTP/1.1 200
Content-Type: application/json

[
{
"caseId": "yjio7f9eiqc5jf3rzk782v91fx",
"projectId": "f0vv160g9b87k741qymsrq76qf",
"latestRevision": {
"creator": "creator@example.com",
"date": "2022-01-01T12:00:00.000Z",
"description": "Created",
"attributes": {},
"status": "draft",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": { "start": 1, "end": 100, "delta": 1 },
"labels": []
}
]
},
"tags": ["XXX", "YYY"],
"domains": [],
"createdAt": "2022-01-02T00:00:00.000Z",
"updatedAt": "2022-01-02T12:00:00.000Z"
},
{
"caseId": "wx0f99g4786k7acn6zd6m7a144",
"projectId": "f0vv160g9b87k741qymsrq76qf",
"latestRevision": {
"creator": "creator@example.com",
"date": "2022-01-01T12:00:00.000Z",
"description": "Created",
"attributes": {},
"status": "draft",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": { "start": 1, "end": 100, "delta": 1 },
"labels": []
}
]
},
"tags": ["AAA", "BBB", "CCC"],
"domains": [],
"createdAt": "2022-01-02T00:00:00.000Z",
"updatedAt": "2022-01-02T12:00:00.000Z"
}
]

GET /cases/:caseId

Returns information about the specified case.

Required setting: Readable Projects

Request

caseId (path parameter)
ID of the case to be searched.
Example
GET /api/cases/yjio7f9eiqc5jf3rzk782v91fx HTTP/1.1

Response

caseId
ID of the case. (string)
projectId
ID of the project to which the case belongs. (string)
revisions
Sequential data that is updated each time a case is saved. (array)
tags
Markers to accompany the case. (array)
domains
Used to check access privileges of series belonging to the case. (array)
createdAt
The date the case was created, in ISO format. (date)
updatedAt
The date the case was updated, in ISO format. (date)
Example
HTTP/1.1 200
Content-Type: application/json

{
"caseId": "yjio7f9eiqc5jf3rzk782v91fx",
"projectId": "f0vv160g9b87k741qymsrq76qf",
"revisions": [
{
"creator": "creator@example.com",
"date": "2022-01-01T12:00:00.000Z",
"description": "Created",
"attributes": {},
"status": "draft",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": { "start": 1, "end": 100, "delta": 1 },
"labels": []
}
]
}
],
"tags": ["XXX", "YYY"],
"domains": [],
"createdAt": "2022-01-02T00:00:00.000Z",
"updatedAt": "2022-01-02T12:00:00.000Z"
}

GET /cases/list/:myListId

Peforms search based on a my list ID.

Request

myListId (path parameter)
ID of the mylist to be searched.

See Query parameters for more information.

filter (query parameter, optional)
Specify search criteria.
sort (query parameter, optional)
Sort order of search results. The default is { addedToListAt: -1 }: this means sorted in descending order by date and time added to mylist.
limit (query parameter, optional)
Number of search results per page.
page (query parameter, optional)
Page number starting from 1.
Example
GET /api/cases/list/01gktktrqh63mdyfjpzzqey36n HTTP/1.1

Response

Returns an array of objects with the following properties.

caseId
ID of the case. (string)
projectId
ID of the project to which the case belongs. (string)
latestRevision
Last saved revision. (object)
tags
Markers to accompany the case. (array)
domains
Used to check access privileges of series belonging to the case. (array)
createdAt
The date the case was created, in ISO format. (date)
updatedAt
The date the case was updated, in ISO format. (date)
Example
HTTP/1.1 200
Content-Type: application/json

[
{
"caseId": "yjio7f9eiqc5jf3rzk782v91fx",
"projectId": "f0vv160g9b87k741qymsrq76qf",
"latestRevision": {
"creator": "creator@example.com",
"date": "2022-01-01T12:00:00.000Z",
"description": "Created",
"attributes": {},
"status": "draft",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": { "start": 1, "end": 100, "delta": 1 },
"labels": []
}
]
},
"tags": ["XXX", "YYY"],
"domains": [],
"createdAt": "2022-01-02T00:00:00.000Z",
"updatedAt": "2022-01-02T12:00:00.000Z"
},
{
"caseId": "wx0f99g4786k7acn6zd6m7a144",
"projectId": "f0vv160g9b87k741qymsrq76qf",
"latestRevision": {
"creator": "creator@example.com",
"date": "2022-01-01T12:00:00.000Z",
"description": "Created",
"attributes": {},
"status": "draft",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": { "start": 1, "end": 100, "delta": 1 },
"labels": []
}
]
},
"tags": ["AAA", "BBB", "CCC"],
"domains": [],
"createdAt": "2022-01-02T00:00:00.000Z",
"updatedAt": "2022-01-02T12:00:00.000Z"
}
]

POST /cases

Creates a new case.

Request

projectId
ID of the project where the case will be created. (string)
series
Series to be included in the case to be created. (array)
tags
Markers to accompany to be created case. (array)
Example
POST /api/cases HTTP/1.1
Content-Type: application/json

{
"projectId": "f0vv160g9b87k741qymsrq76qf",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": {
"start": 1,
"end": 100,
"delta": 1
}
}
],
"tags": ["tag1"]
}

Response

caseId
ID of the created case. (string)
Example
HTTP/1.1 201
Content-Type: application/json

{
"caseId": "g7ttvqzfz73zyqaz5fe0gvq81t"
}

POST /cases/:caseId/revision

Creates a new revision in the specified case.

Required setting: Writable Projects

Request

description
An arbitrary string that can be appended to the revision. (string)
attributes
Actual data of case attributes. (object)
status
Status of the revision. (string)
series
A list of series belonging to the case and their associated labels information. (array)
Example
POST /api/cases/yjio7f9eiqc5jf3rzk782v91fx/revision HTTP/1.1
Content-Type: application/json

{
"description": "Add something",
"attributes": {},
"status": "for-review",
"series": [
{
"seriesUid": "111.222.333.444.555",
"partialVolumeDescriptor": {
"start": 1,
"end": 636,
"delta": 1
},
"labels": [
{
"name": "Voxels",
"type": "voxel",
"data": {
"voxels": "7c9718fd6a128ade0906dc1da03754bf287bdbb8",
"origin": [
134,
189,
318
],
"size": [
177,
133,
1
],
"alpha": 1,
"color": "#ff0000"
},
"attributes": {}
}
]
}
]
}

Response

Example
HTTP/1.1 201

POST /cases/export-mhd

Creates a task to export the specified cases as MHD.

Required global privilege: Download volume as raw file Required setting: Readable Projects

Request

caseIds
The list of case IDs to export the MHD file. Available formats are array of caseIds: string[] or array of objects: {"caseId": string, "revisionIndex": number}[]. (array)
labelPackType (optional)
Export data format, either "combined" or "isolated". The default is "isolated" that generates one raw file per label. (string)
mhdLineEnding (optional)
Specifies the line ending to export the MHD file, either "crlf" or "lf". The default is "lf". (string)
compressionFormat (optional)
Specifies the compression format to export the MHD file, either "zip" or "tgz". The default is "tgz".(string)
Example
POST /api/cases/export-mhd HTTP/1.1
Content-Type: application/json

{
"caseIds": [
{ "caseId": "g7ttvqzfz73zyqaz5fe0gvq81t", "revisionIndex": 0 },
{ "caseId": "g7ttvqzfz73zyqaz5fe0gvq81t", "revisionIndex": 1 },
{ "caseId": "g7ttvqzfz73zyqaz5fe0gvq81t", "revisionIndex": 2 }
],
"labelPackType": "combined",
"mhdLineEnding": "crlf",
"compressionFormat": "zip"
}

Response

Example
HTTP/1.1 201
Content-Type: application/json

{
"taskId": "dmr09gt0mqnq09cchhyk5w4v56"
}

PUT /cases/:caseId/tags

Updates the tags of the specified case.

Required setting: Writable Projects

caution

This API replaces all tags. If you want to add a new tag, please also fill in the previous tags.

Request

Example
PUT /api/cases/yjio7f9eiqc5jf3rzk782v91fx/tags HTTP/1.1
Content-Type: application/json

["XXX", "YYY", "ZZZ"]

Response

Example
HTTP/1.1 204

PATCH /cases/tags

Manages the tags of multiple cases.

Required setting: Writable Projects

Request

operation
Specifies the operation method for the tags, one of "add", "remove" and "set". (string)
tags
The tags to operate. (string[])
caseIds
Case IDs of the operation target. (string[])
Example
PATCH /api/cases/tags HTTP/1.1

{
"operation": "add",
"caseIds": ["yjio7f9eiqc5jf3rzk782v91fx"],
"tags": ["ZZZ"]
}

Response

Example
HTTP/1.1 204

DELETE /cases/:caseId

Deletes the specified case.

Required setting: Moderate Projects

caution

This API deletes even the case created by other user.

info

If the specified case exists in the mylist of users (including yourself), this API throws an error.

Use force delete DELETE /api/cases/:caseId?force=1

Request

caseId (path parameter)
ID of the case to be deleted.
force (query parameter, optional)
By adding ?force=1 after the path parameter, even specified case in someone else's mylist (including your own) can be deleted. And the specified case in all users mylists are also deleted.
Example
DELETE /api/cases/yjio7f9eiqc5jf3rzk782v91fx HTTP/1.1

Response

Example
HTTP/1.1 204