Class: AQI::AnesthesiaRecords
- Inherits:
-
Object
- Object
- AQI::AnesthesiaRecords
- Defined in:
- lib/aqi/anesthesia_records.rb
Instance Attribute Summary collapse
-
#encounters ⇒ Object
Returns the value of attribute encounters.
-
#practice_id ⇒ Object
Returns the value of attribute practice_id.
Instance Method Summary collapse
- #anesthesia_records ⇒ Object
-
#initialize(options = {}) ⇒ AnesthesiaRecords
constructor
A new instance of AnesthesiaRecords.
- #record_header ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ AnesthesiaRecords
Returns a new instance of AnesthesiaRecords.
5 6 7 8 |
# File 'lib/aqi/anesthesia_records.rb', line 5 def initialize( = {}) self.encounters = .delete(:encounters) self.practice_id = .delete(:practice_id) end |
Instance Attribute Details
#encounters ⇒ Object
Returns the value of attribute encounters.
3 4 5 |
# File 'lib/aqi/anesthesia_records.rb', line 3 def encounters @encounters end |
#practice_id ⇒ Object
Returns the value of attribute practice_id.
3 4 5 |
# File 'lib/aqi/anesthesia_records.rb', line 3 def practice_id @practice_id end |
Instance Method Details
#anesthesia_records ⇒ Object
14 15 16 |
# File 'lib/aqi/anesthesia_records.rb', line 14 def anesthesia_records encounters.collect{|e| AnesthesiaRecord.new(e)} end |
#record_header ⇒ Object
10 11 12 |
# File 'lib/aqi/anesthesia_records.rb', line 10 def record_header RecordHeader.new(practice_id).to_xml end |
#to_xml ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/aqi/anesthesia_records.rb', line 18 def to_xml builder = Builder::XmlMarkup.new builder.instruct! builder.AnesthesiaRecords do |ars| ars << record_header anesthesia_records.each do |anes_record| ars << anes_record.to_xml end end end |