Class: Dcm4chee::TrashedInstance

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource, DataMapper::Searcher, HasDicomObject
Defined in:
app/models/dcm4chee/trashed_instance.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasDicomObject

#dcm, #dcm_elements

Class Method Details

.repository(name = nil, &block) ⇒ Object



52
53
54
# File 'app/models/dcm4chee/trashed_instance.rb', line 52

def self.repository(name = nil, &block)
  super(Dcm4chee.config.repository_name, &block)
end

Instance Method Details

#as_json(opts = {}) ⇒ Object



44
45
46
47
48
49
50
# File 'app/models/dcm4chee/trashed_instance.rb', line 44

def as_json(opts = {})
  opts[:methods] ||= []
  opts[:methods] << :series_iuid
  opts[:methods] << :study_iuid

  super(opts)
end

#created_atDateTime

Returns created time.

Returns:

  • (DateTime)

    created time



18
# File 'app/models/dcm4chee/trashed_instance.rb', line 18

property :created_at, DateTime, field: 'created_time'

#idInteger

Returns primary key.

Returns:

  • (Integer)

    primary key



12
# File 'app/models/dcm4chee/trashed_instance.rb', line 12

property :id, Serial, field: 'pk'

#remove_from_trashObject



32
33
34
# File 'app/models/dcm4chee/trashed_instance.rb', line 32

def remove_from_trash
  Dcm4chee.content_edit_service.delete_instance(id)
end

#restore_from_trashObject



28
29
30
# File 'app/models/dcm4chee/trashed_instance.rb', line 28

def restore_from_trash
  Dcm4chee.content_edit_service.undelete_instance(id)
end

#series_iuidObject



40
41
42
# File 'app/models/dcm4chee/trashed_instance.rb', line 40

def series_iuid
  trashed_series.series_iuid
end

#sop_iuidString

Returns DICOM SOP Instance UID(0008,0018).

Returns:

  • (String)

    DICOM SOP Instance UID(0008,0018)



21
# File 'app/models/dcm4chee/trashed_instance.rb', line 21

property :sop_iuid, Text, field: 'sop_iuid'

#study_iuidObject



36
37
38
# File 'app/models/dcm4chee/trashed_instance.rb', line 36

def study_iuid
  trashed_series.trashed_study.study_iuid
end

#trashed_series_idInteger

Returns foreign key of Series.

Returns:

  • (Integer)

    foreign key of Series



15
# File 'app/models/dcm4chee/trashed_instance.rb', line 15

property :trashed_series_id, Integer, field: 'series_fk'