Sha256: 8f751c2ba41841373271bddac03ccc13b398cc6cfb6ed375c382a91485afc3da
Contents?: true
Size: 1.05 KB
Versions: 75
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require_dependency "renalware/ukrdc" module Renalware module UKRDC module TreatmentTimeline module HD # Decorates an HD::Profile, adding methods that detect any changes significant enough # to warrant generating a new UKRDC Treatment. class ProfileDecorator < DumbDelegator def initialize(profile, last_profile: nil) @last_profile = last_profile super(profile) end def hd_type document.dialysis.hd_type end def changed? return true if last_profile.blank? hd_type_changed? || hospital_unit_changed? end def unchanged? !changed? end def hd_type_changed? last_profile.document.dialysis.hd_type != hd_type end def hospital_unit_changed? last_profile.hospital_unit_id != hospital_unit_id end private attr_reader :last_profile end end end end end
Version data entries
75 entries across 75 versions & 1 rubygems