Class: ODDB::State::Admin::OrphanedPatinfoAssign

Inherits:
Global show all
Defined in:
src/state/admin/orphaned_patinfo_assign.rb

Defined Under Namespace

Classes: OrphanedPatinfoFacade

Constant Summary

VIEW =
View::Admin::OrphanedPatinfoAssign

Constants inherited from Global

HOME_STATE, ZONE

Constants inherited from Global

DIRECT_EVENT, GLOBAL_MAP, HOME_STATE, LIMITED, PRINT_STATES, READONLY_STATES, RESOLVE_STATES, REVERSE_MAP, VIEW, ZONE_NAVIGATION

Constants included from UmlautSort

FILTER_PAIRS

Instance Method Summary (collapse)

Methods inherited from Global

#zone_navigation

Methods inherited from Global

#_search_drugs, #_search_drugs_state, #_trigger, #add_to_interaction_basket, #allowed?, #atc_chooser, #checkout, #clear_interaction_basket, #creditable?, #direct_request_path, #doctorlist, #download, #export_csv, #extend, #fachinfo, #feedbacks, #help_navigation, #home_navigation, #home_state, #hospitallist, #interaction_basket, #limit_state, #limited?, #logout, #navigation, #notify, #password_reset, #paypal_return, #powerlink, #print, #proceed_download, #proceed_poweruser, #resolve, #resolve_state, #rss, #search, #show, #snapback_event, #sort, #sponsorlink, #suggest_address, #switch, #unique_email, #user_input, #user_navigation, #ywesee_contact, #zone_navigation, #zones

Methods included from LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Method Details

- (Object) assign



38
39
40
41
42
43
44
45
46
47
48
49
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 38

def assign
  if(!@session.error? \
    && (pointers = @session.user_input(:pointers)) \
    && !pointers.empty?)
    @session.app.accept_orphaned(model.languages , pointers.values, :patinfo)
    self
  else
    err = create_error(:e_no_sequence_selected, :pointers, nil)
    @errors.store(:pointers, err)
    self
  end
end

- (Object) init



33
34
35
36
37
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 33

def init
  @model = OrphanedPatinfoFacade.new(@model)
  name = @model.name[/^\w+/u]
  @model.sequences = named_sequences(name)
end

- (Object) named_sequences(name)



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 50

def named_sequences(name)
  if(name.size < 3)
    add_warning(:w_name_to_short,:name, name)
    []
  else
    returnvalue = @session.app.search_sequences(name.downcase)
    if(returnvalue.size > 50)
      add_warning(:w_too_many_sequences, :name, nil)
      []
    else
      returnvalue
    end
  end
end

- (Object) preview



77
78
79
80
81
82
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 77

def preview 
  if(lang = @session.user_input(:language_select))
    doc = @model.languages[lang]
    State::Drugs::PatinfoPreview.new(@session, doc)
  end
end

- (Object) search_sequences



64
65
66
67
68
69
70
71
72
73
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 64

def search_sequences
  name = @session.user_input(:search_query).to_s
  if(name.is_a? String)
    @model.sequences = named_sequences(name)
  else
    err = create_error(:e_name_to_short, :name, name)
    @errors.store(name, err)
  end
  self
end

- (Object) symbol



74
75
76
# File 'src/state/admin/orphaned_patinfo_assign.rb', line 74

def symbol
  :name_base
end