Sha256: cd5e1b46291a7408e6ddabf46c9b56348d2192279f1b9cc5fe6631b2c2a32448

Contents?: true

Size: 1.88 KB

Versions: 30

Compression:

Stored size: 1.88 KB

Contents

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

30 entries across 30 versions & 1 rubygems

Version Path
renalware-core-2.0.16 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.15 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.14 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.13 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.12 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.11 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.9 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.8 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.7 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.5 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.4 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.3 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.2 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.1 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0.pre.rc13 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0.pre.rc11 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0.pre.rc10 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0.pre.rc9 db/seeds/default/transplants/transplant_registration_statuses.rb
renalware-core-2.0.0.pre.rc8 db/seeds/default/transplants/transplant_registration_statuses.rb