Sha256: d037559baa6bfb78039967f26707b9922160f4cca3fdf22b75c0251b3149bfb4

Contents?: true

Size: 1.38 KB

Versions: 86

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require "document/embedded"
require "document/enum"

module Renalware
  class PatientDocument < Document::Embedded
    attribute :interpreter_notes, String
    attribute :admin_notes, String
    attribute :special_needs_notes, String
    attribute :diabetes, DatedBooleanDiagnosis

    class Referral < Document::Embedded
      attribute :referring_physician_name, String
      attribute :referral_date, Date
      attribute :referral_type, String
      attribute :referral_notes, String
    end
    attribute :referral, Referral

    class Psychosocial < Document::Embedded
      attribute :housing, String
      attribute :social_network, String
      attribute :care_package, String
      attribute :other, String
      attribute :updated_at, Date
    end
    attribute :psychosocial, Psychosocial

    class History < Document::Embedded
      SMOKING_SNOMED_MAP = {
        "yes" => { code: 77176002, description: "Current" },
        "no" => { code: 8392000, description: "Non" },
        "ex" => { code: 8517006, description: "Ex" }
      }.freeze

      attribute :alcohol, Document::Enum, enums: %i(never rarely social heavy)
      attribute :smoking, Document::Enum, enums: %i(no ex yes)

      def smoking_snomed
        SMOKING_SNOMED_MAP[@smoking]
      end

      def smoking_rr
        @smoking&.upcase
      end
    end
    attribute :history, History
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

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