Class: AQI::AnesthesiaCase
- Inherits:
-
Object
- Object
- AQI::AnesthesiaCase
- Defined in:
- lib/aqi/anesthesia_case.rb
Instance Attribute Summary collapse
-
#anesthesia_coverage ⇒ Object
Returns the value of attribute anesthesia_coverage.
-
#anesthesia_record_id ⇒ Object
Returns the value of attribute anesthesia_record_id.
-
#anesthesia_staff_set ⇒ Object
Returns the value of attribute anesthesia_staff_set.
-
#monitoring_set ⇒ Object
Returns the value of attribute monitoring_set.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ AnesthesiaCase
constructor
A new instance of AnesthesiaCase.
- #to_xml ⇒ Object
- #validate_anesthesia_coverage(value) ⇒ Object
Constructor Details
#initialize(options) ⇒ AnesthesiaCase
Returns a new instance of AnesthesiaCase.
10 11 12 13 14 15 |
# File 'lib/aqi/anesthesia_case.rb', line 10 def initialize() self.anesthesia_record_id = [:anesthesia_record_id] self.anesthesia_coverage = validate_anesthesia_coverage([:anesthesia_coverage]) self.anesthesia_staff_set = [:anesthesia_staff_set] || [] self.monitoring_set = [:monitoring_set] || [] end |
Instance Attribute Details
#anesthesia_coverage ⇒ Object
Returns the value of attribute anesthesia_coverage.
3 4 5 |
# File 'lib/aqi/anesthesia_case.rb', line 3 def anesthesia_coverage @anesthesia_coverage end |
#anesthesia_record_id ⇒ Object
Returns the value of attribute anesthesia_record_id.
3 4 5 |
# File 'lib/aqi/anesthesia_case.rb', line 3 def anesthesia_record_id @anesthesia_record_id end |
#anesthesia_staff_set ⇒ Object
Returns the value of attribute anesthesia_staff_set.
3 4 5 |
# File 'lib/aqi/anesthesia_case.rb', line 3 def anesthesia_staff_set @anesthesia_staff_set end |
#monitoring_set ⇒ Object
Returns the value of attribute monitoring_set.
3 4 5 |
# File 'lib/aqi/anesthesia_case.rb', line 3 def monitoring_set @monitoring_set end |
Class Method Details
.anesthesia_coverages ⇒ Object
5 6 7 8 |
# File 'lib/aqi/anesthesia_case.rb', line 5 def self.anesthesia_coverages ["MD-ALONE", "MD-DIRECTING", "CRNA-DIRECTED", "CRNA-ALONE", "MD-SUPERVISING", "CRNA-DIRECTING", "MD-MD"] end |
Instance Method Details
#to_xml ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/aqi/anesthesia_case.rb', line 21 def to_xml builder = Builder::XmlMarkup.new builder.AnesthesiaCase do |ac| ac.AnesthesiaRecordID(anesthesia_record_id) ac.AnesthesiaCoverage(anesthesia_coverage) if anesthesia_coverage ac.AnesthesiaStaffSet do |ass| anesthesia_staff_set.each do |as| ass << as.to_xml end end end end |
#validate_anesthesia_coverage(value) ⇒ Object
17 18 19 |
# File 'lib/aqi/anesthesia_case.rb', line 17 def validate_anesthesia_coverage(value) self.class.anesthesia_coverages.include?(value) ? value : nil end |