-
-
Save azuby/1981379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Diagnosis < ActiveRecord::Base | |
| has_and_belongs_to_many :prescriptions | |
| has_many :patients, :through=>:prescriptions | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create_table "diagnoses", :force => true do |t| | |
| t.string "name" | |
| t.datetime "created_at" | |
| t.datetime "updated_at" | |
| end | |
| create_table "diagnoses_prescriptions" do |t| | |
| t.integer "diagnosis_id", :default => 0 | |
| t.integer "prescription_id", :default => 0 | |
| end | |
| create_table "prescriptions", :id => false, :force => true do |t| | |
| t.integer "id", :default => 0, :null => false | |
| t.integer "patient_id" | |
| t.integer "drug_seq" | |
| t.string "role_cod" | |
| t.string "drugname" | |
| t.string "val_vbm" | |
| t.string "route" | |
| end | |
| create_table "patients", :force => true do |t| | |
| t.string "i_f_cod" | |
| t.string "foll_seq" | |
| t.string "image" | |
| t.string "event_dt" | |
| t.string "mfr_dt" | |
| t.string "fda_dt" | |
| t.string "rept_cod" | |
| t.string "mfr_num" | |
| t.string "mfr_sndr" | |
| t.string "age" | |
| t.string "age_cod" | |
| t.string "gndr_cod" | |
| t.string "e_sub" | |
| t.string "wt" | |
| t.string "wt_cod" | |
| t.string "rept_dt" | |
| t.string "occp_cod" | |
| t.string "death_dt" | |
| t.string "to_mfr" | |
| t.string "confid" | |
| t.string "reporter_country" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Patient < ActiveRecord::Base | |
| has_many :prescriptions | |
| has_many :diagnoses, :through=>:prescriptions | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Prescription < ActiveRecord::Base | |
| belongs_to :patient | |
| has_and_belongs_to_many :diagnoses | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment