Class: AQI::Outcome
- Inherits:
-
Object
- Object
- AQI::Outcome
- Defined in:
- lib/aqi/outcome.rb
Instance Attribute Summary collapse
-
#category_code ⇒ Object
Returns the value of attribute category_code.
-
#description ⇒ Object
Returns the value of attribute description.
-
#location_type_code ⇒ Object
Returns the value of attribute location_type_code.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#range_max ⇒ Object
Returns the value of attribute range_max.
-
#range_min ⇒ Object
Returns the value of attribute range_min.
-
#severity_code ⇒ Object
Returns the value of attribute severity_code.
-
#sub_category_code ⇒ Object
Returns the value of attribute sub_category_code.
-
#time_date ⇒ Object
Returns the value of attribute time_date.
-
#time_frame ⇒ Object
Returns the value of attribute time_frame.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
- .categories ⇒ Object
- .location_codes ⇒ Object
- .severities ⇒ Object
- .sub_categories ⇒ Object
- .time_frames ⇒ Object
Instance Method Summary collapse
-
#initialize(options) ⇒ Outcome
constructor
A new instance of Outcome.
- #to_xml ⇒ Object
Constructor Details
#initialize(options) ⇒ Outcome
Returns a new instance of Outcome.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/aqi/outcome.rb', line 5 def initialize() self.time_date = .delete(:time_date) self.time_frame = .delete(:time_frame) self.severity_code = .delete(:severity_code) self.category_code = .delete(:category_code) self.sub_category_code = .delete(:sub_category_code) self.location_type_code = .delete(:location_type_code) self.name = .delete(:name) self.description = .delete(:description) self.value = .delete(:value) self.range_min = .delete(:range_min) self.range_max = .delete(:range_max) self.notes = .delete(:notes) end |
Instance Attribute Details
#category_code ⇒ Object
Returns the value of attribute category_code.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def category_code @category_code end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def description @description end |
#location_type_code ⇒ Object
Returns the value of attribute location_type_code.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def location_type_code @location_type_code end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def notes @notes end |
#range_max ⇒ Object
Returns the value of attribute range_max.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def range_max @range_max end |
#range_min ⇒ Object
Returns the value of attribute range_min.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def range_min @range_min end |
#severity_code ⇒ Object
Returns the value of attribute severity_code.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def severity_code @severity_code end |
#sub_category_code ⇒ Object
Returns the value of attribute sub_category_code.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def sub_category_code @sub_category_code end |
#time_date ⇒ Object
Returns the value of attribute time_date.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def time_date @time_date end |
#time_frame ⇒ Object
Returns the value of attribute time_frame.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def time_frame @time_frame end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/aqi/outcome.rb', line 3 def value @value end |
Class Method Details
.categories ⇒ Object
28 29 30 |
# File 'lib/aqi/outcome.rb', line 28 def self.categories ["PatientSurvey", "Outcome", "OTHER", "UNKNOWN"] end |
.location_codes ⇒ Object
36 37 38 |
# File 'lib/aqi/outcome.rb', line 36 def self.location_codes ["In-Patient", "Post In-Patient", "Out-Patient", "Post Out-Patient", "Obstetrics", "Surgery Center", "Surgery Center Post Out-Patient", "Office", "Home", "Ambulatory Surgical Center", "Pharmacy", "Skilled Nursing Facility", "Ambulance - Land", "Emergency Room Hospital", "Urgent Care Facility", "Inpatient Psychiatric Facility", "School", "Custodial Care Facility", "Residential Substance Abuse Treatment Facility", "Military Treatment Facility", "OTHER", "UNKNOWN"] end |
.severities ⇒ Object
24 25 26 |
# File 'lib/aqi/outcome.rb', line 24 def self.severities ["NoEffect", "PotentialHazard", "LossOfTime", "LossOfMoney", "HarmToPatient", "SevereHarmToPatient", "PermanentDisability", "Death"] end |
.sub_categories ⇒ Object
32 33 34 |
# File 'lib/aqi/outcome.rb', line 32 def self.sub_categories ["MEDICAL DEVICE/EQUIPMENT", "MEDICATION", "INFRASTRUCTURE/SYSTEM", "ASSESSMENT/DOCUMENTATION", "RESPIRATORY/AIRWAY", "CARDIOVASCULAR", "PROCEDURE RELATED", "OTHER", "UNKNOWN"] end |
.time_frames ⇒ Object
20 21 22 |
# File 'lib/aqi/outcome.rb', line 20 def self.time_frames ["PreOp", "IntraOp", "PACU", "24h", "48h", "Week", "Month"] end |
Instance Method Details
#to_xml ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/aqi/outcome.rb', line 40 def to_xml builder = Builder::XmlMarkup.new builder.Outcome do |o| o.OutcomeTimeDate(time_date.strftime('%FT%T')) if time_date o.OutcomeTimeFrame(validate_time_frames(time_frame)) if time_frame o.OutcomeSeverity(validate_severity(severity_code)) if severity_code o.OutcomeCategory(validate_category(category_code)) if category_code o.OutcomeSubcategory(validate_sub_category(sub_category_code)) if sub_category_code o.OutcomeLocation(validate_location_code(location_type_code)) if location_type_code o.OutcomeName(name) if name o.OutcomeDesciption(description) if description o.OutcomeValue(value) if value o.OutcomeRangeMin(range_min) if range_min o.OutcomeRangeMax(range_max) if range_max o.OutcomeNotes(notes) if notes end end |