Sha256: fa3ed6b911ca541d51a2d7e008b608e9cc281bd13276d55cad8135714452d55c

Contents?: true

Size: 771 Bytes

Versions: 93

Compression:

Stored size: 771 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology/requests"

module Renalware
  module Pathology
    module Requests
      class GlobalRule
        class TransplantRegistrationStatus < GlobalRule
          validates :param_comparison_value, presence: true

          def observation_required_for_patient?(patient, _date)
            registration = Transplants::Registration.for_patient(patient).first
            return false if registration.blank?

            registration_status = registration.current_status
            registration_status.description.code == param_comparison_value
          end

          def to_s
            "transplant registration status is #{@param_comparison_value}"
          end
        end
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
renalware-core-2.0.109 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.108 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.106 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.105 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.104 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.103 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.102 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.101 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.100 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.99 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.98 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.97 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.96 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.95 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.94 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.93 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.92 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.91 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.90 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb
renalware-core-2.0.89 app/models/renalware/pathology/requests/global_rule/transplant_registration_status.rb