Sha256: 36fd370dd7c3f7edca3198329150b3f37f2d02353dd15b4390dcd1658bbf318e
Contents?: true
Size: 1.31 KB
Versions: 102
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true require_dependency "renalware/pathology" module Renalware module Pathology module Requests class RequestPresenter < SimpleDelegator def self.present(requests) requests.map { |request| new request } end def patient_name patient.full_name.upcase end def date I18n.l Date.current end def date_of_birth I18n.l patient.born_on end def consultant request_form.consultant.full_name end def clinical_detail clinic.name end alias_method :contact, :clinical_detail def requested_by return "" if created_by.nil? created_by.full_name end def patient_rules ::Renalware::Pathology::Requests::PatientRulePresenter.present(super) end def global_requests_by_lab_and_bottle_type request_descriptions.group_by do |request_description| [request_description.lab.name, request_description.bottle_type] end end def patient_requests_by_lab patient_rules.group_by { |patient_rule| patient_rule.lab.name } end private def request_form __getobj__ end end end end end
Version data entries
102 entries across 102 versions & 1 rubygems