Sha256: 1825aee0c0433a358c9ba614b65bc4e18aaa6138f1b312c7a8d7b050dfdb0229

Contents?: true

Size: 1.76 KB

Versions: 18

Compression:

Stored size: 1.76 KB

Contents

class CreateAdequacyResults < ActiveRecord::Migration[5.2]
  def change
    within_renalware_schema do
      create_table :pd_adequacy_results do |t|
        t.references :patient, null: false, foreign_key: true

        # The first set are inputs after seeing the patient
        t.date :performed_on, null: false
        t.integer :dial_24_vol_in
        t.integer :dial_24_vol_out
        t.boolean :dial_24_missing, null: false, default: false
        t.integer :urine_24_vol
        t.boolean :urine_24_missing, null: false, default: false

        # Blood results back from the lab
        t.float :serum_urea
        t.float :serum_creatinine
        t.float :plasma_glc
        t.float :serum_ab

        # Dialysate results back from the lab
        t.float :dialysate_urea
        t.float :dialysate_creatinine
        t.float :dialysate_glu
        t.float :dialysate_na
        t.float :dialysate_protein

        # Urine results back from the lab
        t.float :urine_urea
        t.float :urine_creatinine
        t.float :urine_na
        t.float :urine_k

        # Calculations
        t.float :total_creatinine_clearance
        t.float :pertitoneal_creatinine_clearance
        t.float :renal_creatinine_clearance
        t.float :total_ktv
        t.float :pertitoneal_ktv
        t.float :renal_ktv
        t.float :dietry_protein_intake
        t.boolean :complete, default: false, null: false, indeex: true

        t.datetime :deleted_at, index: true
        t.references :created_by, index: true, null: false
        t.references :updated_by, index: true, null: false
        t.timestamps null: false
      end

      add_foreign_key :pd_adequacy_results, :users, column: :created_by_id
      add_foreign_key :pd_adequacy_results, :users, column: :updated_by_id
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.1.0 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.167 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.166 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.165 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.164 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.163 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.162 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.161 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.160 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.159 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.158 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.157 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.156 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.155 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.153 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.152 db/migrate/20200427123229_create_adequacy_results.rb
renalware-core-2.0.151 db/migrate/20200427123229_create_adequacy_results.rb