Class: AQI::AnesthesiaStaff
- Inherits:
-
Object
- Object
- AQI::AnesthesiaStaff
- Defined in:
- lib/aqi/anesthesia_staff.rb
Instance Attribute Summary collapse
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#responsibility ⇒ Object
Returns the value of attribute responsibility.
-
#role ⇒ Object
Returns the value of attribute role.
-
#sign_in ⇒ Object
Returns the value of attribute sign_in.
-
#sign_out ⇒ Object
Returns the value of attribute sign_out.
-
#staff_id ⇒ Object
Returns the value of attribute staff_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ AnesthesiaStaff
constructor
A new instance of AnesthesiaStaff.
- #to_xml ⇒ Object
- #validate_responsibility(value) ⇒ Object
- #validate_role(value) ⇒ Object
Constructor Details
#initialize(options) ⇒ AnesthesiaStaff
Returns a new instance of AnesthesiaStaff.
13 14 15 16 17 18 19 20 |
# File 'lib/aqi/anesthesia_staff.rb', line 13 def initialize() self.staff_id = [:staff_id] self.responsibility = validate_responsibility([:responsibility]) self.role = validate_role([:role]) self.sign_in = [:sign_in] self.sign_out = [:sign_out] self.notes = [:notes] end |
Instance Attribute Details
#notes ⇒ Object
Returns the value of attribute notes.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def notes @notes end |
#responsibility ⇒ Object
Returns the value of attribute responsibility.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def responsibility @responsibility end |
#role ⇒ Object
Returns the value of attribute role.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def role @role end |
#sign_in ⇒ Object
Returns the value of attribute sign_in.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def sign_in @sign_in end |
#sign_out ⇒ Object
Returns the value of attribute sign_out.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def sign_out @sign_out end |
#staff_id ⇒ Object
Returns the value of attribute staff_id.
3 4 5 |
# File 'lib/aqi/anesthesia_staff.rb', line 3 def staff_id @staff_id end |
Class Method Details
.responsibilities ⇒ Object
5 6 7 |
# File 'lib/aqi/anesthesia_staff.rb', line 5 def self.responsibilities ["Supervisory", "Monitoring", "Administrative", "In charge", "Performing the case", "Medically responsible"] end |
.roles ⇒ Object
9 10 11 |
# File 'lib/aqi/anesthesia_staff.rb', line 9 def self.roles ["MD", "CRNA", "DO", "RESIDENT", "PACU Nurse", "AA"] end |
Instance Method Details
#to_xml ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aqi/anesthesia_staff.rb', line 30 def to_xml builder = Builder::XmlMarkup.new builder.AnesthesiaStaff do |as| as.StaffID(staff_id) as.StaffResponsibility(responsibility) if responsibility as.StaffRole(role) if role as.StaffSignIn(sign_in.strftime('%FT%T')) if sign_in as.StaffSignOut(sign_out.strftime('%FT%T')) if sign_out as.StaffNotes(notes) if notes end end |
#validate_responsibility(value) ⇒ Object
22 23 24 |
# File 'lib/aqi/anesthesia_staff.rb', line 22 def validate_responsibility(value) self.class.responsibilities.include?(value) ? value : nil end |
#validate_role(value) ⇒ Object
26 27 28 |
# File 'lib/aqi/anesthesia_staff.rb', line 26 def validate_role(value) self.class.roles.include?(value) ? value : nil end |