Mercurial > hg > orthanc-book
changeset 267:0a97b61ae021
updated openapi based on Chris McGee message on 2019-08-18
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 19 Aug 2019 08:35:48 +0200 |
parents | a9e34dc2635b |
children | 6d54614c6874 |
files | OpenAPI/orthanc-openapi.yaml |
diffstat | 1 files changed, 771 insertions(+), 196 deletions(-) [+] |
line wrap: on
line diff
--- a/OpenAPI/orthanc-openapi.yaml Fri Aug 16 15:28:16 2019 +0200 +++ b/OpenAPI/orthanc-openapi.yaml Mon Aug 19 08:35:48 2019 +0200 @@ -6,6 +6,203 @@ One of the major strengths of Orthanc lies in its built-in RESTful API, that can be used to drive Orthanc from external applications, independently of the programming language that is used to develop these applications. The REST API of Orthanc gives a full programmatic access to all the core features of Orthanc. Importantly, Orthanc Explorer (the embedded administrative interface of Orthanc) entirely resorts to this REST API for all its features. This implies that anything that can be done through Orthanc Explorer, can also be done through REST queries. servers: - url: 'https://demo.orthanc-server.com' +components: + schemas: + patient: + properties: + ID: + type: string + Studies: + type: array + items: + type: string + MainDicomTags: + type: object + properties: + OtherPatientIDs: + type: string + PatientBirthDate: + type: string + PatientName: + type: string + PatientSex: + type: string + ParentPatient: + type: string + Type: + type: string + enum: + - Patient + example: { + "ID" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", + "MainDicomTags" : { + "OtherPatientIDs" : "(null)", + "PatientBirthDate" : "0", + "PatientID" : "000000185", + "PatientName" : "Anonymous^Unknown", + "PatientSex" : "O" + }, + "Studies" : [ "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15" ], + "Type" : "Patient" +} + study: + properties: + ID: + type: string + Series: + type: array + items: + type: string + MainDicomTags: + type: object + properties: + AccesionNumber: + type: string + StudyDate: + type: string + StudyDescription: + type: string + StudyID: + type: string + StudyInstanceUID: + type: string + StudyTime: + type: string + ParentPatient: + type: string + Type: + type: string + enum: + - Study + example: { + "ID" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", + "MainDicomTags" : { + "AccessionNumber" : "(null)", + "StudyDate" : "20120716", + "StudyDescription" : "TestSUVce-TF", + "StudyID" : "23848", + "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40", + "StudyTime" : "170728" + }, + "ParentPatient" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", + "Series" : [ + "6821d761-31fb55a9-031ebecb-ba7f9aae-ffe4ddc0", + "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", + "7384c47e-6398f2a8-901846ef-da1e2e0b-6c50d598" + ], + "Type" : "Study" +} + series: + properties: + ID: + type: string + ExpectedNumberOfInstances: + type: number + Instances: + type: array + items: + type: string + MainDicomTags: + type: object + properties: + Manufacturer: + type: string + Modality: + type: string + NumberOfSlices: + type: string + ProtocolName: + type: string + SeriesDate: + type: string + SeriesDescription: + type: string + SeriesInstanceUID: + type: string + SeriesNumber: + type: string + SeriesTime: + type: string + StationName: + type: string + ParentStudy: + type: string + Type: + type: string + enum: + - Series + Status: + type: string + enum: + - Complete + example: { + "ExpectedNumberOfInstances" : 45, + "ID" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", + "Instances" : [ + "41bc3f74-360f9d10-6ae9ffa4-01ea2045-cbd457dd", + "1d3de868-6c4f0494-709fd140-7ccc4c94-a6daa3a8", + "1010f80b-161b71c0-897ec01b-c85cd206-e669a3ea", + "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4" + ], + "MainDicomTags" : { + "Manufacturer" : "Philips Medical Systems", + "Modality" : "PT", + "NumberOfSlices" : "45", + "ProtocolName" : "CHU/Body_PET/CT___50", + "SeriesDate" : "20120716", + "SeriesDescription" : "[WB_CTAC] Body", + "SeriesInstanceUID" : "1.3.46.670589.28.2.12.30.26407.37145.2.2516.0.1342458737", + "SeriesNumber" : "587370", + "SeriesTime" : "171121", + "StationName" : "r054-svr" + }, + "ParentStudy" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", + "Status" : "Complete", + "Type" : "Series" +} + instance: + properties: + FileSize: + type: number + FileUuid: + type: string + ID: + type: string + IndexInSeries: + type: number + MainDicomTags: + type: object + properties: + AcquisitionNumber: + type: string + ImageIndex: + type: string + ImagePositionPatient: + type: string + InstanceNumber: + type: string + SOPInstanceUID: + type: string + ParentSeries: + type: string + Type: + enum: + - Instance + example: { + "FileSize" : 35440, + "FileUuid" : "7976ad32-4d15-439b-8789-bf70f52200ec", + "ID" : "055bfbaf-2aae936c-82ed5a9a-9267f8b7-416a4000", + "IndexInSeries" : 59, + "MainDicomTags" : { + "AcquisitionNumber" : "2", + "ImageIndex" : "59", + "ImagePositionPatient" : "-134.74816\\-272.14441\\-712.764", + "InstanceNumber" : "59", + "SOPInstanceUID" : "1.3.12.2.1107.5.1.4.36085.2.0.3752288429331748" + }, + "ParentSeries" : "318603c5-03e8cffc-a82b6ee1-3ccd3c1e-18d7e3bb", + "Type" : "Instance" +} paths: /instances: post: @@ -36,6 +233,17 @@ get: tags: [Instances] description: Get all DICOM instances ID's in Orthanc + parameters: + - name: limit + in: query + schema: + type: number + description: Limit the number of results to the specified. number + - name: since + in: query + schema: + type: number + description: Show only the resources since the index provided. responses: 200: description: Array of all instances ID's @@ -65,48 +273,7 @@ content: application/json: schema: - properties: - FileSize: - type: number - FileUuid: - type: string - ID: - type: string - IndexInSeries: - type: number - MainDicomTags: - type: object - properties: - AcquisitionNumber: - type: string - ImageIndex: - type: string - ImagePositionPatient: - type: string - InstanceNumber: - type: string - SOPInstanceUID: - type: string - ParentSeries: - type: string - Type: - enum: - - Instance - example: { - "FileSize" : 35440, - "FileUuid" : "7976ad32-4d15-439b-8789-bf70f52200ec", - "ID" : "055bfbaf-2aae936c-82ed5a9a-9267f8b7-416a4000", - "IndexInSeries" : 59, - "MainDicomTags" : { - "AcquisitionNumber" : "2", - "ImageIndex" : "59", - "ImagePositionPatient" : "-134.74816\\-272.14441\\-712.764", - "InstanceNumber" : "59", - "SOPInstanceUID" : "1.3.12.2.1107.5.1.4.36085.2.0.3752288429331748" - }, - "ParentSeries" : "318603c5-03e8cffc-a82b6ee1-3ccd3c1e-18d7e3bb", - "Type" : "Instance" -} + $ref: "#/components/schemas/instance" delete: tags : [Instances] description: Delete an instance @@ -180,6 +347,18 @@ in: path schema: type: string + - name: simplify + required: false + description: Show more user-friendly tags like in /simplified-tags + in: query + schema: + type: boolean + - name: short + required: false + description: Shorten the values so that they are not separate JSON objects with the user-friendly description of the tag and the type. Instead, values are given as direct values to the tags. + in: query + schema: + type: boolean responses: 200: description: DICOM tags and values @@ -225,6 +404,72 @@ "Value" : "20040304" } } + /instances/{Id}/header: + get: + tags: [Instances] + description: Get the detailed header tags for the DICOM instance. + parameters: + - name: Id + required: true + in: path + schema: + type: string + - name: simplify + required: false + description: Show more user-friendly tags like in /simplified-tags + in: query + schema: + type: boolean + - name: short + required: false + description: Shorten the values so that they are not separate JSON objects with the user-friendly description of the tag and the type. Instead, values are given as direct values to the tags. + in: query + schema: + type: boolean + responses: + 200: + description: DICOM tags and values + content: + application/json: + schema: + type: object + example: { + "0002,0000" : { + "Name" : "FileMetaInformationGroupLength", + "Type" : "String", + "Value" : "222" + }, + "0002,0002" : { + "Name" : "MediaStorageSOPClassUID", + "Type" : "String", + "Value" : "1.2.840.10008.5.1.4.1.1.128" + }, + "0002,0003" : { + "Name" : "MediaStorageSOPInstanceUID", + "Type" : "String", + "Value" : "1.3.12.2.1107.5.1.4.36085.2.0.3752288429331748" + }, + "0002,0010" : { + "Name" : "TransferSyntaxUID", + "Type" : "String", + "Value" : "1.2.840.10008.1.2.1" + }, + "0002,0012" : { + "Name" : "ImplementationClassUID", + "Type" : "String", + "Value" : "1.2.826.0.1.3680043.2.1143.107.104.103.115.2.2.4" + }, + "0002,0013" : { + "Name" : "ImplementationVersionName", + "Type" : "String", + "Value" : "GDCM 2.2.4" + }, + "0002,0016" : { + "Name" : "SourceApplicationEntityTitle", + "Type" : "String", + "Value" : "gdcmconv" + } +} /instances/{Id}/content/{Tag}: get: tags: [Instances] @@ -292,7 +537,7 @@ /instances/{Id}/{PixelFormat}: get: tags: [Instances] - description: Download a preview image of the DICOM instance. + description: Download an image of the DICOM instance in the specified format. parameters: - name: Id required: true @@ -308,6 +553,9 @@ - image-uint8 - image-uint16 - image-int16 + - matlab + - raw + - raw.gz - name: Accept required: true in: header @@ -319,11 +567,13 @@ - image/x-portable-arbitrarymap responses: 200: - description: DICOM preview + description: Image content: image/png: {} image/jpg: {} image/x-portable-arbitrarymap: {} + application/octet-stream: {} + text/plain: {} /instances/{Id}/pdf: get: tags: [Instances] @@ -345,6 +595,17 @@ get: tags: [Series] description: Get all DICOM series ID's in Orthanc + parameters: + - name: limit + in: query + schema: + type: number + description: Limit the number of results to the specified. number + - name: since + in: query + schema: + type: number + description: Show only the resources since the index provided. responses: 200: description: Array of all series ID's @@ -374,73 +635,7 @@ content: application/json: schema: - properties: - ID: - type: string - ExpectedNumberOfInstances: - type: number - Instances: - type: array - items: - type: string - MainDicomTags: - type: object - properties: - Manufacturer: - type: string - Modality: - type: string - NumberOfSlices: - type: string - ProtocolName: - type: string - SeriesDate: - type: string - SeriesDescription: - type: string - SeriesInstanceUID: - type: string - SeriesNumber: - type: string - SeriesTime: - type: string - StationName: - type: string - ParentStudy: - type: string - Type: - type: string - enum: - - Series - Status: - type: string - enum: - - Complete - example: { - "ExpectedNumberOfInstances" : 45, - "ID" : "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", - "Instances" : [ - "41bc3f74-360f9d10-6ae9ffa4-01ea2045-cbd457dd", - "1d3de868-6c4f0494-709fd140-7ccc4c94-a6daa3a8", - "1010f80b-161b71c0-897ec01b-c85cd206-e669a3ea", - "e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4" - ], - "MainDicomTags" : { - "Manufacturer" : "Philips Medical Systems", - "Modality" : "PT", - "NumberOfSlices" : "45", - "ProtocolName" : "CHU/Body_PET/CT___50", - "SeriesDate" : "20120716", - "SeriesDescription" : "[WB_CTAC] Body", - "SeriesInstanceUID" : "1.3.46.670589.28.2.12.30.26407.37145.2.2516.0.1342458737", - "SeriesNumber" : "587370", - "SeriesTime" : "171121", - "StationName" : "r054-svr" - }, - "ParentStudy" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", - "Status" : "Complete", - "Type" : "Series" -} + $ref: "#/components/schemas/series" delete: tags : [Series] description: Delete a series @@ -453,10 +648,41 @@ responses: 200: description: Success + /series/{Id}/instances: + get: + tags: [Series] + description: Get the instances for a series + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Orthanc instances + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/instance" + /studies: get: tags: [Studies] description: Get all DICOM studies ID's in Orthanc + parameters: + - name: limit + in: query + schema: + type: number + description: Limit the number of results to the specified. number + - name: since + in: query + schema: + type: number + description: Show only the resources since the index provided. responses: 200: description: Array of all study ID's @@ -486,52 +712,7 @@ content: application/json: schema: - properties: - ID: - type: string - Series: - type: array - items: - type: string - MainDicomTags: - type: object - properties: - AccesionNumber: - type: string - StudyDate: - type: string - StudyDescription: - type: string - StudyID: - type: string - StudyInstanceUID: - type: string - StudyTime: - type: string - ParentPatient: - type: string - Type: - type: string - enum: - - Study - example: { - "ID" : "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15", - "MainDicomTags" : { - "AccessionNumber" : "(null)", - "StudyDate" : "20120716", - "StudyDescription" : "TestSUVce-TF", - "StudyID" : "23848", - "StudyInstanceUID" : "1.2.840.113704.1.111.7016.1342451220.40", - "StudyTime" : "170728" - }, - "ParentPatient" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", - "Series" : [ - "6821d761-31fb55a9-031ebecb-ba7f9aae-ffe4ddc0", - "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35", - "7384c47e-6398f2a8-901846ef-da1e2e0b-6c50d598" - ], - "Type" : "Study" -} + $ref: "#/components/schemas/study" delete: tags : [Studies] description: Delete a study @@ -544,10 +725,60 @@ responses: 200: description: Success + /studies/{Id}/series: + get: + tags: [Studies] + description: Get the series for a study + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Orthanc series + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/series" + /studies/{Id}/instances: + get: + tags: [Studies] + description: Get the instances for a study + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Orthanc instances + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/instance" + /patients: get: tags: [Patients] description: Get all DICOM patient ID's in Orthanc + parameters: + - name: limit + in: query + schema: + type: number + description: Limit the number of results to the specified. number + - name: since + in: query + schema: + type: number + description: Show only the resources since the index provided. responses: 200: description: Array of all patient ID's @@ -577,42 +808,7 @@ content: application/json: schema: - properties: - ID: - type: string - Studies: - type: array - items: - type: string - MainDicomTags: - type: object - properties: - OtherPatientIDs: - type: string - PatientBirthDate: - type: string - PatientName: - type: string - PatientSex: - type: string - ParentPatient: - type: string - Type: - type: string - enum: - - Patient - example: { - "ID" : "07a6ec1c-1be5920b-18ef5358-d24441f3-10e926ea", - "MainDicomTags" : { - "OtherPatientIDs" : "(null)", - "PatientBirthDate" : "0", - "PatientID" : "000000185", - "PatientName" : "Anonymous^Unknown", - "PatientSex" : "O" - }, - "Studies" : [ "9ad2b0da-a406c43c-6e0df76d-1204b86f-78d12c15" ], - "Type" : "Patient" -} + $ref: "#/components/schemas/patient" delete: tags : [Patients] description: Delete a patient @@ -625,6 +821,63 @@ responses: 200: description: Success + /patients/{Id}/studies: + get: + tags: [Patients] + description: Get the studies for a patient + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/study" + /patients/{Id}/series: + get: + tags: [Patients] + description: Get the series for a patient + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Orthanc series + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/series" + /patients/{Id}/instances: + get: + tags: [Patients] + description: Get the instances for a patient + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Orthanc instances + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/instance" /peers: get: @@ -943,6 +1196,9 @@ - Study - Series - Instance + Expand: + type: boolean + description: Returns an array of resources instead of just ID's. Limit: type: number Query: @@ -960,9 +1216,22 @@ content: application/json: schema: - type: array - items: - type: string + oneOf: + - type: array + items: + type: string + - type: array + items: + $ref: "#/components/schemas/instance" + - type: array + items: + $ref: "#/components/schemas/series" + - type: array + items: + $ref: "#/components/schemas/study" + - type: array + items: + $ref: "#/components/schemas/patient" example: [ "6821d761-31fb55a9-031ebecb-ba7f9aae-ffe4ddc0", "2cc6336f-2d4ae733-537b3ca3-e98184b1-ba494b35" ] /changes: get: @@ -1601,6 +1870,200 @@ responses: 200: description: Success + + /instances/{Id}/frames: + get: + tags: [Frames] + description: Get the list of frames for a DICOM instance. + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + items: + type: number + example: [0, 75] + /instances/{Id}/frames/{Idx}/{PixelFormat}: + get: + tags: [Frames] + description: Get the image data of a frame within an instance. + parameters: + - name: Id + required: true + in: path + schema: + type: string + - name: Idx + required: true + in: path + schema: + type: number + - name: PixelFormat + required: true + in: path + schema: + type: string + enum: + - image-uint8 + - image-uint16 + - image-int16 + - matlab + - raw + - raw.gz + - name: Accept + required: true + in: header + schema: + type: string + enum: + - image/png + - image/jpeg + - image/x-portable-arbitrarymap + responses: + 200: + description: Image + content: + image/png: {} + image/jpg: {} + image/x-portable-arbitrarymap: {} + application/octet-stream: {} + text/plain: {} + /instances/{Id}/frames/{Idx}/preview: + get: + tags: [Frames] + description: Download a preview image of the frame of a DICOM instance. + parameters: + - name: Id + required: true + in: path + schema: + type: string + - name: Idx + required: true + in: path + schema: + type: number + - name: Accept + description: Default is image/png + required: false + in: header + schema: + type: string + enum: + - image/png + - image/jpeg + responses: + 200: + description: DICOM preview + content: + image/png: {} + image/jpg: {} + + /tools/lookup: + post: + tags: [Lookup] + description: Lookup resources by their UID + requestBody: + content: + text/plain: + example: "1.2.826.0.1.3680043.8.1055.1.20111103111148288.81713267.86905863" + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + items: + properties: + ID: + type: string + Path: + type: string + Type: + type: string + enum: + - Patient + - Study + - Series + - Instance + example: { + "ID" : "53a15d3a-ec236c65-5958be97-e31b8725-5f55ca69", + "Path" : "/instances/53a15d3a-ec236c65-5958be97-e31b8725-5f55ca69", + "Type" : "Instance" + } + + /tools/create-archive: + post: + tags: [Archive] + description: Create an archive (zip) of the specified resource ID's as a collection of DICOM files. + requestBody: + content: + application/json: + schema: + oneOf: + - type: array + items: + type: string + - properties: + Synchronous: + type: boolean + default: true + description: If synchronous is set to false then the archive is created through a job. The job ID and path will be given in the response. Once that job is complete then you can access the archive from the /jobs/{Id}/archive endpoint. + Resources: + type: array + items: + type: string + example: [ + 'ca29faea-b6a0e17f-067743a1-8b778011-a48b2a17', + '0a9b3153-2512774b-2d9580de-1fc3dcf6-3bd83918', + '1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0' + ] + responses: + 200: + description: Success + content: + application/zip: {} + application/json: + schema: + properties: + ID: + type: string + Path: + type: string + example: { + "ID" : "6c5bab22-79ae-4eca-b0af-d979431801bd", + "Path" : "/jobs/6c5bab22-79ae-4eca-b0af-d979431801bd" +} + + /tools/default-encoding: + get: + tags: [I18N] + description: Get the default text encoding for the Orthanc server. + responses: + 200: + description: Success + content: + text/plain: + example: Latin1 + post: + tags: [I18N] + description: Set the default text encoding for the Orthanc server. + requestBody: + content: + text/plain: + example: "Latin1" + responses: + 200: + description: Success /jobs: get: @@ -1691,6 +2154,21 @@ "Timestamp" : "20190306T095408.556082", "Type" : "Archive" } + /jobs/{Id}/archive: + get: + tags: [Jobs] + description: Get the archive generated by the job. Note that the job must be an archive job and it must be complete. + parameters: + - name: Id + required: true + in: path + schema: + type: string + responses: + 200: + description: Success + content: + application/zip: {} /jobs/{Id}/cancel: post: tags: [Jobs] @@ -1818,3 +2296,100 @@ responses: 200: description: Success + + /system: + get: + tags: [System] + description: Get system information for the Orthanc server. + responses: + 200: + description: Success + content: + application/json: + schema: + properties: + ApiVersion: + type: number + DatabaseBackendPlugin: + type: string + DatabaseVersion: + type: number + DicomAet: + type: string + DicomPort: + type: number + HttpPort: + type: number + Name: + type: string + PluginsEnabled: + type: boolean + StorageAreaPlugin: + type: string + Version: + type: string + example: { + "ApiVersion" : 3, + "DatabaseBackendPlugin" : null, + "DatabaseVersion" : 6, + "DicomAet" : "ORTHANC", + "DicomPort" : 4242, + "HttpPort" : 8042, + "Name" : "Orthanc Demo", + "PluginsEnabled" : true, + "StorageAreaPlugin" : null, + "Version" : "1.5.7" +} + + /statistics: + get: + tags: [Statistics] + description: Get statistics about the data stored in Orthanc. + responses: + 200: + description: Success + content: + application/json: + schema: + properties: + CountInstances: + type: number + CountPatients: + type: number + CountSeries: + type: number + CountStudies: + type: number + TotalDiskSize: + type: string + TotalDiskSizeMB: + type: number + TotalUncompressedSize: + type: string + TotalUncompressedSizeMB: + type: number + example: { + "CountInstances" : 2352, + "CountPatients" : 7, + "CountSeries" : 23, + "CountStudies" : 7, + "TotalDiskSize" : "913213057", + "TotalDiskSizeMB" : 870, + "TotalUncompressedSize" : "913213057", + "TotalUncompressedSizeMB" : 870 +} + + /tools/execute-script: + post: + tags: [Lua] + description: Execute the posted Lua script + requestBody: + content: + text/plain: + example: print(42) + responses: + 200: + description: Script executed + content: + text/plain: + example: "42" \ No newline at end of file