Class: Dcm4chee::Api::V1::TrashedSeriesController

Inherits:
BaseController show all
Defined in:
app/controllers/dcm4chee/api/v1/trashed_series_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Move a series to the trash including the related instances and files.

Examples:

# Request
POST /api/trashed_series HTTP/1.1
Accept: application/vnd.menglifang.org; version=1
Content-Type: application/json

{ "series_id": ... }

# Response
HTTP/1.1 201 Created


56
57
58
59
60
61
# File 'app/controllers/dcm4chee/api/v1/trashed_series_controller.rb', line 56

def create
  series = Series.get!(params[:series_id])
  series.move_to_trash

  head :created
end

#destroyObject

Delete a series from the trash.

Examples:

# Request
DELETE /api/trashed_series/... HTTP/1.1
Accept: application/vnd.menglifang.org; version=1

# Response
HTTP/1.1 200 OK


72
73
74
75
76
77
# File 'app/controllers/dcm4chee/api/v1/trashed_series_controller.rb', line 72

def destroy
  series = TrashedSeries.get!(params[:id])
  series.remove_from_trash

  head :ok
end

#indexObject

Search for series from the trash. Supported querying conditions:

trashed_study_id

Check DataMapper::Searcher::ClassMethods for supported querying operators.

Examples:

# Request
GET /api/trashed_series?q[trashed_study_id]=... HTTP/1.1
Accept: application/vnd.menglifang.org; version=1

# Response
HTTP/1.1 200 OK
{
  "trashed_series": [{
    "id": ...,
    "trashed_study_id": ...,
    "series_iuid": ...,
    "source_aet": ...,
    "dcm_elements": [{
      "name": ...,
      "value": ...,
      "tag": ...,
      "value_representation": ...,
      "length": ...
    }, ...]
  }, ...]
}


37
38
39
40
41
# File 'app/controllers/dcm4chee/api/v1/trashed_series_controller.rb', line 37

def index
  series = TrashedSeries.search(params[:q])

  respond_with trashed_series: series
end