Class: AQI::ProcedureLocation
- Inherits:
-
Object
- Object
- AQI::ProcedureLocation
- Defined in:
- lib/aqi/procedure_location.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ ProcedureLocation
constructor
A new instance of ProcedureLocation.
- #to_xml ⇒ Object
- #validate_type_code(code) ⇒ Object
Constructor Details
#initialize(options) ⇒ ProcedureLocation
Returns a new instance of ProcedureLocation.
13 14 15 16 |
# File 'lib/aqi/procedure_location.rb', line 13 def initialize() self.type = validate_type_code([:type]) self.details = [:details] end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
3 4 5 |
# File 'lib/aqi/procedure_location.rb', line 3 def details @details end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/aqi/procedure_location.rb', line 3 def type @type end |
Class Method Details
.types ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/aqi/procedure_location.rb', line 5 def self.types ["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 |
Instance Method Details
#to_xml ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/aqi/procedure_location.rb', line 26 def to_xml builder = Builder::XmlMarkup.new builder.ProcedureLocation do |pl| pl.LocationType(type) pl.LocationDetails(details) end end |
#validate_type_code(code) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/aqi/procedure_location.rb', line 18 def validate_type_code(code) if self.class.types.include?(code) code else 'UNKNOWN' end end |