app/controllers/admin_controller.rb
#create equity patients from patient records
create equity patients from patient records
create equity patients from patient records
def randomize_patients
    mongo['records'].find().each do |r|
      puts r.inspect
      @patient = Patient.new(:firstname => r['first'], :lastname => r['last'], :member_id => r['patient_id'])
      @profile = @patient.build_profile();
      @patient.save && @profile.save
      puts "created patient: "+ @patient.inspect
    end
    render :text => "created random patients"
  end
def randomize_patients mongo [ 'records' ] . find ( ) . each do | r | puts r . inspect @patient = Patient . new ( :firstname => r [ 'first' ] , :lastname => r [ 'last' ] , :member_id => r [ 'patient_id' ] ) @profile = @patient . build_profile ( ) ; @patient . save && @profile . save puts "created patient: " + @patient . inspect end render :text => "created random patients" end
create equity patients from patient records
create equity patients from patient records
#r = mongo['records'].find_one() #break