Class: ODDB::OdbaExporter::AcscLine

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

Constant Summary collapse

LENGTH =
10

Instance Method Summary collapse

Methods inherited from Line

#content, #empty?, #to_s

Constructor Details

#initialize(package, active_agent, count) ⇒ AcscLine

Returns a new instance of AcscLine.



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

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

Instance Method Details

#structureObject



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

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