Sha256: c43f70caa747ede32d748a8261ab7504778d1f2b3a9353bb740fc48805f8b79d

Contents?: true

Size: 1.91 KB

Versions: 61

Compression:

Stored size: 1.91 KB

Contents

# frozen_string_literal: true

module Renalware
  log "Adding Transplant Registration Statuses" do

    # HC on #1664: The only difficulty is for patients who receive a pre-emptive transplant so
    # their ESRF date is the date of their transplant. The RR list does not
    # accommodate that but I would put them as On Transplant List (3)
    #
    # RR ESR61 codes:
    # 1 Unsuitable
    # 2 Working Up or under discussion
    # 3 On Transplant List
    # 4 Suspended on Transplant List
    # 5 Not Assessed by Start of Dialysis
    statuses = [
      [:active, "Active", 3, "ESRF61: On Transplant List"],
      [:suspended, "Suspended", 4, "ESRF61: Suspended on Transplant List"],
      [:transplanted, "Transplanted", nil, "Not relevant for ESRF61"],
      [:live_transplanted, "Live transplanted", nil, "Not relevant for ESRF61"],
      [:off_by_patient, "Off by patient request", 1, "ERF61: Unsuitable"],
      [:not_eligible, "Not eligible for NHS Tx", 1, "ERF61: Unsuitable"],
      [:unfit_reconsider, "Unfit (not listed -- reconsider)", 1, "ERF61: Unsuitable"],
      [:unfit_permanent, "Unfit (not listed -- permanent)", 1, "ERF61: Unsuitable"],
      [:working_up, "X - working up", 2, "ERF61: Working Up or under discussion"],
      [:working_up_lrf, "X - working up LRF", 2, "ERF61: Working Up or under discussion"],
      [:not_for_work_up, "Not for work up - eGFR too high", 1, "ERF61: Unsuitable"],
      [:workup_complete, "Workup complete - low creat", 2, "ERF61: Working Up or under discussion"],
      [:transfer_out, "Transfer Out", nil, "Not relevant for ESRF61"],
      [:died, "Died", nil, "Not relevant for ESRF61"]
    ]

    statuses.each_with_index do |status, index|
      Transplants::RegistrationStatusDescription.find_or_create_by(code: status[0]) do |desc|
        desc.name = status[1]
        desc.rr_code = status[2]
        desc.rr_comment = status[3]
        desc.position = index * 10
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
renalware-core-2.0.83 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.82 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.81 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.80 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.79 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.78 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.77 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.76 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.75 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.74 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.73 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.72 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.71 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.70 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.69 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.68 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.67 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.64 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.63 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.62 db/seeds/default/transplants/transplant_registration_statuses.rb