Class: ODDB::State::Global

Inherits:
SBSM::State
  • Object
show all
Includes:
Admin::LoginMethods, UmlautSort
Defined in:
src/state/global.rb,
test/test_state/global.rb,
src/state/global_predefine.rb,
test/test_state/drugs/galenicgroup.rb

Direct Known Subclasses

Admin::Global, Admin::Login, Admin::PasswordLost, Analysis::Global, Analysis::Group, Analysis::Limit, Companies::Global, Doctors::Global, Doctors::Limit, Doctors::VCard, Drugs::Global, Drugs::Limit, Drugs::MiniFi, Drugs::Narcotic, Drugs::NarcoticPlus, Exception, Hospitals::Global, Hospitals::Limit, Hospitals::VCard, Http404, Interactions::Global, Migel::Global, Migel::Group, Migel::Limit, PayPal::AjaxCheckout, PayPal::Redirect, PayPal::Return, Rss::PassThru, Substances::Global, SuggestAddress, User::Global, User::Limit, StubResolvedRootState

Constant Summary

DIRECT_EVENT =
nil
GLOBAL_MAP =
{
  :ajax_ddd_price       => State::Ajax::DDDPrice,
  :ajax_matches         =>  State::Ajax::Matches,
  :ajax_swissmedic_cat  => State::Ajax::SwissmedicCat,
  :analysis_alphabetical  => State::Analysis::Alphabetical,
  :companylist          => State::Companies::CompanyList,
  :compare              => State::Drugs::Compare,
  :compare_search       =>  State::Drugs::CompareSearch,
  :ddd                  => State::Drugs::DDD,
  :ddd_chart            =>  State::Ajax::DDDChart,
  :ddd_price            =>  State::Drugs::DDDPrice,
  :download_export      => State::User::DownloadExport,
  :fachinfos            =>  State::Drugs::Fachinfos,
  :fipi_offer_input     =>  State::User::FiPiOfferInput,
  :help                 =>  State::User::Help,
  :home                 =>  State::Drugs::Init,
  :home_admin           => State::Admin::Init,
  :home_analysis        =>  State::Analysis::Init,
  :home_companies       => State::Companies::Init,
  :home_doctors         =>  State::Doctors::Init,
  :home_hospitals       => State::Hospitals::Init,
  :home_drugs           =>  State::Drugs::Init,
  :home_interactions    =>  State::Interactions::Init,
  :home_migel           => State::Migel::Init,
  :home_substances      =>  State::Substances::Init,
  :home_user            =>  State::User::Init,
  :hospitallist         =>  State::Hospitals::HospitalList,
  :limitation_texts     =>  State::Drugs::LimitationTexts,
  :listed_companies     =>  State::Companies::CompanyList,
  :login_form           => State::Admin::,
  :mailinglist          => State::User::MailingList,
  :migel_alphabetical   => State::Migel::Alphabetical,
  :password_lost        =>  State::Admin::PasswordLost,
  :patinfos             =>  State::Drugs::Patinfos,
  :narcotics            =>  State::Drugs::Narcotics,
  :plugin               => State::User::Plugin,
  :passthru             =>  State::User::PassThru,
  :paypal_thanks        =>  State::User::PayPalThanks,
  :price_history        =>  State::Drugs::PriceHistory,
  :recent_registrations =>  State::Drugs::RecentRegs,
  :sequences            =>  State::Drugs::Sequences,
  :vaccines             =>  State::Drugs::Vaccines,
}
HOME_STATE =
State::Drugs::Init
LIMITED =
false
RESOLVE_STATES =
{
  [ :analysis_group, :position ]  => State::Analysis::Position,
  [ :analysis_group ]   => State::Analysis::Group,
  [ :company ]  => State::Companies::Company,
  [ :doctor ]  => State::Doctors::Doctor,
  [ :hospital ]  => State::Hospitals::Hospital,
  [ :fachinfo ] =>  State::Drugs::Fachinfo,
  [ :registration, :sequence, 
    :package, :sl_entry, 
    :limitation_text ] =>  State::Drugs::LimitationText,
  [ :migel_group, :subgroup, 
    :product ] =>  State::Migel::Product,
  [ :migel_group, :subgroup] => State::Migel::Subgroup,
  [ :migel_group] => State::Migel::Group,
  [ :migel_group, :subgroup, :product, 
    :limitation_text ] =>  State::Migel::LimitationText,
  [ :migel_group, :subgroup, 
    :limitation_text ] =>  State::Migel::LimitationText,
  [ :migel_group,
    :limitation_text ] => State::Migel::LimitationText,
  [ :minifi ] =>  State::Drugs::MiniFi,
  [ :narcotic ] =>  State::Drugs::Narcotic,
  [ :patinfo ]  => State::Drugs::Patinfo,
  [ :registration, :sequence, 
    :package, :narcotics ] =>  State::Drugs::NarcoticPlus,
}
READONLY_STATES =
RESOLVE_STATES.dup.update({
[ :registration ]                      => State::Drugs::Registration,
[ :registration, :sequence, ]          => State::Drugs::Sequence,
[ :registration, :sequence, :package ] => State::Drugs::Package, })
{
  [ :fachinfo ] =>  State::Drugs::FachinfoPrint,
  [ :patinfo ]  => State::Drugs::PatinfoPrint,
}
REVERSE_MAP =
{}
VIEW =
View::Search
ZONE_NAVIGATION =
[]

Constants included from UmlautSort

FILTER_PAIRS

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Admin::LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Attribute Details

- (Object) model

Returns the value of attribute model



92
93
94
# File 'src/state/global.rb', line 92

def model
  @model
end

- (Object) snapback_model (readonly)

Returns the value of attribute snapback_model



92
93
94
# File 'src/state/global.rb', line 92

def snapback_model
  @snapback_model
end

Instance Method Details

- (Object) _search_drugs(query, stype)



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
# File 'src/state/global.rb', line 538

def _search_drugs(query, stype)
  case stype
  when 'st_sequence'
    @session.search_exact_sequence(query)
  when 'st_substance'
    @session.search_exact_substance(query)
  when 'st_company'
    @session.search_exact_company(query)
  when 'st_indication'
    @session.search_exact_indication(query)
  when 'st_interaction'
    @session.search_by_interaction(query, @session.language)
  when 'st_unwanted_effect'
    @session.search_by_unwanted_effect(query, @session.language)
  else
    @session.search_oddb(query)
  end
end

- (Object) _search_drugs_state(query, stype)



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'src/state/global.rb', line 556

def _search_drugs_state(query, stype)
  if(stype == "st_registration" && (reg = @session.registration(query)))
    if(allowed?(reg))
      State::Admin::Registration.new(@session, reg)
    elsif(pac = reg.active_packages.sort_by { |pc| pc.ikscd }.first)
      State::Drugs::Package.new(@session, pac)
    else
      State::Drugs::Registration.new(@session, reg)
    end
  elsif(stype == "st_pharmacode" && (pac = @session.package(query)))
    if(allowed?(pac))
      State::Admin::Package.new(@session, pac)
    else
      State::Drugs::Package.new(@session, pac)
    end
  else
    result = _search_drugs(query, stype)
    if @session.lookandfeel.has_result_filter?
      lnf = @session.lookandfeel
      filter_proc = Proc.new do |seq| lnf.result_filter seq end
      result.filter! filter_proc
    end
    state = State::Drugs::Result.new(@session, result)
    state.search_query = query
    state.search_type = stype
    state
  end
end

- (Object) _trigger(event)



642
643
644
645
646
# File 'src/state/global.rb', line 642

def _trigger(event)
  super || Http404.new(@session, nil)
rescue Persistence::UninitializedPathError
  Http404.new(@session, nil)
end

- (Object) add_to_interaction_basket



176
177
178
179
180
181
182
# File 'src/state/global.rb', line 176

def add_to_interaction_basket
  pointer = @session.user_input(:pointer)
  if(object = pointer.resolve(@session.app))
    @session.add_to_interaction_basket(object)
  end
  self
end

- (Boolean) allowed?(test = @model)

Returns:

  • (Boolean)


183
184
185
186
187
188
# File 'src/state/global.rb', line 183

def allowed?(test = @model)
  if(test.is_a?(Persistence::CreateItem)) 
    test = test.parent(@session.app)
  end
  @session.allowed?('edit', test)
end

- (Object) atc_chooser



189
190
191
192
# File 'src/state/global.rb', line 189

def atc_chooser
  mdl = @session.app.atc_chooser
  State::Drugs::AtcChooser.new(@session, mdl)
end

- (Object) checkout



193
194
195
196
197
198
199
200
# File 'src/state/global.rb', line 193

def checkout
  case @session.zone
  when :user
    proceed_download.checkout
  when :drugs
    export_csv.checkout
  end
end

- (Object) clear_interaction_basket



201
202
203
204
# File 'src/state/global.rb', line 201

def clear_interaction_basket
  @session.clear_interaction_basket
  State::Interactions::EmptyBasket.new(@session, [])
end

- (Boolean) creditable?(item = @model)

Returns:

  • (Boolean)


205
206
207
# File 'src/state/global.rb', line 205

def creditable?(item = @model)
  @session.user.creditable?(item)
end

- (Object) direct_request_path



208
209
210
211
212
213
214
# File 'src/state/global.rb', line 208

def direct_request_path
  if(event = self.direct_event)
    @session.lookandfeel._event_url(event)
  else
    self.request_path
  end
end

- (Object) doctorlist



215
216
217
218
# File 'src/state/global.rb', line 215

def doctorlist
  model = @session.doctors.values
  State::Doctors::DoctorList.new(@session, model)
end

- (Object) download



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'src/state/global.rb', line 219

def download
  if(@session.is_crawler?)
    return State::Drugs::Init.new(@session, nil)
  end
   = @session.user_input(:email)
   ||= @session.get_cookie_input(:email)
  oid = @session.user_input(:invoice)
  file = @session.user_input(:filename)
  if((invoice = @session.invoice(oid)) \
    && invoice.yus_name ==  \
    && invoice.payment_received? \
    && (item = invoice.item_by_text(file)) \
    && !item.expired?)
    State::User::Download.new(@session, item)
  else
    State::PayPal::Return.new(@session, invoice)
  end
end

- (Object) export_csv



241
242
243
244
245
246
247
248
# File 'src/state/global.rb', line 241

def export_csv
  if(@session.zone == :drugs)
    state = self.search
    if(state.is_a?(State::Drugs::Result))
      state.export_csv
    end
  end
end

- (Object) extend(mod)



249
250
251
252
253
254
# File 'src/state/global.rb', line 249

def extend(mod)
  if(mod.constants.include?('VIRAL'))
    @viral_module = mod 
  end
  super
end

- (Object) fachinfo



255
256
257
258
259
260
261
262
263
# File 'src/state/global.rb', line 255

def fachinfo
  if (iksnr = @session.user_input(:swissmedicnr)) \
    && (reg = @session.app.registration(iksnr)) \
    && fachinfo = reg.fachinfo
    State::Drugs::Fachinfo.new(@session, fachinfo)
  else
    Http404.new(@session, nil)
  end
end

- (Object) feedbacks



264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'src/state/global.rb', line 264

def feedbacks
  if((pointer = @session.user_input(:pointer)) \
    && pointer.is_a?(Persistence::Pointer) \
    && (item = pointer.resolve(@session.app)))
    case item.odba_instance
    when ODDB::Package
      State::Drugs::Feedbacks.new(@session, item)
    when ODDB::Migel::Product
      State::Migel::Feedbacks.new(@session, item)
    #when ODDB::Analysis::Position
    #  State::Analysis::Feedbacks.new(@session, item)
    end
  end
end

- (Object) help_navigation



292
293
294
295
296
297
# File 'src/state/global.rb', line 292

def help_navigation
  [
    :help_link,
    :faq_link,
  ]
end

- (Object) home_navigation



298
299
300
301
302
# File 'src/state/global.rb', line 298

def home_navigation
  [
    self.home_state
  ]
end

- (Object) home_state



303
304
305
# File 'src/state/global.rb', line 303

def home_state
  self::class::HOME_STATE
end

- (Object) hospitallist



237
238
239
240
# File 'src/state/global.rb', line 237

def hospitallist
  model = @session.hospitals.values
  State::Hospitals::HospitalList.new(@session, model)
end

- (Object) interaction_basket



306
307
308
309
310
311
312
# File 'src/state/global.rb', line 306

def interaction_basket
  if((array = @session.interaction_basket).empty?)
    State::Interactions::EmptyBasket.new(@session, array)
  else
    State::Interactions::Basket.new(@session, array)
  end
end

- (Object) limit_state



316
317
318
# File 'src/state/global.rb', line 316

def limit_state
  State::User::Limit.new(@session, nil)
end

- (Boolean) limited?

Returns:

  • (Boolean)


313
314
315
# File 'src/state/global.rb', line 313

def limited?
  self.class.const_get(:LIMITED)
end

- (Object) logout



319
320
321
322
# File 'src/state/global.rb', line 319

def logout
  user = @session.logout
  State::Drugs::Init.new(@session, user)
end


323
324
325
# File 'src/state/global.rb', line 323

def navigation
  #+ zone_navigation          help_navigation          + user_navigation          + home_navigation
end

- (Object) notify



278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'src/state/global.rb', line 278

def notify 
  if((pointer = @session.user_input(:pointer)) \
    && pointer.is_a?(Persistence::Pointer) \
    && (item = pointer.resolve(@session.app)))
    case item.odba_instance
    when ODDB::Package
      State::Drugs::Notify.new(@session, item)
    when ODDB::Migel::Product
      State::Migel::Notify.new(@session, item)
    when ODDB::Analysis::Position
      State::Analysis::Notify.new(@session, item)
    end
  end
end

- (Object) password_reset



329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'src/state/global.rb', line 329

def password_reset
  keys = [:token, :email]
  input = user_input(keys, keys)
  unless(error?)
     = input[:email]
    token = input[:token]
    if(@session.yus_allowed?(, 'reset_password', token))
      model = OpenStruct.new
      model.token = token
      model. = 
      State::Admin::PasswordReset.new(@session, model)
    end
  end
end

- (Object) paypal_return



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'src/state/global.rb', line 343

def paypal_return
  if(@session.is_crawler?)
    State::Drugs::Init.new(@session, nil)
  elsif((id = @session.user_input(:invoice)) \
    && (invoice = @session.invoice(id)))
    state = State::PayPal::Return.new(@session, invoice)
    if(invoice.types.all? { |type| type == :poweruser } \
      && @session.allowed?('view', 'org.oddb') \
      && (des = @session.desired_state))
      # since the permissions of the current User may have changed, we
      # need to reconsider his viral modules
      if((user = @session.user).is_a?(YusUser))
        reconsider_permissions(user, des)
      end
      state = des
    end
    state
  else
    State::PayPal::Return.new(@session, nil)
  end
end


364
365
366
367
368
369
370
# File 'src/state/global.rb', line 364

def powerlink
  pointer = @session.user_input(:pointer)
  unless(error?)
    comp = pointer.resolve(@session.app)
    State::User::PowerLink.new(@session, comp)
  end
end


371
372
373
374
375
376
377
378
379
# File 'src/state/global.rb', line 371

def print
  pointer = @session.user_input(:pointer)
  begin
    if((model = pointer.resolve(@session.app)) \
      && (klass = resolve_state(pointer, :print)))
      klass.new(@session, model)
    end
  end
end

- (Object) proceed_download



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'src/state/global.rb', line 380

def proceed_download
  keys = [:download, :months, :compression]
  input = user_input(keys, keys) 
  items = []
  dir = File.expand_path('../../data/downloads', 
    File.dirname(__FILE__))
  compression = input[:compression]
  if(files = input[:download])
    files.each { |filename, val|
      if(val)
        item = AbstractInvoiceItem.new
        suffix = ''
        unless DOWNLOAD_UNCOMPRESSED.include?(filename)
          suffix = case compression
          when 'compr_gz'
            ['.gz', '.tar.gz'].select { |sfx|
              File.exist?(File.join(dir, filename + sfx))
            }.first
          else
            '.zip'
          end
        end
        item.text = filename + suffix
        item.type = :download
        item.unit = 'Download'
        item.vat_rate = VAT_RATE
        months = input[:months][filename]
        item.quantity = months.to_f
        price_mth = 'price'
        duration_mth = 'duration'
        if(months == '12')
          price_mth = 'subscription_' << price_mth
          duration_mth = 'subscription_' << duration_mth
        end
        klass = State::User::DownloadExport
        item.total_netto = klass.send(price_mth, filename)
        item.duration = klass.send(duration_mth, filename)
        items.push(item)
      end
    }
  end
  if(items.empty?)
    @errors.store(:download, create_error('e_no_download_selected', 
      :download, nil))
  end
  if(error?)
    self
  else
    pointer = Persistence::Pointer.new(:invoice)
    invoice = Persistence::CreateItem.new(pointer)
    invoice.carry(:items, items)
    # experimental Implementation of Invoiced Download. 
    # Does not work yet, because an Invoice-Id is needed for downloading,
    # but no invoice is created until the next run of DownloadInvoicer
    #if(creditable?('org.oddb.download'))
    #  State::User::PaymentMethod.new(@session, invoice)
    #else
      State::User::RegisterDownload.new(@session, invoice)
    #end
  end
end

- (Object) proceed_poweruser



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'src/state/global.rb', line 441

def proceed_poweruser
  keys = [:days]
  input = user_input(keys, keys)
  unless(error?)
    days = input[:days].to_i
    item = AbstractInvoiceItem.new
    item.text = "unlimited access"
    item.type = :poweruser
    item.vat_rate = VAT_RATE
    item.quantity = days
    item.duration = days
    item.total_netto = State::Limit.price(days)
    pointer = Persistence::Pointer.new(:invoice)
    invoice = Persistence::CreateItem.new(pointer)
    invoice.carry(:items, [item])
    if(usr = @session.user_input(:pointer))
      State::User::RenewPowerUser.new(@session, invoice)
    else
      State::User::RegisterPowerUser.new(@session, invoice)
    end
  end
end

- (Object) resolve



463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'src/state/global.rb', line 463

def resolve
  if(@session.request_path == @request_path)
    self
  elsif((pointer = @session.user_input(:pointer)) \
    && pointer.is_a?(Persistence::Pointer) \
    && (model = pointer.resolve(@session.app)))
    if(klass = resolve_state(pointer))
      klass.new(@session, model)
    else
      State::Admin::TransparentLogin.new(@session, model)
    end
  end
end

- (Object) resolve_state(pointer, type = :standard)



476
477
478
479
480
481
482
483
484
# File 'src/state/global.rb', line 476

def resolve_state(pointer, type=:standard)
  state_map = {
    :standard  => self::class::RESOLVE_STATES,
    :readonly  => self::class::READONLY_STATES,
    :print   => self::class::PRINT_STATES,
  }
  type = :standard unless(state_map.include?(type))
  state_map[type][pointer.skeleton]
end

- (Object) rss



485
486
487
488
489
490
491
492
493
494
# File 'src/state/global.rb', line 485

def rss
  if(channel = @session.user_input(:channel))
    key = channel.gsub('.', '_').to_sym
    if(@session.lookandfeel.enabled?(key))
      Rss::PassThru.new(@session, channel)
    else
      Http404.new(@session, nil)
    end
  end
end

- (Object) search Also known as: result



495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'src/state/global.rb', line 495

def search
  zone = @session.zone
  query = @session.persistent_user_input(:search_query)
  if(query.is_a? RuntimeError)
    State::Exception.new(@session, query)
  elsif(!query.nil?)
    query = ODDB.search_term(query)
    case zone
    when :hospitals
      result = @session.search_hospitals(query)
      State::Hospitals::HospitalResult.new(@session, result)
    when :doctors
      result = @session.search_doctors(query)
      State::Doctors::DoctorResult.new(@session, result)
    when :companies
      result = @session.search_companies(query)
      State::Companies::CompanyResult.new(@session, result)
    when :interactions
      result = @session.search_interactions(query)
      State::Interactions::Result.new(@session, result)
    when :substances
      result = @session.search_substances(query)
      State::Substances::Result.new(@session, result)
    when :migel
      result = @session.search_migel_products(query)
      State::Migel::Result.new(@session, result)
    when :analysis
      result = @session.search_analysis(query, @session.language)
      State::Analysis::Result.new(@session, result)
    else
      query = query.to_s.downcase.gsub(/\s+/u, ' ')
      stype = @session.user_input(:search_type) 
      _search_drugs_state(query, stype)
    end
  else
    self
  end
rescue ODBA::OdbaResultLimitError
  exception = SBSM::InvalidDataError.new(:e_huge_search_result,
                                         :search_query, query)
  State::Exception.new(@session, exception)
end

- (Object) show



584
585
586
587
588
589
590
591
592
593
# File 'src/state/global.rb', line 584

def show
  if(@session.request_path == @request_path)
    self
  elsif((pointer = @session.user_input(:pointer)) \
    && pointer.is_a?(Persistence::Pointer) \
    && (model = pointer.resolve(@session.app)) \
    && klass = resolve_state(pointer, :readonly))
    klass.new(@session, model)
  end
end

- (Object) snapback_event



594
595
596
597
598
599
600
# File 'src/state/global.rb', line 594

def snapback_event
  if(defined?(self.class::SNAPBACK_EVENT))
    self.class::SNAPBACK_EVENT
  else
    self.class::DIRECT_EVENT
  end
end

- (Object) sort



601
602
603
604
605
606
607
# File 'src/state/global.rb', line 601

def sort
  return self unless @model.is_a? Array
  get_sortby!
  @model.sort! { |a, b| compare_entries(a, b) }
  @model.reverse! if(@sort_reverse)
  self
end


608
609
610
611
612
# File 'src/state/global.rb', line 608

def sponsorlink
  if(( = @session.) && .valid?)
    State::User::SponsorLink.new(@session, )
  end
end

- (Object) suggest_address



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'src/state/global.rb', line 613

def suggest_address
  keys = [:pointer]
  input = user_input(keys, keys)
  pointer = input[:pointer]
  if(!error?) 
    addr = pointer.resolve(@session)
    if(addr.nil?)
      ## simulate an address
      addr = Address2.new
      if(parent = pointer.parent.resolve(@session))
        addr.name = parent.fullname
      end
      addr.pointer = pointer
    end
    SuggestAddress.new(@session, addr)
  end 
end

- (Object) switch



630
631
632
633
634
635
636
637
638
639
640
641
# File 'src/state/global.rb', line 630

def switch
  state = self.trigger(self.direct_event)
  if(state.zone == @session.zone)
    state
  else
    event = [
      'home',
      @session.zone
    ].compact.join('_').intern
    self.trigger(event)
  end
end

- (Object) unique_email



647
648
649
650
651
652
# File 'src/state/global.rb', line 647

def unique_email
  user = @session.user
  if(user.respond_to?(:unique_email))
    user.unique_email
  end
end

- (Object) user_input(keys = [], mandatory = [])



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'src/state/global.rb', line 653

def user_input(keys=[], mandatory=[])
  keys = [keys] unless keys.is_a?(Array)
  mandatory = [mandatory] unless mandatory.is_a?(Array)
  hash = @session.user_input(*keys)
  hash ||= {}
  unless(hash.is_a?(Hash))
    hash = {keys.first => hash}
  end
  keys.each { |key| 
    carryval = nil
    value = hash[key]
    if(value.is_a? RuntimeError)
      carryval = value.value
      @errors.store(key, hash.delete(key))
    elsif(mandatory.include?(key) && mandatory_violation(value))
      error = create_error('e_missing_' << key.to_s, key, value)
      @errors.store(key, error)
      hash.delete(key)
    else
      carryval = value
    end
    if(@model.is_a? Persistence::CreateItem)
      @model.carry(key, carryval)
    end
  }
  hash
end

- (Object) user_navigation



680
681
682
683
684
685
# File 'src/state/global.rb', line 680

def user_navigation
  [
    State::Admin::,
    State::User::YweseeContact,
  ]
end

- (Object) ywesee_contact



686
687
688
689
# File 'src/state/global.rb', line 686

def ywesee_contact
  model = nil
  State::User::YweseeContact.new(@session, model)
end

- (Object) zone_navigation



693
694
695
# File 'src/state/global.rb', line 693

def zone_navigation
  self::class::ZONE_NAVIGATION
end

- (Object) zones



690
691
692
# File 'src/state/global.rb', line 690

def zones
[ :analysis, :doctors, :interactions, :drugs, :migel, :user , :hospitals, :companies]
end