Sha256: 9d4540615af3015e8a98e963c10f33e6213bf8d64debf15f4f446ba24ee393a9

Contents?: true

Size: 753 Bytes

Versions: 52

Compression:

Stored size: 753 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    module Requests
      class GlobalRule
        class PatientIsDiabetic < GlobalRule
          validates :param_comparison_value, inclusion: { in: %w(true false), allow_nil: false }

          def observation_required_for_patient?(patient, _date)
            patient.diabetic? == param_comparison_boolean
          end

          def to_s
            if param_comparison_boolean
              "patient is DM"
            else
              "patient is not DM"
            end
          end

          def param_comparison_boolean
            param_comparison_value&.casecmp("true") == 0
          end
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

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