Sha256: 0a79b7b3e9a4df68699ec4cac82a35f49d543bd008ad5d71f882413702753952

Contents?: true

Size: 741 Bytes

Versions: 97

Compression:

Stored size: 741 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 == "true"
          end
        end
      end
    end
  end
end

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
renalware-core-2.0.113 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.112 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.111 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.110 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.109 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.108 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.106 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.105 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.104 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.103 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.102 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.101 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.100 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.99 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.98 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.97 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.96 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.95 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.94 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb
renalware-core-2.0.93 app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb