Class: PreOp
- Inherits:
-
Object
- Object
- PreOp
- Defined in:
- lib/aqi/pre_op.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#asa_class ⇒ Object
Returns the value of attribute asa_class.
-
#height_inches ⇒ Object
Returns the value of attribute height_inches.
-
#icd_set ⇒ Object
Returns the value of attribute icd_set.
-
#pre_anesthesia_status ⇒ Object
Returns the value of attribute pre_anesthesia_status.
-
#pre_risk_set ⇒ Object
Returns the value of attribute pre_risk_set.
-
#weight_pounds ⇒ Object
Returns the value of attribute weight_pounds.
Class Method Summary collapse
Instance Method Summary collapse
- #height_in_cm ⇒ Object
-
#initialize(options) ⇒ PreOp
constructor
A new instance of PreOp.
- #to_xml ⇒ Object
- #weight_in_kg ⇒ Object
Constructor Details
#initialize(options) ⇒ PreOp
Returns a new instance of PreOp.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/aqi/pre_op.rb', line 26 def initialize() self.age = validate_age(.delete(:age)) self.weight_pounds = .delete(:weight_pounds) self.height_inches = .delete(:height_inches) self.asa_class = validate_asa_class(.delete(:asa_class)) self.pre_anesthesia_status = validate_pre_anesthesia_status(.delete(:pre_anesthesia_status)) self.icd_set = setup_icd_set(.delete(:icd_set)) self.pre_risk_set = setup_pre_risk_set(.delete(:pre_risk_set)) end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def age @age end |
#asa_class ⇒ Object
Returns the value of attribute asa_class.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def asa_class @asa_class end |
#height_inches ⇒ Object
Returns the value of attribute height_inches.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def height_inches @height_inches end |
#icd_set ⇒ Object
Returns the value of attribute icd_set.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def icd_set @icd_set end |
#pre_anesthesia_status ⇒ Object
Returns the value of attribute pre_anesthesia_status.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def pre_anesthesia_status @pre_anesthesia_status end |
#pre_risk_set ⇒ Object
Returns the value of attribute pre_risk_set.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def pre_risk_set @pre_risk_set end |
#weight_pounds ⇒ Object
Returns the value of attribute weight_pounds.
24 25 26 |
# File 'lib/aqi/pre_op.rb', line 24 def weight_pounds @weight_pounds end |
Class Method Details
.asa_classes ⇒ Object
37 38 39 |
# File 'lib/aqi/pre_op.rb', line 37 def self.asa_classes ["I", "II", "III", "IV", "V", "VI", "IE", "IIE", "IIIE", "IVE", "VE", "VIE"] end |
.pre_anesthesia_statuses ⇒ Object
41 42 43 |
# File 'lib/aqi/pre_op.rb', line 41 def self.pre_anesthesia_statuses ["Awake", "Awake", "Asleep", "Confused", "Unresponsive", "Apprehensive", "Uncooperative", "OTHER", "UNKNOWN"] end |
Instance Method Details
#height_in_cm ⇒ Object
45 46 47 |
# File 'lib/aqi/pre_op.rb', line 45 def height_in_cm self.height_inches.to_f / 0.3937 end |
#to_xml ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/aqi/pre_op.rb', line 53 def to_xml builder = Builder::XmlMarkup.new builder.PreOp do |pre| pre.Age(age) if age pre.Weight(weight_pounds) if weight_pounds pre.WeightInKg(weight_in_kg) if weight_pounds pre.Height(height_inches) if height_inches pre.HeightInCm(height_in_cm) if height_inches pre.ASAClass(asa_class) if asa_class pre.PreAnesthStatus(pre_anesthesia_status) if pre_anesthesia_status pre.ICDSet do |set| icd_set.each do |icd| set << icd.to_xml end end pre.PreRiskSet do |set| pre_risk_set.each do |prs| set << prs.to_xml end end # pre.PreLabSet end end |
#weight_in_kg ⇒ Object
49 50 51 |
# File 'lib/aqi/pre_op.rb', line 49 def weight_in_kg self.weight_pounds.to_f / 0.45359 end |