Sha256: eddc73a07150a158bc3bf045b3863f5a2223fcc1a1e8c6242962513ada819e51
Contents?: true
Size: 736 Bytes
Versions: 75
Compression:
Stored size: 736 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/ukrdc" module Renalware module UKRDC module TreatmentTimeline module HD class ModalityCodeMap def code_for_profile(profile) hd_type = profile&.hd_type return default_code if hd_type.blank? ukrr_name = case hd_type.to_s.downcase when "hd" then "Haemodialysis" when "hdf_pre", "hdf_post" then "Haemodiafiltration" end ModalityCode.find_by!(description: ukrr_name) end def default_code ModalityCode.find_by!(description: "Haemodialysis") end end end end end end
Version data entries
75 entries across 75 versions & 1 rubygems