Sha256: 69f658d65c10621fc2a5f91e0d9fdf1970e84f5e19031bb69780d50ae848a153

Contents?: true

Size: 614 Bytes

Versions: 62

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

require "document/enum"

module Renalware
  class SmokingStatus < NestedAttribute
    SMOKING_SNOMED_MAP = {
      current: { code: 77176002, description: "Current" },
      non_smoker: { code: 8392000, description: "Non" },
      ex_smoker: { code: 8517006, description: "Ex" }
    }.freeze

    attribute :value,
              Document::Enum,
              enums: %i(non_smoker ex_smoker current)

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

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

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/documents/renalware/smoking_status.rb
renalware-core-2.1.0 app/documents/renalware/smoking_status.rb
renalware-core-2.0.167 app/documents/renalware/smoking_status.rb
renalware-core-2.0.166 app/documents/renalware/smoking_status.rb
renalware-core-2.0.165 app/documents/renalware/smoking_status.rb
renalware-core-2.0.164 app/documents/renalware/smoking_status.rb
renalware-core-2.0.163 app/documents/renalware/smoking_status.rb
renalware-core-2.0.162 app/documents/renalware/smoking_status.rb
renalware-core-2.0.161 app/documents/renalware/smoking_status.rb
renalware-core-2.0.160 app/documents/renalware/smoking_status.rb
renalware-core-2.0.159 app/documents/renalware/smoking_status.rb
renalware-core-2.0.158 app/documents/renalware/smoking_status.rb
renalware-core-2.0.157 app/documents/renalware/smoking_status.rb
renalware-core-2.0.156 app/documents/renalware/smoking_status.rb
renalware-core-2.0.155 app/documents/renalware/smoking_status.rb
renalware-core-2.0.153 app/documents/renalware/smoking_status.rb
renalware-core-2.0.152 app/documents/renalware/smoking_status.rb
renalware-core-2.0.151 app/documents/renalware/smoking_status.rb
renalware-core-2.0.149 app/documents/renalware/smoking_status.rb
renalware-core-2.0.148 app/documents/renalware/smoking_status.rb