Class: Renalware::SmokingStatus

Inherits:
NestedAttribute show all
Defined in:
app/documents/renalware/smoking_status.rb

Constant Summary collapse

SMOKING_SNOMED_MAP =
{
  current: { code: 77176002, description: "Current" },
  non_smoker: { code: 8392000, description: "Non" },
  ex_smoker: { code: 8517006, description: "Ex" }
}.freeze

Constants inherited from Document::Embedded

Document::Embedded::STRIPPABLE_TYPES

Instance Method Summary collapse

Methods inherited from NestedAttribute

#nested_attribute?, #to_partial_path

Methods inherited from Document::Embedded

attribute, attributes_list, #method_missing, old_attribute, old_attributes, #strip_leading_trailing_whitespace_from_numbers

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Document::Embedded

Instance Method Details

#snomed_codeObject



17
18
19
# File 'app/documents/renalware/smoking_status.rb', line 17

def snomed_code
  SMOKING_SNOMED_MAP.dig(value&.to_sym, :code)
end

#snomed_descriptionObject



21
22
23
# File 'app/documents/renalware/smoking_status.rb', line 21

def snomed_description
  SMOKING_SNOMED_MAP.dig(value&.to_sym, :description)
end