Sha256: c774139de8c58544ac0fbecebe409eaf8710eff11924f77da1d0023073139be8

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

class Encounter < Entry
  field :admitType, type: Hash
  field :dischargeDisposition, type: Hash
  field :admitTime, type: Integer
  field :dischargeTime, type: Integer
  
  embeds_one :transferTo, class_name: "Transfer"
  embeds_one :transferFrom, class_name: "Transfer"

  embeds_one :facility
  embeds_one :reason, class_name: "Entry"

  belongs_to :performer, class_name: "Provider"

  alias :admit_time :admitTime
  alias :admit_time= :admitTime=
  alias :admit_type :admitType
  alias :admit_type= :admitType=
  alias :discharge_disposition :dischargeDisposition
  alias :discharge_disposition= :dischargeDisposition=
  alias :discharge_time :dischargeTime
  alias :discharge_time= :dischargeTime=
  alias :transfer_to :transferTo
  alias :transfer_to= :transferTo=
  alias :transfer_from :transferFrom
  alias :transfer_from= :transferFrom=

  def shift_dates(date_diff)
    super
    if self.facility
      self.facility.shift_dates(date_diff)
    end
    
    self.admitTime = (self.admitTime.nil?) ? nil : self.admitTime + date_diff
    self.dischargeTime = (self.dischargeTime.nil?) ? nil : self.dischargeTime + date_diff
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
health-data-standards-3.4.6 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.5 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.4 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.3 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.2 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.1 lib/health-data-standards/models/encounter.rb
health-data-standards-3.4.0 lib/health-data-standards/models/encounter.rb