Class: Renalware::Pathology::Requests::Request

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Accountable
Defined in:
app/models/renalware/pathology/requests/request.rb

Constant Summary collapse

TEMPLATES =
%w(crs manual).freeze

Instance Method Summary collapse

Methods included from Accountable

#first_or_create_by!, #save_by, #save_by!, #update_by

Instance Method Details

#has_global_requests?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/renalware/pathology/requests/request.rb', line 31

def has_global_requests?
  request_descriptions.any?
end

#has_patient_requests?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'app/models/renalware/pathology/requests/request.rb', line 35

def has_patient_requests?
  patient_rules.any?
end

#has_tests_required?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'app/models/renalware/pathology/requests/request.rb', line 39

def has_tests_required?
  has_global_requests? || has_patient_requests?
end


27
28
29
# File 'app/models/renalware/pathology/requests/request.rb', line 27

def print_form
  save
end

#requested_onObject Also known as: printed_on



43
44
45
# File 'app/models/renalware/pathology/requests/request.rb', line 43

def requested_on
  created_at.to_date
end