swagger: "2.0"
schemes:
  - http
host: slicebox.local
basePath: /api
info:
  contact:
    url: http://github.org/slicebox/slicebox
  description: Slicebox - safe sharing of medical images
  license:
    name: Apache 2.0 License
    url: http://opensource.org/licenses/Apache-2.0
  title: Slicebox API
  version: "2.0"
  x-apisguru-categories:
    - collaboration
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://avatars0.githubusercontent.com/u/12760279?s=200&v=4
  x-origin:
    - format: swagger
      url: https://slicebox.github.io/slicebox-api/swagger.yaml
      version: "2.0"
  x-providerName: slicebox.local
consumes:
  - application/json
  - application/octet-stream
  - multipart/form-data
produces:
  - application/json
  - application/octet-stream
tags:
  - description: General routes applicable to multiple aspects of the slicebox API and to the slicebox system
    name: General
  - description: Methods for handling structured importing of DICOM files into slicebox
    name: Import
  - description: Methods for handling DICOM meta data (attributes)
    name: Meta Data
  - description: Methods concerning images and datasets
    name: Images
  - description: Methods concerning anonymization and de-anonymization of images and the associated anonymization data
    name: Anonymization
  - description: Methods for handling box-to-box connections and issuing box commands
    name: Boxes
  - description: Methods for handling box-to-box transactions of images (primarily for internal slicebox use)
    name: Transactions
  - description: Methods for handling DICOM storage class providers for receiving images from PACS
    name: SCPs
  - description: Methods for handling DICOM storage class users for sending images to PACS
    name: SCUs
  - description: Methods for handling watch directories for importing images stored as files
    name: Directories
  - description: Methods for handling forwarding rules for automatically forwarding image data from sources to destinations.
    name: Forwarding
  - description: Methods for handling filtering of DICOM attributes on incoming objects.
    name: Filtering
  - description: Methods for defining and handling series types
    name: Series Types
  - description: Methods for handling slicebox system log messages
    name: Logs
  - description: Methods for handling users
    name: Users
paths:
  /anonymization/anonymize:
    post:
      description: anonymize the images corresponding to the supplied list of image IDs (each paired with a list of DICOM tag translation). This route corresponds to repeated use of the route /images/{id}/anonymize.
      parameters:
        - description: parameters of anonymization key query
          in: body
          name: query
          required: true
          schema:
            items:
              $ref: "#/definitions/imageTagValues"
            type: array
      responses:
        "200":
          description: the list of newly created anonymous images
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
      tags:
        - Anonymization
  /anonymization/keys:
    get:
      description: get a list of anonymization keys, each specifying how vital DICOM attributes have been anonymized for a particular image
      parameters:
        - default: 0
          description: start index of returned slice of anonymization keys
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of anonymization keys
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: property to order results by
          in: query
          name: orderby
          required: false
          type: string
        - default: true
          description: order result ascendingly if true, descendingly otherwise
          in: query
          name: orderascending
          required: false
          type: boolean
        - description: filter the results by matching substrings of properties against this value
          in: query
          name: filter
          required: false
          type: string
      responses:
        "200":
          description: anonymization keys, one per DICOM image
          schema:
            items:
              $ref: "#/definitions/anonymizationKey"
            type: array
      tags:
        - Anonymization
  /anonymization/keys/export/csv:
    get:
      description: export all anonymization keys as a csv file
      responses:
        "200":
          description: all anonymization keys as a csv file
          schema:
            type: string
      tags:
        - Anonymization
  /anonymization/keys/query:
    post:
      description: submit a query for anonymization keys
      parameters:
        - description: parameters of anonymization key query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/anonymizationKeyQuery"
      responses:
        "200":
          description: anonymization keys
          schema:
            items:
              $ref: "#/definitions/anonymizationKey"
            type: array
      tags:
        - Anonymization
  "/anonymization/keys/{id}":
    delete:
      description: delete an anonymization key that is no longer of interest
      parameters:
        - description: ID of anonymization key
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: anonymization key deleted
      tags:
        - Anonymization
    get:
      description: get the anonymization key with the supplied ID
      parameters:
        - description: ID of anonymization key
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: anonymization key for the supplied ID
          schema:
            $ref: "#/definitions/anonymizationKey"
        "404":
          description: if no anonymization key could be found for the supplied ID
      tags:
        - Anonymization
  "/anonymization/keys/{id}/keyvalues":
    get:
      description: get pointers to the images corresponding to the anonymization key with the supplied ID
      parameters:
        - description: ID of anonymization key
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: an array of anonymization key-value pairs corresponding to the anonymization key for the supplied ID
          schema:
            items:
              $ref: "#/definitions/anonymizationKeyValue"
            type: array
        "404":
          description: if no anonymization key could be found for the supplied ID
      tags:
        - Anonymization
  /anonymization/options:
    get:
      description: list all supported anonymization options defining an anonymization profile
      responses:
        "200":
          description: supported anonymization options
          schema:
            items:
              $ref: "#/definitions/confidentialityOption"
            type: array
      tags:
        - Anonymization
  /boxes:
    get:
      description: get a list of box connections
      parameters:
        - default: 0
          description: start index of returned slice of boxes
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of boxes
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: box connections
          schema:
            items:
              $ref: "#/definitions/box"
            type: array
      tags:
        - Boxes
  /boxes/connect:
    post:
      description: connect to another box using a received URL. Used to connect to a public box.
      parameters:
        - description: remote box to connect with
          in: body
          name: remoteBox
          required: true
          schema:
            $ref: "#/definitions/remoteBox"
      responses:
        "201":
          description: connected box
          schema:
            $ref: "#/definitions/box"
      tags:
        - Boxes
  /boxes/createconnection:
    post:
      description: create a new box connection where the supplied entity holds the remote box name. Used by publicly available boxes.
      parameters:
        - description: name of box to connect (and send URL) to
          in: body
          name: remoteBoxConnectionData
          required: true
          schema:
            $ref: "#/definitions/remoteBoxConnectionData"
      responses:
        "201":
          description: remote box of the connection
          schema:
            $ref: "#/definitions/box"
      tags:
        - Boxes
  /boxes/incoming:
    get:
      description: get incoming transactions (finished, currently receiving, waiting or failed)
      parameters:
        - default: 0
          description: start index of returned slice of transactions
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of transactions
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: incoming transactions, sorted from most to least recently updated
          schema:
            items:
              $ref: "#/definitions/incomingTransaction"
            type: array
      tags:
        - Boxes
  "/boxes/incoming/{id}":
    delete:
      description: delete an incoming transaction. If a currently active transaction is deleted, a new transaction with the remainder of the images is created when receiving the next incoming image.
      parameters:
        - description: ID of incoming transaction
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: incoming transaction deleted
      tags:
        - Boxes
  "/boxes/incoming/{id}/images":
    get:
      description: get the received images corresponding to the incoming transaction with the supplied ID
      parameters:
        - description: ID of incoming transaction
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: images received corresponding to the specified incoming transaction
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
        "404":
          description: incoming transaction not found (invalid ID)
      tags:
        - Boxes
  /boxes/outgoing:
    get:
      description: get outgoing transactions (finished, currently sending, waiting or failed)
      parameters:
        - default: 0
          description: start index of returned slice of transactions
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of transactions
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: outgoing transactions, finished, sending, waiting or failed
          schema:
            items:
              $ref: "#/definitions/outgoingTransaction"
            type: array
      tags:
        - Boxes
  "/boxes/outgoing/{id}":
    delete:
      description: delete an outgoing transaction. This will stop ongoing transactions.
      parameters:
        - description: ID of outgoing transaction
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: outgoing transaction deleted
      tags:
        - Boxes
  "/boxes/outgoing/{id}/images":
    get:
      description: get the sent images corresponding to the outgoing transaction with the supplied ID
      parameters:
        - description: ID of outgoing transaction
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: images sent corresponding to the specified outgoing transaction
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
        "404":
          description: outgoing transaction not found (invalid ID)
      tags:
        - Boxes
  "/boxes/{id}":
    delete:
      description: Delete the remote box with the supplied ID
      parameters:
        - description: ID of box to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: box deleted
      tags:
        - Boxes
  "/boxes/{id}/send":
    post:
      description: send images corresponding to the supplied image ids to the remote box with the supplied ID
      parameters:
        - description: ID of box to send images to
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: specification of which images to send and list of DICOM attribute values to use in anonymized datasets
          in: body
          name: sequence of image tag values
          required: true
          schema:
            $ref: "#/definitions/bulkAnonymizationData"
      responses:
        "201":
          description: images sent
        "404":
          description: box not found (invalid ID)
      tags:
        - Boxes
  /destinations:
    get:
      description: Returns a list of currently available destinations. Possible destinations are box - sending data to a remote box, and scu - sending data a receiving SCP.
      responses:
        "200":
          description: currently available destinations
          schema:
            items:
              $ref: "#/definitions/destination"
            type: array
      tags:
        - General
  /directorywatches:
    get:
      description: get a list of watch directories. Each watch directory and its sub-directories are watched for incoming DICOM files, which are read and imported into slicebox.
      parameters:
        - default: 0
          description: start index of returned slice of watched directories
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of watched directories
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of watched directories
          schema:
            items:
              $ref: "#/definitions/watchedDirectory"
            type: array
      tags:
        - Directories
    post:
      description: add a new directory to watch for incoming DICOM files
      parameters:
        - description: directory to setup a watch for. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: watchedDirectory
          schema:
            $ref: "#/definitions/watchedDirectory"
      responses:
        "201":
          description: the directory now being watched
          schema:
            $ref: "#/definitions/watchedDirectory"
      tags:
        - Directories
  "/directorywatches/{id}":
    delete:
      description: stop watching and remove the directory corresponding to the supplied ID
      parameters:
        - description: id of directory to stop watching
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: directory watch removed
      tags:
        - Directories
  /filtering/associations:
    get:
      description: Get a list of source to filter associations.
      parameters:
        - default: 0
          description: start index of returned slice of source <-> filter associations
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of source <-> filter associations
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of source <-> filter associations
          schema:
            items:
              $ref: "#/definitions/sourceTagFilter"
            type: array
      tags:
        - Filtering
    post:
      description: Inserts or updates a source <-> filter associations. If the specified Source already  has an association this is updated, otherwise a new is inserted.
      parameters:
        - description: Source to Filter association
          in: body
          name: sourcetagfilter
          required: true
          schema:
            $ref: "#/definitions/sourceTagFilter"
      responses:
        "201":
          description: Upserted source <-> filter association
      tags:
        - Filtering
  "/filtering/associations/{id}":
    delete:
      description: remove the source <-> filter association corresponding to the supplied ID
      parameters:
        - description: id of source <-> filter association to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: source <-> filter association removed
      tags:
        - Filtering
  /filtering/filters:
    get:
      description: List defined filters
      parameters:
        - default: 0
          description: start index of returned slice of filters
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of filters
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of filters
          schema:
            items:
              $ref: "#/definitions/filter"
            type: array
      tags:
        - Filtering
    post:
      description: Inserts or updates a filter. If a filter with same name as supplied filter exists this filter is updated, otherwise a new filter is inserted.
      parameters:
        - description: Filter
          in: body
          name: tagFilter
          required: true
          schema:
            $ref: "#/definitions/filter"
      responses:
        "201":
          description: Filter upserted
      tags:
        - Filtering
  "/filtering/filters/{id}":
    delete:
      description: remove the filter corresponding to the supplied ID
      parameters:
        - description: id of filter to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: Filter removed
      tags:
        - Filtering
  "/filtering/filters/{id}/tagpaths":
    get:
      description: List tagpaths for the selected filter
      parameters:
        - description: id of filter
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: the list of tagpaths
          schema:
            items:
              $ref: "#/definitions/tagPathTag"
            type: array
      tags:
        - Filtering
    post:
      description: add a tagpath to a filter
      parameters:
        - description: id of filter to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: id of filter to remove
          in: body
          name: tagpath
          required: true
          schema:
            $ref: "#/definitions/tagPathTag"
      responses:
        "201":
          description: TagPath added
      tags:
        - Filtering
  "/filtering/filters/{id}/tagpaths/{tagpathid}":
    delete:
      description: remove the tagpath corresponding to the supplied ID
      parameters:
        - description: id of filter
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: id of TagPath to remove
          format: int64
          in: path
          name: tagpathid
          required: true
          type: integer
      responses:
        "204":
          description: TagPath removed
      tags:
        - Filtering
  "/forwarding/rule/{id}":
    delete:
      description: remove the forwarding rule corresponding to the supplied ID
      parameters:
        - description: id of forwarding rule to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: forwarding rule removed
      tags:
        - Forwarding
  /forwarding/rules:
    get:
      description: get a list of all forwarding rules. A forwarding rule specifies the automatic forwarding of images from a source (SCP, BOX, etc.) to a destimation (BOX, SCU, etc.)
      parameters:
        - default: 0
          description: start index of returned slice of rules
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of rules
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of forwarding rules
          schema:
            items:
              $ref: "#/definitions/forwardingrule"
            type: array
      tags:
        - Forwarding
    post:
      description: add a new forwarding rule
      parameters:
        - description: The forwarding rule to add. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: FowardingRule
          schema:
            $ref: "#/definitions/forwardingrule"
      responses:
        "201":
          description: the created forwarding rule
          schema:
            $ref: "#/definitions/forwardingrule"
      tags:
        - Forwarding
  /images:
    post:
      description: add a DICOM dataset to slicebox
      parameters:
        - description: The dataset file
          in: formData
          name: dataset
          required: true
          type: file
      responses:
        "200":
          description: meta data for added dataset on the image level of the DICOM hierarchy. Status code 200 signifies that this image was already present in the slicebox database.
          schema:
            $ref: "#/definitions/image"
        "201":
          description: meta data for added dataset on the image level of the DICOM hierarchy
          schema:
            $ref: "#/definitions/image"
      tags:
        - Images
  /images/delete:
    post:
      description: bulk delete a sequence of images according to the supplied image IDs. This is the same as a sequence of DELETE requests to /images/{id}
      parameters:
        - description: IDs of images to delete
          in: body
          name: image IDs
          required: true
          schema:
            items:
              format: int64
              type: integer
            type: array
      responses:
        "204":
          description: Images deleted
      tags:
        - Images
  /images/export:
    get:
      description: download the export set with the supplied export set ID as a zip archive
      parameters:
        - description: ID of export set to download
          format: int64
          in: query
          name: id
          required: true
          type: integer
      produces:
        - application/zip
      responses:
        "200":
          description: zip archive of images
      tags:
        - Images
    post:
      description: create an export set, a group of image IDs of images to export. The export set will contain the selected images. The export set is available for download 12 hours before it is automatically deleted.
      parameters:
        - description: ids of images to export
          in: body
          name: image ids
          required: true
          schema:
            items:
              format: int64
              type: integer
            type: array
      responses:
        "200":
          description: ID of created export set. To be used with the associated GET method for downloading.
          schema:
            $ref: "#/definitions/exportSetId"
        "201":
          description: if the supplied list of image ids is empty or no if images could be found
      tags:
        - Images
  /images/jpeg:
    post:
      description: add a JPEG image to slicebox. The image data will be wrapped in a DICOM file and added as a new series belonging to the study with the supplied ID
      parameters:
        - description: ID of study to add new series to
          format: int64
          in: query
          name: studyid
          required: true
          type: integer
        - description: DICOM series description of the resulting secondary capture series
          in: query
          name: description
          required: false
          type: string
        - description: The jpeg image data
          in: body
          name: jpeg bytes
          required: true
          schema: {}
      responses:
        "201":
          description: meta data for added dataset on the image level of the DICOM hierarchy
          schema:
            $ref: "#/definitions/image"
      tags:
        - Images
  "/images/{id}":
    delete:
      description: Delete the image with the supplied ID
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: image deleted
      tags:
        - Images
    get:
      description: fetch dataset corresponding to the supplied image ID
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
      produces:
        - application/octet-stream
      responses:
        "200":
          description: binary data of dataset
        "404":
          description: if no image was found for the supplied image ID
      tags:
        - Images
  "/images/{id}/anonymize":
    put:
      description: delete the selected image and replace it with an anonymized version
      parameters:
        - description: ID of image to anonymize
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: specification of values for anonymous DICOM attributes
          in: body
          name: tag values
          required: true
          schema:
            $ref: "#/definitions/anonymizationData"
      responses:
        "200":
          description: the newly created anonymous image
          schema:
            $ref: "#/definitions/image"
        "404":
          description: image or corresponding dataset not found
      tags:
        - Anonymization
        - Images
  "/images/{id}/anonymized":
    post:
      description: get an anonymized version of the image with the supplied ID
      parameters:
        - description: ID of image for which to get anonymized dataset
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: specification of values for anonymous DICOM attributes
          in: body
          name: tag values
          required: true
          schema:
            $ref: "#/definitions/anonymizationData"
      responses:
        "200":
          description: binary data of anonymized dataset
        "404":
          description: if no image was found for the supplied image ID
      tags:
        - Anonymization
        - Images
  "/images/{id}/attributes":
    get:
      description: list all DICOM attributes of the dataset corresponding to the supplied image ID
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: list of DICOM attributes
          schema:
            items:
              $ref: "#/definitions/imageAttribute"
            type: array
        "404":
          description: if no image was found for the supplied image ID
      tags:
        - Images
  "/images/{id}/imageinformation":
    get:
      description: get basic information about the pixel data of an image
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: basic information about the pixeldata of an image
          schema:
            $ref: "#/definitions/imageInformation"
        "404":
          description: if no image was found for the supplied image ID
      tags:
        - Images
  "/images/{id}/modify":
    put:
      description: modify and/or insert image attributes according to the input tagpath-value mappings
      parameters:
        - description: ID of image to modify
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: specification of tag paths and corresponding values to insert or modify
          in: body
          name: tag path value mappings
          required: true
          schema:
            items:
              $ref: "#/definitions/tagMapping"
            type: array
      responses:
        "201":
          description: image attributes successfully modified
      tags:
        - Images
  "/images/{id}/png":
    get:
      description: get a PNG image representation of the image corresponding to the supplied ID
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - default: 1
          description: frame/slice to show
          format: int32
          in: query
          name: framenumber
          required: false
          type: integer
        - default: 0
          description: intensity window minimum value. If not specified or set to zero, windowing will be selected from relevant DICOM attributes
          format: int32
          in: query
          name: windowmin
          required: false
          type: integer
        - default: 0
          description: intensity window maximum value. If not specified or set to zero, windowing will be selected from relevant DICOM attributes
          format: int32
          in: query
          name: windowmax
          required: false
          type: integer
        - default: 0
          description: height of PNG image. If not specified or set to zero, the image height will equal that of the data
          format: int32
          in: query
          name: imageheight
          required: false
          type: integer
      produces:
        - image/png
      responses:
        "200":
          description: image data
        "404":
          description: if no image was found for the supplied image ID
        "501":
          description: if the system is not capable of creating an image representation of the data
      tags:
        - Images
  /import/sessions:
    get:
      description: Returns a list of available import sessions.
      parameters:
        - default: 0
          description: start index of returned slice of import sessions
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of import sessions
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: available import sessions
          schema:
            items:
              $ref: "#/definitions/importSession"
            type: array
      tags:
        - Import
    post:
      description: create a new import sessions
      parameters:
        - description: The import session to create containing the user defined name of the session
          in: body
          name: import session
          required: true
          schema:
            $ref: "#/definitions/importSession"
      responses:
        "201":
          description: the created import session
          schema:
            $ref: "#/definitions/importSession"
      tags:
        - Import
  "/import/sessions/{id}":
    delete:
      description: deletes the import session with the supplied ID
      parameters:
        - description: ID of import session to delete
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: import session deleted
      tags:
        - Import
    get:
      description: Returns the import sessions with the supplied ID
      parameters:
        - description: ID of session
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: the import session with the supplied ID
          schema:
            $ref: "#/definitions/importSession"
        "404":
          description: import session not found (invalid ID)
      tags:
        - Import
  "/import/sessions/{id}/images":
    get:
      description: get the imported images corresponding to the import session with the supplied ID
      parameters:
        - description: ID of import session
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: images corresponding to the specified import session
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
        "404":
          description: import session not found (invalid ID)
      tags:
        - Import
    post:
      description: add a DICOM dataset to the import session with the supplied ID
      parameters:
        - description: ID of session
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: The dataset file
          in: formData
          name: dataset
          required: true
          type: file
      responses:
        "200":
          description: meta data for the imported dataset on the image level of the DICOM hierarchy. Status code 200 signifies that this image was already present in the slicebox database.
          schema:
            $ref: "#/definitions/image"
        "201":
          description: meta data for the imported dataset on the image level of the DICOM hierarchy
          schema:
            $ref: "#/definitions/image"
        "404":
          description: import session not found (invalid ID)
      tags:
        - Import
  /log:
    delete:
      description: delete all log messages
      responses:
        "204":
          description: log messages successfully
      tags:
        - Logs
    get:
      description: get a list of slicebox log messages
      parameters:
        - default: 0
          description: start index of returned slice of log messages
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of log messages
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: log subject to filter results by
          in: query
          name: subject
          required: false
          type: string
        - description: log type (DEFAULT, INFO, WARN, ERROR) to filter results by
          in: query
          name: type
          required: false
          type: string
      responses:
        "200":
          description: log messages
          schema:
            items:
              $ref: "#/definitions/logEntry"
            type: array
      tags:
        - Logs
  "/log/{id}":
    delete:
      description: Delete the log entry with the supplied ID
      parameters:
        - description: ID of log entry
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: log entry deleted
      tags:
        - Logs
  /metadata/flatseries:
    get:
      description: Returns a list of flattened metadata on the patient, study and series levels
      parameters:
        - default: 0
          description: start index of returned slice of flat series
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of flat series
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: flat series property to order results by
          in: query
          name: orderby
          required: false
          type: string
        - default: true
          description: order result ascendingly if true, descendingly otherwise
          in: query
          name: orderascending
          required: false
          type: boolean
        - description: filter the results by matching substrings of flat series properties against this value
          in: query
          name: filter
          required: false
          type: string
        - description: filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: flat series
          schema:
            items:
              $ref: "#/definitions/flatSeries"
            type: array
      tags:
        - Meta Data
  /metadata/flatseries/query:
    post:
      description: submit a query for flat series
      parameters:
        - description: parameters of flat series query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/query"
      responses:
        "200":
          description: flat series
          schema:
            items:
              $ref: "#/definitions/flatSeries"
            type: array
      tags:
        - Meta Data
  "/metadata/flatseries/{id}":
    get:
      description: Return the flat series with the supplied ID
      parameters:
        - description: ID of flat series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: flat series response
          schema:
            $ref: "#/definitions/flatSeries"
        "404":
          description: flat series not found (invalid ID)
      tags:
        - Meta Data
  /metadata/images:
    get:
      description: Returns a list of metadata on the image level of the DICOM hierarchy
      parameters:
        - default: 0
          description: start index of returned slice of images
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of images
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: reference to series to list images for
          format: int64
          in: query
          name: seriesid
          required: true
          type: integer
      responses:
        "200":
          description: images
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
      tags:
        - Meta Data
  /metadata/images/query:
    post:
      description: submit a query for images
      parameters:
        - description: parameters of images query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/query"
      responses:
        "200":
          description: images
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
      tags:
        - Meta Data
  "/metadata/images/{id}":
    get:
      description: Return the image with the supplied ID
      parameters:
        - description: ID of image
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: image response
          schema:
            $ref: "#/definitions/image"
        "404":
          description: image not found (invalid ID)
      tags:
        - Meta Data
  /metadata/patients:
    get:
      description: Returns a list of metadata on the patient level of the DICOM hierarchy
      parameters:
        - default: 0
          description: start index of returned slice of patients
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of patients
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: patient property to order results by
          in: query
          name: orderby
          required: false
          type: string
        - default: true
          description: order result ascendingly if true, descendingly otherwise
          in: query
          name: orderascending
          required: false
          type: boolean
        - description: filter the results by matching substrings of patient properties against this value
          in: query
          name: filter
          required: false
          type: string
        - description: filter the results by matching on one or more underlying series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more underlying series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows results including series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more underlying series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows results including series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: patients
          schema:
            items:
              $ref: "#/definitions/patient"
            type: array
      tags:
        - Meta Data
  /metadata/patients/query:
    post:
      description: submit a query for patients
      parameters:
        - description: parameters of patient query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/query"
      responses:
        "200":
          description: patients
          schema:
            items:
              $ref: "#/definitions/patient"
            type: array
      tags:
        - Meta Data
  "/metadata/patients/{id}":
    get:
      description: Return the patient with the supplied ID
      parameters:
        - description: ID of patient
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: patient response
          schema:
            $ref: "#/definitions/patient"
        "404":
          description: patient not found (invalid ID)
      tags:
        - Meta Data
  "/metadata/patients/{id}/images":
    get:
      description: Returns all images for the patient with the supplied patient ID
      parameters:
        - description: ID of patient
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: list of images
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
      tags:
        - Meta Data
  /metadata/series:
    get:
      description: Returns a list of metadata on the series level of the DICOM hierarchy
      parameters:
        - default: 0
          description: start index of returned slice of series
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of series
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: reference to study to list series for
          format: int64
          in: query
          name: studyid
          required: true
          type: integer
        - description: filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: series
          schema:
            items:
              $ref: "#/definitions/series"
            type: array
      tags:
        - Meta Data
  /metadata/series/query:
    post:
      description: submit a query for series
      parameters:
        - description: parameters of series query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/query"
      responses:
        "200":
          description: series
          schema:
            items:
              $ref: "#/definitions/series"
            type: array
      tags:
        - Meta Data
  "/metadata/series/{id}":
    get:
      description: Return the series with the supplied ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: series response
          schema:
            $ref: "#/definitions/series"
        "404":
          description: series not found (invalid ID)
      tags:
        - Meta Data
  "/metadata/series/{id}/seriestags":
    get:
      description: get the list of series tags for the series with the supplied ID.
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: the list of series tags
          schema:
            items:
              $ref: "#/definitions/seriestag"
            type: array
        "404":
          description: series not found (invalid ID)
      tags:
        - Meta Data
    post:
      description: add a series tag to the series with the supplied ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: series tag to add
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/seriestag"
      responses:
        "201":
          description: added series tag
          schema:
            $ref: "#/definitions/seriestag"
        "404":
          description: if no series with the supplied ID exists
      tags:
        - Meta Data
  "/metadata/series/{id}/seriestypes":
    delete:
      description: Delete all series types for the series with the supplied ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: series types deleted
      tags:
        - Meta Data
    get:
      description: get the list of series types for the series with the supplied ID.
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: the list of series types
          schema:
            items:
              $ref: "#/definitions/seriestype"
            type: array
        "404":
          description: series not found (invalid ID)
      tags:
        - Meta Data
  "/metadata/series/{id}/source":
    get:
      description: Return the source of the series with the supplied ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: source for series
          schema:
            $ref: "#/definitions/source"
        "404":
          description: series not found (invalid ID)
      tags:
        - Meta Data
  "/metadata/series/{seriesId}/seriestags/{seriesTagId}":
    delete:
      description: Delete the series tag with the supplied series tag ID from the series with the supplied series ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: seriesId
          required: true
          type: integer
        - description: ID of series tag to remove
          format: int64
          in: path
          name: seriesTagId
          required: true
          type: integer
      responses:
        "204":
          description: series tag removed
      tags:
        - Meta Data
  "/metadata/series/{seriesId}/seriestypes/{seriesTypeId}":
    delete:
      description: Delete the series type with the supplied series type ID from the series with the supplied series ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: seriesId
          required: true
          type: integer
        - description: ID of series type to remove
          format: int64
          in: path
          name: seriesTypeId
          required: true
          type: integer
      responses:
        "204":
          description: series type removed
      tags:
        - Meta Data
    put:
      description: Add the series type with the supplied series type ID to the series with the supplied series ID
      parameters:
        - description: ID of series
          format: int64
          in: path
          name: seriesId
          required: true
          type: integer
        - description: ID of series type to add
          format: int64
          in: path
          name: seriesTypeId
          required: true
          type: integer
      responses:
        "204":
          description: series type added
        "404":
          description: no series or series type found for the supplied ID(s)
      tags:
        - Meta Data
  /metadata/seriestags:
    get:
      description: Returns a list of series tags currently currently in use.
      responses:
        "200":
          description: a list of unique series tags currently used to tag series
          schema:
            items:
              $ref: "#/definitions/seriestag"
            type: array
      tags:
        - Meta Data
  /metadata/studies:
    get:
      description: Returns a list of metadata on the study level of the DICOM hierarchy
      parameters:
        - default: 0
          description: start index of returned slice of studies
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of studies
          format: int64
          in: query
          name: count
          required: false
          type: integer
        - description: reference to patient to list studies for
          format: int64
          in: query
          name: patientid
          required: true
          type: integer
        - description: filter the results by matching on one or more underlying series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more underlying series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows results including series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more underlying series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows results including series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: studies
          schema:
            items:
              $ref: "#/definitions/study"
            type: array
      tags:
        - Meta Data
  /metadata/studies/query:
    post:
      description: submit a query for studies
      parameters:
        - description: parameters of study query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/query"
      responses:
        "200":
          description: studies
          schema:
            items:
              $ref: "#/definitions/study"
            type: array
      tags:
        - Meta Data
  "/metadata/studies/{id}":
    get:
      description: Return the study with the supplied ID
      parameters:
        - description: ID of study
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: study response
          schema:
            $ref: "#/definitions/study"
        "404":
          description: study not found (invalid ID)
      tags:
        - Meta Data
  "/metadata/studies/{id}/images":
    get:
      description: Returns all images for the study with the supplied study ID
      parameters:
        - description: ID of study
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: filter the results by matching on one or more series sources. Examples of sources are user, box, directory or scp. The list of sources to filter results by must have the form TYPE1:ID1,TYPE2:ID2,...,TYPEN:IDN. For instance, the argument sources=box:1,user:5 shows results either sent from (slice)box with id 1 or uploaded by user with id 5.
          in: query
          name: sources
          required: false
          type: string
        - description: filter the results by matching on one or more series types. The supplied list of series types must be a comma separated list of series type ids. For instance, the argument seriestypes=3,7,22 shows series assigned to either of the series types with ids 3, 7 and 22.
          in: query
          name: seriestypes
          required: false
          type: string
        - description: filter the results by matching on one or more series tags. The supplied list of series tags must be a comma separated list of series tag ids. For instance, the argument seriestags=6,2,11 shows series with either of the series tags with ids 6, 2 and 11.
          in: query
          name: seriestags
          required: false
          type: string
      responses:
        "200":
          description: list of images
          schema:
            items:
              $ref: "#/definitions/image"
            type: array
        "404":
          description: study not found (invalid ID)
      tags:
        - Meta Data
  /scps:
    get:
      description: get a list of DICOM SCPs. Each SCP is a server for receiving DICOM images from e.g. a PACS system.
      parameters:
        - default: 0
          description: start index of returned slice of SCPs
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of SCPs
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of SCPs
          schema:
            items:
              $ref: "#/definitions/scp"
            type: array
      tags:
        - SCPs
    post:
      description: add a new SCP for receiving DICOM images
      parameters:
        - description: SCP information. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: scp
          schema:
            $ref: "#/definitions/scp"
      responses:
        "201":
          description: the created SCP
          schema:
            $ref: "#/definitions/scp"
        "400":
          description: Invalid port number or AE title
      tags:
        - SCPs
  "/scps/{id}":
    delete:
      description: shut down and remove the SCP corresponding to the supplied ID
      parameters:
        - description: id of SCP to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: SCP removed
      tags:
        - SCPs
  /scus:
    get:
      description: get a list of DICOM SCUs. Each SCU is a client for sending DICOM images to an SCP, e.g. a PACS system.
      parameters:
        - default: 0
          description: start index of returned slice of SCUs
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of SCUs
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of SCUs
          schema:
            items:
              $ref: "#/definitions/scu"
            type: array
      tags:
        - SCUs
    post:
      description: add a new SCU for sending DICOM images
      parameters:
        - description: SCU information. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: scu
          schema:
            $ref: "#/definitions/scu"
      responses:
        "201":
          description: the created SCU
          schema:
            $ref: "#/definitions/scu"
        "400":
          description: Invalid port number or AE title
      tags:
        - SCUs
  "/scus/{id}":
    delete:
      description: remove the SCU corresponding to the supplied ID
      parameters:
        - description: id of SCU to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: SCU removed
      tags:
        - SCUs
  "/scus/{id}/send":
    post:
      description: send the images with the supplied image IDs to a DICOM SCP using the the SCU with the supplied scu ID
      parameters:
        - description: id of SCU to use for sending
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: array of ids of images to send
          in: body
          name: imageids
          required: true
          schema:
            items:
              format: int64
              type: integer
            type: array
      responses:
        "204":
          description: Series sent
        "404":
          description: Series not found or SCU not found
        "502":
          description: Receiving SCP host not available
      tags:
        - SCUs
  /seriestypes:
    get:
      description: get a list of all added series types. By filtering search results for certain series types, it is easier for applications to ensure that they read images of applicable types.
      parameters:
        - default: 0
          description: start index of returned slice of series types
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of series types
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: the list of series types
          schema:
            items:
              $ref: "#/definitions/seriestype"
            type: array
      tags:
        - Series Types
    post:
      description: add a new series type
      parameters:
        - description: Series type information. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: SeriesType
          schema:
            $ref: "#/definitions/seriestype"
      responses:
        "201":
          description: the created series type
          schema:
            $ref: "#/definitions/seriestype"
      tags:
        - Series Types
  /seriestypes/rules:
    get:
      description: get a list of rules for assigning series types to series. A rule connects to a series of attributes with values and a resulting series type. If a series has the required values of the listed attributes, it is assigned to the series type of the rule.
      parameters:
        - description: ID of series type to list rules for
          format: int64
          in: query
          name: seriestypeid
          required: true
          type: integer
      responses:
        "200":
          description: the list of series type rules for the series type with the supplied ID
          schema:
            items:
              $ref: "#/definitions/seriestyperule"
            type: array
      tags:
        - Series Types
    post:
      description: add a new series type rule
      parameters:
        - description: Series type rule information. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: SeriesTypeRule
          schema:
            $ref: "#/definitions/seriestyperule"
      responses:
        "201":
          description: the created series type rule
          schema:
            $ref: "#/definitions/seriestyperule"
      tags:
        - Series Types
  /seriestypes/rules/updatestatus:
    get:
      description: get the status of the internal process of updating series types for series following a change of series types, rules or attributes.
      responses:
        "200":
          description: a status message, indicating if an update is running
          schema:
            $ref: "#/definitions/seriestypeupdatestatus"
      tags:
        - Series Types
  "/seriestypes/rules/{id}":
    delete:
      description: remove the series type rule corresponding to the supplied ID
      parameters:
        - description: id of series type rule to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: series type rule removed
      tags:
        - Series Types
  "/seriestypes/rules/{id}/attributes":
    get:
      description: get the list of attributes for the series type rule with the supplied ID.
      parameters:
        - description: index of series type rule to list rule attributes for
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "200":
          description: the list of series type rule attributes for the series type rule with the supplied ID
          schema:
            items:
              $ref: "#/definitions/seriestyperuleattribute"
            type: array
      tags:
        - Series Types
    post:
      description: add a new series type rule attribute
      parameters:
        - description: ID of rule
          format: int64
          in: path
          name: id
          required: true
          type: integer
        - description: Series type rule attribute information. The ID property is irrelevant, the ID of the inserted record is present in the returned data.
          in: body
          name: SeriesTypeRuleAttribute
          schema:
            $ref: "#/definitions/seriestyperuleattribute"
      responses:
        "201":
          description: the created series type rule attribute
          schema:
            $ref: "#/definitions/seriestyperuleattribute"
      tags:
        - Series Types
  "/seriestypes/rules/{ruleId}/attributes/{attributeId}":
    delete:
      description: remove the series type rule attribute corresponding to the supplied series type and attribute IDs
      parameters:
        - description: id of series type rule for which to remove an attribute
          format: int64
          in: path
          name: ruleId
          required: true
          type: integer
        - description: id of attribute to remove
          format: int64
          in: path
          name: attributeId
          required: true
          type: integer
      responses:
        "204":
          description: series type rule attribute removed
      tags:
        - Series Types
  /seriestypes/series/query:
    post:
      description: submit a query for seriestypes for a list of series
      parameters:
        - description: parameters of series query
          in: body
          name: query
          required: true
          schema:
            $ref: "#/definitions/idsquery"
      responses:
        "200":
          description: series
          schema:
            $ref: "#/definitions/seriesidseriestypesresult"
      tags:
        - Meta Data
  "/seriestypes/{id}":
    delete:
      description: remove the series type corresponding to the supplied ID
      parameters:
        - description: id of series type to remove
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: series type removed
      tags:
        - Series Types
    put:
      description: request an asynchronous update of all series, labelling appropriate series with the series type corresponding to the supplied ID.
      parameters:
        - description: id of series type to update series labels for
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: update successfully added to queue of series type updates
      tags:
        - Series Types
  /sources:
    get:
      description: Returns a list of currently available data sources. Possible source types are user - data imported by an API call by a user, box - data received from a remote box, directory - data imported via a watched directory, import - data imported into slicebox using import sessions, or scp - data received from a PACS.
      responses:
        "200":
          description: currently available sources
          schema:
            items:
              $ref: "#/definitions/source"
            type: array
      tags:
        - General
  /system/health:
    get:
      description: No-op route for checking whether the service is alive or not
      responses:
        "200":
          description: The service is up and running
      tags:
        - General
  /system/stop:
    post:
      description: stop and shut down slicebox
      responses:
        "200":
          description: shutdown message
      tags:
        - General
  "/transactions/{token}/image":
    post:
      consumes:
        - application/octet-stream
      description: add an image (dataset) as part of a transaction. This method is used when sending images using the push method to a public slicebox.
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: the ID of the client's outgoing transaction
          format: int64
          in: query
          name: transactionid
          required: true
          type: integer
        - description: the index of this image in the transaction
          format: int64
          in: query
          name: sequencenumber
          required: true
          type: integer
        - description: the total number of images in this transaction
          format: int64
          in: query
          name: totalimagecount
          required: true
          type: integer
        - description: the dataset byte array
          in: body
          name: dataset
          required: true
          schema: {}
      responses:
        "204":
          description: image data received
        "401":
          description: unauthorized, invalid token
      tags:
        - Transactions
  "/transactions/{token}/outgoing":
    get:
      description: fetch an image from the connected box as part of a transaction. This method is used when sending images using the poll method from a public slicebox.
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: the ID of the outgoing transaction
          format: int64
          in: query
          name: transactionid
          required: true
          type: integer
        - description: the ID of the outgoing transaction image
          format: int64
          in: query
          name: imageid
          required: true
          type: integer
      produces:
        - application/octet-stream
      responses:
        "200":
          description: binary data of dataset
        "401":
          description: unauthorized, invalid token
        "404":
          description: no outgoing trensaction and/or image found for the supplied transaction id and transaction image id
      tags:
        - Transactions
  "/transactions/{token}/outgoing/done":
    post:
      description: signal that the supplied outgoing transaction and image was successfully received and can be marked as sent. This method is used when sending images using the poll method from a public slicebox.
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: outgoing transaction and image that has been successfully received
          in: body
          name: outgoing entry and image information block
          required: true
          schema:
            $ref: "#/definitions/outgoingTransactionImage"
      responses:
        "204":
          description: done message received
        "401":
          description: unauthorized, invalid token
      tags:
        - Transactions
  "/transactions/{token}/outgoing/failed":
    post:
      description: signal that the image corresponding to the supplied outgoing transaction and image could not be read or stored properly on the receiving side, and that the transaction should be marked as failed.
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: the outgoing transaction and image information block corresponding to the failed image transfer, along with the associated error message
          in: body
          name: outgoing transaction and image, and error message
          required: true
          schema:
            $ref: "#/definitions/failedOutgoingTransactionImage"
      responses:
        "204":
          description: failed message received
        "401":
          description: unauthorized, invalid token
      tags:
        - Transactions
  "/transactions/{token}/outgoing/poll":
    get:
      description: get next outgoing transaction and image (information on the next image that the connected box wishes to send to you), if any. This method is used when sending images using the poll method from a public slicebox.
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
      responses:
        "200":
          description: next outgoing transaction and image information block
          schema:
            items:
              $ref: "#/definitions/outgoingTransactionImage"
            type: array
        "401":
          description: unauthorized, invalid token
        "404":
          description: there are currently no outgoing transactions to fetch for the box connection with the supplied token
      tags:
        - Transactions
  "/transactions/{token}/status":
    get:
      description: get the status of the remote incoming transaction with the supplied transaction ID
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: the ID of the client's outgoing transaction
          format: int64
          in: query
          name: transactionid
          required: true
          type: integer
      responses:
        "200":
          description: string representation of the transaction status (FINISHED, FAILED, WAITING or PROCESSING)
        "401":
          description: unauthorized, invalid token
        "404":
          description: no transaction found for the supplied transaction ID and box token
      tags:
        - Transactions
    put:
      description: update the status of the transaction with the supplied ID
      parameters:
        - description: authentication token identifying the current box-to-box connection
          in: path
          name: token
          required: true
          type: string
        - description: the ID of the client's outgoing transaction
          format: int64
          in: query
          name: transactionid
          required: true
          type: integer
        - description: the updated status of the transaction
          in: body
          name: transaction status
          required: true
          schema:
            type: string
      responses:
        "204":
          description: status update successfully applied to transaction
        "404":
          description: no transaction found for the supplied transaction ID and box token
      tags:
        - Transactions
  /users:
    get:
      description: Returns all users of slicebox
      parameters:
        - default: 0
          description: start index of returned slice of users
          format: int64
          in: query
          name: startindex
          required: false
          type: integer
        - default: 20
          description: size of returned slice of users
          format: int64
          in: query
          name: count
          required: false
          type: integer
      responses:
        "200":
          description: user response
          schema:
            items:
              $ref: "#/definitions/user"
            type: array
      tags:
        - Users
    post:
      description: Creates a new user. Dupicates are accepted but not added.
      parameters:
        - description: User to add
          in: body
          name: user
          required: true
          schema:
            $ref: "#/definitions/newUser"
      responses:
        "201":
          description: user response
          schema:
            $ref: "#/definitions/user"
      tags:
        - Users
  /users/current:
    get:
      description: obtain information on the currently logged in user as specified by the supplied session cookie, IP address and user agent.
      responses:
        "200":
          description: user information
          schema:
            $ref: "#/definitions/userInfo"
        "404":
          description: no user found for the supplied session cookie, IP address and user agent, or if any of the required headers are missing.
      tags:
        - Users
  /users/login:
    post:
      description: Obtain a session cookie that can be used to authenticate future API calls from the present IP address and with the present user agent.
      parameters:
        - description: username and password for user logging in
          in: body
          name: UserPass
          required: true
          schema:
            $ref: "#/definitions/userPass"
      responses:
        "201":
          description: if the supplied credentials are valid. The response headers will contain Set-Cookie.
        "401":
          description: if the supplied credentials are invalid.
      tags:
        - Users
  /users/logout:
    post:
      description: Logout the current user by responding with a delete cookie header removing the session cookie for this user.
      parameters: []
      responses:
        "201":
          description: the user was logged out
      tags:
        - Users
  "/users/{id}":
    delete:
      description: deletes a single user based on the ID supplied
      parameters:
        - description: ID of user to delete
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        "204":
          description: user deleted
      tags:
        - Users
definitions:
  anonymizationData:
    properties:
      profile:
        $ref: "#/definitions/anonymizationProfile"
      tagValues:
        items:
          $ref: "#/definitions/tagValue"
        type: array
    type: object
  anonymizationKey:
    properties:
      anonPatientID:
        type: string
      anonPatientName:
        type: string
      anonSOPInstanceUID:
        type: string
      anonSeriesInstanceUID:
        type: string
      anonStudyInstanceUID:
        type: string
      created:
        format: int64
        type: integer
      id:
        format: int64
        type: integer
      imageId:
        format: int64
        type: integer
      patientID:
        type: string
      patientName:
        type: string
      seriesInstanceUID:
        type: string
      sopInstanceUID:
        type: string
      studyInstanceUID:
        type: string
    type: object
  anonymizationKeyQuery:
    properties:
      count:
        format: int64
        type: integer
      order:
        $ref: "#/definitions/queryOrder"
      queryProperties:
        items:
          $ref: "#/definitions/queryProperty"
        type: array
      startIndex:
        format: int64
        type: integer
    required:
      - startIndex
      - count
      - queryProperties
    type: object
  anonymizationKeyValue:
    properties:
      anonymizationKeyId:
        format: int64
        type: integer
      anonymizedValue:
        type: string
      id:
        format: int64
        type: integer
      tagPath:
        $ref: "#/definitions/tagPathTag"
      value:
        type: string
    type: object
  anonymizationProfile:
    properties:
      options:
        items:
          $ref: "#/definitions/confidentialityOption"
        type: array
    type: object
  box:
    properties:
      baseUrl:
        type: string
      id:
        format: int64
        type: integer
      name:
        type: string
      online:
        type: boolean
      profile:
        $ref: "#/definitions/anonymizationProfile"
      sendMethod:
        type: string
      token:
        type: string
    type: object
  bulkAnonymizationData:
    properties:
      imageTagValuesSet:
        items:
          $ref: "#/definitions/imageTagValues"
        type: array
      profile:
        $ref: "#/definitions/anonymizationProfile"
    type: object
  confidentialityOption:
    properties:
      description:
        type: string
      name:
        type: string
      rank:
        format: int32
        type: integer
      title:
        type: string
    type: object
  destination:
    properties:
      destinationId:
        format: int64
        type: integer
      destinationName:
        type: string
      destinationType:
        type: string
    type: object
  dicomPropertyValue:
    properties:
      value:
        type: string
    type: object
  exportSetId:
    properties:
      value:
        format: int64
        type: integer
    type: object
  failedOutgoingTransactionImage:
    properties:
      message:
        type: string
      transactionImage:
        $ref: "#/definitions/outgoingTransactionImage"
    type: object
  filter:
    properties:
      id:
        format: int64
        type: integer
      name:
        type: string
      tagFilterType:
        type: string
      tags:
        items:
          $ref: "#/definitions/tagPathTag"
        type: array
    type: object
  flatSeries:
    properties:
      id:
        format: int64
        type: integer
      patient:
        $ref: "#/definitions/patient"
      series:
        $ref: "#/definitions/series"
      study:
        $ref: "#/definitions/study"
    type: object
  forwardingrule:
    properties:
      destination:
        $ref: "#/definitions/destination"
      id:
        format: int64
        type: integer
      keepImages:
        type: boolean
      source:
        $ref: "#/definitions/source"
    type: object
  idsquery:
    properties:
      ids:
        items:
          format: int64
          type: integer
        type: array
    required:
      - ids
    type: object
  image:
    properties:
      id:
        format: int64
        type: integer
      imageType:
        $ref: "#/definitions/dicomPropertyValue"
      instanceNumber:
        $ref: "#/definitions/dicomPropertyValue"
      seriesId:
        format: int64
        type: integer
      sopInstanceUID:
        $ref: "#/definitions/dicomPropertyValue"
    type: object
  imageAttribute:
    properties:
      depth:
        format: int32
        type: integer
      element:
        type: string
      group:
        type: string
      length:
        format: int32
        type: integer
      multiplicity:
        format: int32
        type: integer
      name:
        type: string
      path:
        type: string
      value:
        type: string
      vr:
        type: string
    type: object
  imageInformation:
    properties:
      frameIndex:
        format: int32
        type: integer
      maximumPixelValue:
        format: int32
        type: integer
      minimumPixelValue:
        format: int32
        type: integer
      numberOfFrames:
        format: int32
        type: integer
    type: object
  imageTagValues:
    properties:
      imageId:
        format: int64
        type: integer
      tagValues:
        items:
          $ref: "#/definitions/tagValue"
        type: array
    type: object
  importSession:
    properties:
      created:
        format: int64
        type: integer
      filesAdded:
        format: int32
        type: integer
      filesImported:
        format: int32
        type: integer
      filesRejected:
        format: int32
        type: integer
      id:
        format: int64
        type: integer
      lastUpdated:
        format: int64
        type: integer
      name:
        type: string
      user:
        type: string
      userId:
        format: int64
        type: integer
    type: object
  incomingTransaction:
    properties:
      boxId:
        format: int64
        type: integer
      boxName:
        type: string
      id:
        format: int64
        type: integer
      outgoingTransactionId:
        format: int64
        type: integer
      receivedImageCount:
        format: int64
        type: integer
      status:
        type: string
      totalImageCount:
        format: int64
        type: integer
      updated:
        format: int64
        type: integer
    type: object
  logEntry:
    properties:
      created:
        format: int64
        type: integer
      entryType:
        type: string
      id:
        format: int64
        type: integer
      message:
        type: string
      subject:
        type: string
    type: object
  newUser:
    properties:
      password:
        type: string
      role:
        type: string
      user:
        type: string
    type: object
  outgoingImage:
    properties:
      id:
        format: int64
        type: integer
      imageId:
        format: int64
        type: integer
      outgoingTransactionId:
        format: int64
        type: integer
      sent:
        type: boolean
      sequenceNumber:
        format: int64
        type: integer
    type: object
  outgoingTransaction:
    properties:
      boxId:
        format: int64
        type: integer
      boxName:
        type: string
      id:
        format: int64
        type: integer
      profile:
        $ref: "#/definitions/anonymizationProfile"
      sentImageCount:
        format: int64
        type: integer
      status:
        type: string
      totalImageCount:
        format: int64
        type: integer
      updated:
        format: int64
        type: integer
    type: object
  outgoingTransactionImage:
    properties:
      image:
        $ref: "#/definitions/outgoingImage"
      transaction:
        $ref: "#/definitions/outgoingTransaction"
    type: object
  patient:
    properties:
      id:
        format: int64
        type: integer
      patientBirthDate:
        $ref: "#/definitions/dicomPropertyValue"
      patientID:
        $ref: "#/definitions/dicomPropertyValue"
      patientName:
        $ref: "#/definitions/dicomPropertyValue"
      patientSex:
        $ref: "#/definitions/dicomPropertyValue"
    type: object
  query:
    properties:
      count:
        format: int64
        type: integer
      filters:
        $ref: "#/definitions/queryFilters"
      order:
        $ref: "#/definitions/queryOrder"
      queryProperties:
        items:
          $ref: "#/definitions/queryProperty"
        type: array
      startIndex:
        format: int64
        type: integer
    required:
      - startIndex
      - count
      - queryProperties
    type: object
  queryFilters:
    properties:
      seriesTagIds:
        items:
          format: int64
          type: integer
        type: array
      seriesTypeIds:
        items:
          format: int64
          type: integer
        type: array
      sourceRefs:
        items:
          $ref: "#/definitions/sourceRef"
        type: array
    type: object
  queryOrder:
    properties:
      orderAscending:
        type: boolean
      orderBy:
        type: string
    type: object
  queryProperty:
    properties:
      operator:
        type: string
      propertyName:
        type: string
      propertyValue:
        type: string
    type: object
  remoteBox:
    properties:
      baseUrl:
        type: string
      defaultProfile:
        $ref: "#/definitions/anonymizationProfile"
      name:
        type: string
    type: object
  remoteBoxConnectionData:
    properties:
      defaultProfile:
        $ref: "#/definitions/anonymizationProfile"
      name:
        type: string
    type: object
  scp:
    properties:
      aeTitle:
        type: string
      id:
        format: int64
        type: integer
      name:
        type: string
      port:
        format: int32
        type: integer
    type: object
  scu:
    properties:
      aeTitle:
        type: string
      host:
        type: string
      id:
        format: int64
        type: integer
      name:
        type: string
      port:
        format: int32
        type: integer
    type: object
  series:
    properties:
      bodyPartExamined:
        $ref: "#/definitions/dicomPropertyValue"
      frameOfReferenceUID:
        $ref: "#/definitions/dicomPropertyValue"
      id:
        format: int64
        type: integer
      manufacturer:
        $ref: "#/definitions/dicomPropertyValue"
      modality:
        $ref: "#/definitions/dicomPropertyValue"
      protocolName:
        $ref: "#/definitions/dicomPropertyValue"
      seriesDate:
        $ref: "#/definitions/dicomPropertyValue"
      seriesDescription:
        $ref: "#/definitions/dicomPropertyValue"
      seriesInstanceUID:
        $ref: "#/definitions/dicomPropertyValue"
      stationName:
        $ref: "#/definitions/dicomPropertyValue"
      studyId:
        format: int64
        type: integer
    type: object
  seriesidseriestype:
    properties:
      seriesid:
        format: int64
        type: integer
      seriestype:
        $ref: "#/definitions/seriestype"
    type: object
  seriesidseriestypesresult:
    properties:
      seriesidseriestypes:
        items:
          $ref: "#/definitions/seriesidseriestype"
        type: array
    type: object
  seriestag:
    properties:
      id:
        format: int64
        type: integer
      name:
        type: string
    type: object
  seriestype:
    properties:
      id:
        format: int64
        type: integer
      name:
        type: string
    type: object
  seriestyperule:
    properties:
      id:
        format: int64
        type: integer
      seriesTypeId:
        format: int64
        type: integer
    type: object
  seriestyperuleattribute:
    properties:
      element:
        format: int32
        type: integer
      group:
        format: int32
        type: integer
      id:
        format: int64
        type: integer
      path:
        type: string
      seriesTypeRuleId:
        format: int64
        type: integer
      value:
        type: string
    required:
      - id
      - seriesTypeRuleId
      - group
      - element
      - value
    type: object
  seriestypeupdatestatus:
    properties:
      running:
        type: boolean
    required:
      - running
    type: object
  source:
    properties:
      sourceId:
        format: int64
        type: integer
      sourceName:
        type: string
      sourceType:
        type: string
    type: object
  sourceRef:
    properties:
      sourceId:
        format: int64
        type: integer
      sourceType:
        type: string
    type: object
  sourceTagFilter:
    properties:
      id:
        format: int64
        type: integer
      sourceId:
        format: int64
        type: integer
      sourceType:
        type: string
      tagFilterId:
        format: int64
        type: integer
    type: object
  study:
    properties:
      accessionNumber:
        $ref: "#/definitions/dicomPropertyValue"
      id:
        format: int64
        type: integer
      patientAge:
        $ref: "#/definitions/dicomPropertyValue"
      patientId:
        format: int64
        type: integer
      studyDate:
        $ref: "#/definitions/dicomPropertyValue"
      studyDescription:
        $ref: "#/definitions/dicomPropertyValue"
      studyID:
        $ref: "#/definitions/dicomPropertyValue"
      studyInstanceUID:
        $ref: "#/definitions/dicomPropertyValue"
    type: object
  tagMapping:
    properties:
      tagPath:
        $ref: "#/definitions/tagPathTag"
      value:
        type: string
    type: object
  tagPathTag:
    properties:
      previous:
        $ref: "#/definitions/tagPathTrunk"
      tag:
        format: int32
        type: integer
    type: object
  tagPathTrunk:
    properties:
      item:
        type: string
      previous:
        $ref: "#/definitions/tagPathTrunk"
      tag:
        format: int32
        type: integer
    type: object
  tagValue:
    properties:
      tagPath:
        $ref: "#/definitions/tagPathTag"
      value:
        type: string
    type: object
  user:
    properties:
      hashedPassword:
        type: string
      id:
        format: int64
        type: integer
      role:
        type: string
      user:
        type: string
    required:
      - id
      - user
      - role
    type: object
  userInfo:
    properties:
      id:
        format: int64
        type: integer
      role:
        type: string
      user:
        type: string
    type: object
  userPass:
    properties:
      pass:
        type: string
      user:
        type: string
    type: object
  watchedDirectory:
    properties:
      id:
        format: int64
        type: integer
      path:
        type: string
    type: object
