Class: ODDB::MedData::DetailWriter

Inherits:
NullWriter
  • Object
show all
Defined in:
ext/meddata/src/meddparser.rb

Instance Method Summary collapse

Constructor Details

#initializeDetailWriter

Returns a new instance of DetailWriter.



64
65
66
# File 'ext/meddata/src/meddparser.rb', line 64

def initialize
	@tablehandlers = []
end

Instance Method Details

#extract_data(template) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'ext/meddata/src/meddparser.rb', line 67

def extract_data(template)
	data = {}
	@tablehandlers.each { |handler|
		unless(handler.nil?)
			id = handler.attributes.first[1]
			if(id.match(/tblFind/u) || id.match(/Table2/u))
				data = handler.extract_cdata(template)
			end
		end
	}
	data
end

#new_tablehandler(handler) ⇒ Object



79
80
81
82
# File 'ext/meddata/src/meddparser.rb', line 79

def new_tablehandler(handler)
	@current_tablehandler = handler
	@tablehandlers.push(handler)
end

#send_flowing_data(data) ⇒ Object



83
84
85
86
87
# File 'ext/meddata/src/meddparser.rb', line 83

def send_flowing_data(data) 
	unless(@current_tablehandler.nil?)
		@current_tablehandler.send_cdata(data)
	end
end