Class: ODDB::OdbaExporter::AcscLine

Inherits:
SubstanceLine show all
Defined in:
ext/export/src/oddbdat.rb

Constant Summary

LENGTH =
10

Instance Method Summary (collapse)

Methods inherited from Line

#content, #empty?, #to_s

Constructor Details

- (AcscLine) initialize(package, active_agent, count)

A new instance of AcscLine



504
505
506
507
# File 'ext/export/src/oddbdat.rb', line 504

def initialize(package, active_agent, count)
  @count = count
  super
end

Instance Method Details

- (Object) structure



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'ext/export/src/oddbdat.rb', line 508

def structure
  return if @substance.nil?
  qty, unit = if((dose = @substance.dose) && dose.is_a?(Quanty))
    [dose.qty, dose.unit]
  end
  {
    1    =>  '41',
    2    =>  @date,
    3    =>  @package.oid,
    4    =>  @count,
    5    =>  '4',
    6    =>  @substance.substance.oid,
    7    =>  qty,
    8    =>  unit,
    9    =>  'W',
  }
end