Sha256: 99b5ea0530f6b27e1c635515ee8784c2541794660e3de51f2acc5e88ebd829e9

Contents?: true

Size: 486 Bytes

Versions: 15

Compression:

Stored size: 486 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    # A singleton exposing all defined OBX codes as an array of symbols
    class AllObservationCodes
      include Singleton

      # Example usage:
      #   AllObservationCodes.include?(code)
      def self.include?(code)
        instance.all.include?(code)
      end

      def all
        @all ||= ObservationDescription.order(:code).pluck(:code).map(&:upcase).map(&:to_sym)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.7 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.5 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.4 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.3 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.2 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.1 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/pathology/all_observation_codes.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/pathology/all_observation_codes.rb