code
stringlengths
1
1.73M
language
stringclasses
1 value
module PrescriptionsHelper end
Ruby
module SuppliersHelper end
Ruby
module ContactTypesHelper end
Ruby
class AppointmentStatus < ActiveRecord::Base has_many :appointments end
Ruby
class Payment < ActiveRecord::Base belongs_to :invoice belongs_to :payment_method belongs_to :card_provider end
Ruby
class Invoice < ActiveRecord::Base has_many :invoice_details has_many :payments end
Ruby
class Treatment < ActiveRecord::Base belongs_to :appointment belongs_to :treatment_group end
Ruby
class DiagnosisGroup < ActiveRecord::Base has_many :diagnoses end
Ruby
class Drug < ActiveRecord::Base has_and_belongs_to_many :manufacturers has_and_belongs_to_many :suppliers has_and_belongs_to_many :stocks has_and_belongs_to_many :stock_loggings has_and_belongs_to_many :prescriptions end
Ruby
class Stock < ActiveRecord::Base has_and_belongs_to_many :drugs belongs_to :inventory end
Ruby
class ContactType < ActiveRecord::Base has_many :contacts validates_presence_of :label end
Ruby
class InvoiceDetail < ActiveRecord::Base belongs_to :invoice belongs_to :invoice_item_type end
Ruby
class Manufacturer < ActiveRecord::Base has_and_belongs_to_many :drugs end
Ruby
class Diagnosis < ActiveRecord::Base belongs_to :diagnosis_group has_and_belongs_to_many :appointments end
Ruby
class StockLogging < ActiveRecord::Base belongs_to :stock_logging_category belongs_to :inventory has_and_belongs_to_many :drugs end
Ruby
class RegistrationMethod < ActiveRecord::Base has_many :appointments end
Ruby
class InvoiceItemType < ActiveRecord::Base has_many :invoice_details end
Ruby
class Inventory < ActiveRecord::Base has_many :stocks has_many :stock_loggings end
Ruby
class Appointment < ActiveRecord::Base belongs_to :patient belongs_to :staff belongs_to :registration_method belongs_to :appointment_status has_and_belongs_to_many :diagnoses has_many :prescriptions has_many :treatments end
Ruby
class Prescription < ActiveRecord::Base has_and_belongs_to_many :drugs belongs_to :appointment end
Ruby
class Patient < ActiveRecord::Base has_many :appointments has_and_belongs_to_many :contacts def full_name "#{first_name} #{last_name}" end end
Ruby
class StockLoggingCategory < ActiveRecord::Base has_many :stock_loggings end
Ruby
class PaymentMethod < ActiveRecord::Base has_many :payments end
Ruby
class CardProvider < ActiveRecord::Base has_many :payments end
Ruby
class TreatmentGroup < ActiveRecord::Base has_many :treatments end
Ruby
class Staff < ActiveRecord::Base belongs_to :staff_role has_many :appointments has_and_belongs_to_many :contacts def full_name "#{first_name} #{last_name}" end end
Ruby
class StaffRole < ActiveRecord::Base has_many :staffs validates_presence_of :label, :code end
Ruby
class Supplier < ActiveRecord::Base has_and_belongs_to_many :drugs end
Ruby
class Contact < ActiveRecord::Base belongs_to :contact_type has_and_belongs_to_many :patients has_and_belongs_to_many :staffs validates_presence_of :contact_type_id, :address, :postal_code, :phone end
Ruby
class DiagnosesController < ApplicationController before_action :set_diagnosis, only: [:show, :edit, :update, :destroy] # GET /diagnoses # GET /diagnoses.json def index @diagnoses = Diagnosis.all end # GET /diagnoses/1 # GET /diagnoses/1.json def show end # GET /diagnoses/new def new @d...
Ruby
class InvoiceItemTypesController < ApplicationController before_action :set_invoice_item_type, only: [:show, :edit, :update, :destroy] # GET /invoice_item_types # GET /invoice_item_types.json def index @invoice_item_types = InvoiceItemType.all end # GET /invoice_item_types/1 # GET /invoice_item_type...
Ruby
class StocksController < ApplicationController before_action :set_stock, only: [:show, :edit, :update, :destroy] # GET /stocks # GET /stocks.json def index @stocks = Stock.all end # GET /stocks/1 # GET /stocks/1.json def show end # GET /stocks/new def new @stock = Stock.new end # G...
Ruby
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception end
Ruby
class WelcomeController < ApplicationController def index end end
Ruby
class StaffContactsController < ApplicationController before_action :set_staff_contact, only: [:show, :edit, :update, :destroy] # GET /staff_contacts # GET /staff_contacts.json def index @staff_contacts = StaffContact.all end # GET /staff_contacts/1 # GET /staff_contacts/1.json def show end #...
Ruby
class SuppliersController < ApplicationController before_action :set_supplier, only: [:show, :edit, :update, :destroy] # GET /suppliers # GET /suppliers.json def index @suppliers = Supplier.all end # GET /suppliers/1 # GET /suppliers/1.json def show end # GET /suppliers/new def new @sup...
Ruby
class TreatmentsController < ApplicationController before_action :set_treatment, only: [:show, :edit, :update, :destroy] before_action :set_appointment, only: [:create, :update, :destroy] # GET /treatments # GET /treatments.json def index @treatments = Treatment.all end # GET /treatments/1 # GET /...
Ruby
class PaymentMethodsController < ApplicationController before_action :set_payment_method, only: [:show, :edit, :update, :destroy] # GET /payment_methods # GET /payment_methods.json def index @payment_methods = PaymentMethod.all end # GET /payment_methods/1 # GET /payment_methods/1.json def show ...
Ruby
class DrugsController < ApplicationController before_action :set_drug, only: [:show, :edit, :update, :destroy] # GET /drugs # GET /drugs.json def index @drugs = Drug.all end # GET /drugs/1 # GET /drugs/1.json def show #@prescription = Prescription.where("drug_id = ?", params[:id] ) @connecti...
Ruby
class StockLoggingsController < ApplicationController before_action :set_stock_logging, only: [:show, :edit, :update, :destroy] # GET /stock_loggings # GET /stock_loggings.json def index @stock_loggings = StockLogging.all end # GET /stock_loggings/1 # GET /stock_loggings/1.json def show end #...
Ruby
class TreatmentGroupsController < ApplicationController before_action :set_treatment_group, only: [:show, :edit, :update, :destroy] # GET /treatment_groups # GET /treatment_groups.json def index @treatment_groups = TreatmentGroup.all end # GET /treatment_groups/1 # GET /treatment_groups/1.json def...
Ruby
class CardProvidersController < ApplicationController before_action :set_card_provider, only: [:show, :edit, :update, :destroy] # GET /card_providers # GET /card_providers.json def index @card_providers = CardProvider.all end # GET /card_providers/1 # GET /card_providers/1.json def show end #...
Ruby
class RegistrationMethodsController < ApplicationController before_action :set_registration_method, only: [:show, :edit, :update, :destroy] # GET /registration_methods # GET /registration_methods.json def index @registration_methods = RegistrationMethod.all end # GET /registration_methods/1 # GET /r...
Ruby
class StaffsController < ApplicationController before_action :set_staff, only: [:show, :edit, :update, :destroy] # GET /staffs # GET /staffs.json def index @staffs = Staff.all end # GET /staffs/1 # GET /staffs/1.json def show end # GET /staffs/new def new @staff = Staff.new end # G...
Ruby
class PatientsController < ApplicationController before_action :set_patient, only: [:show, :edit, :update, :destroy] # GET /patients # GET /patients.json def index @patients = Patient.all end # GET /patients/1 # GET /patients/1.json def show @appointments = Appointment.where(:patient_id => para...
Ruby
class CalendarController < ApplicationController def show @date = params[:date] ? Date.parse(params[:date]) : Date.today end end
Ruby
class PaymentsController < ApplicationController before_action :set_payment, only: [:show, :edit, :update, :destroy] # GET /payments # GET /payments.json def index @payments = Payment.all end # GET /payments/1 # GET /payments/1.json def show end # GET /payments/new def new @payment = Pa...
Ruby
class ContactTypesController < ApplicationController before_action :set_contact_type, only: [:show, :edit, :update, :destroy] # GET /contact_types # GET /contact_types.json def index @contact_types = ContactType.all end # GET /contact_types/1 # GET /contact_types/1.json def show end # GET /co...
Ruby
class StockLoggingCategoriesController < ApplicationController before_action :set_stock_logging_category, only: [:show, :edit, :update, :destroy] # GET /stock_logging_categories # GET /stock_logging_categories.json def index @stock_logging_categories = StockLoggingCategory.all end # GET /stock_logging...
Ruby
class PrescriptionsController < ApplicationController before_action :set_prescription, only: [:show, :edit, :update, :destroy] # GET /prescriptions # GET /prescriptions.json def index @prescriptions = Prescription.all end # GET /prescriptions/1 # GET /prescriptions/1.json def show end # GET /...
Ruby
class DiagnosisGroupsController < ApplicationController before_action :set_diagnosis_group, only: [:show, :edit, :update, :destroy] # GET /diagnosis_groups # GET /diagnosis_groups.json def index @diagnosis_groups = DiagnosisGroup.all end # GET /diagnosis_groups/1 # GET /diagnosis_groups/1.json def...
Ruby
class ManufacturersController < ApplicationController before_action :set_manufacturer, only: [:show, :edit, :update, :destroy] # GET /manufacturers # GET /manufacturers.json def index @manufacturers = Manufacturer.all end # GET /manufacturers/1 # GET /manufacturers/1.json def show end # GET /...
Ruby
class InventoriesController < ApplicationController before_action :set_inventory, only: [:show, :edit, :update, :destroy] # GET /inventories # GET /inventories.json def index @inventories = Inventory.all end # GET /inventories/1 # GET /inventories/1.json def show end # GET /inventories/new ...
Ruby
class InvoiceDetailsController < ApplicationController before_action :set_invoice_detail, only: [:show, :edit, :update, :destroy] # GET /invoice_details # GET /invoice_details.json def index @invoice_details = InvoiceDetail.all end # GET /invoice_details/1 # GET /invoice_details/1.json def show ...
Ruby
class InvoicesController < ApplicationController before_action :set_invoice, only: [:show, :edit, :update, :destroy] # GET /invoices # GET /invoices.json def index @invoices = Invoice.all end # GET /invoices/1 # GET /invoices/1.json def show end # GET /invoices/new def new @invoice = In...
Ruby
class ContactsController < ApplicationController before_action :set_contact, only: [:show, :edit, :update, :destroy] # GET /contacts # GET /contacts.json def index @contacts = Contact.all end # GET /contacts/1 # GET /contacts/1.json def show end # GET /contacts/new def new @contact = Co...
Ruby
class AppointmentsController < ApplicationController before_action :set_appointment, only: [:show, :edit, :update, :destroy] # GET /appointments # GET /appointments.json def index @appointments = Appointment.all end # GET /appointments/1 # GET /appointments/1.json def show end # GET /appointm...
Ruby
class AppointmentStatusesController < ApplicationController before_action :set_appointment_status, only: [:show, :edit, :update, :destroy] # GET /appointment_statuses # GET /appointment_statuses.json def index @appointment_statuses = AppointmentStatus.all end # GET /appointment_statuses/1 # GET /app...
Ruby
class StaffRolesController < ApplicationController before_action :set_staff_role, only: [:show, :edit, :update, :destroy] # GET /staff_roles # GET /staff_roles.json def index @staff_roles = StaffRole.all end # GET /staff_roles/1 # GET /staff_roles/1.json def show end # GET /staff_roles/new ...
Ruby
class PatientContactsController < ApplicationController before_action :set_patient_contact, only: [:show, :edit, :update, :destroy] # GET /patient_contacts # GET /patient_contacts.json def index @patient_contacts = PatientContact.all end # GET /patient_contacts/1 # GET /patient_contacts/1.json def...
Ruby
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
Ruby
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a probl...
Ruby
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters f...
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.action_dispatch.cookies_serializer = :json
Ruby
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails...
Ruby
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_UrMedicare_session'
Ruby
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
Ruby
Rails.application.routes.draw do resource :calendar, only: [:show], controller: :calendar resources :stock_logging_categories resources :payment_methods resources :card_providers resources :payments resources :invoice_item_types resources :invoice_details resources :invoices do resources :i...
Ruby
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
Ruby
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module UrMedicare class Application < Rails::Application config.autoload_paths += %W(#{config.root}/l...
Ruby
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize!
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suit...
Ruby
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Rails.application
Ruby
# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks
Ruby
class Calendar < Struct.new(:view, :date, :callback) HEADER = %w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday] START_DAY = :sunday delegate :content_tag, to: :view def table content_tag :table, class: "calendar table table-bordered table-striped" do header + week_rows ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details.i module Collada class Triangles attr_accessor :vertex_indices, :normal_indices, :count ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class Contours attr_accessor :vertex_indices, :normal_indices, :count ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class LineStrips attr_accessor :vertex_indices def initial...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada def Collada.ccw(a, b, c) a[0] * (b[1] - c[1]) - b[0] * (a[1] - c[1]) + c[0] *...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. require 'rexml/formatters/default' module REXML module Formatters # Pretty-prints an XML document. T...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. require 'sketchup.rb' require 'rubystdlib.rb' require 'rexml/Document' load 'collada/id_manager.rb' load 'co...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. require 'rubystdlib.rb' require 'rexml/Document' module Collada class Mesh attr_accessor :id ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class Node attr_accessor :name, :id, :geometries, :components, :nodes, :anima...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class Lines attr_accessor :vertex_indices, :count def init...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class Material attr_reader :id def initialize(id, color) ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class Component attr_accessor :node def initialize(node) ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada def Collada.p_to_s(p) p = p.collect { |n| if n.abs < 1e-10 then 0.0 else n end } ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class AnimationPath def AnimationPath.set_path(object) object.se...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. module Collada class IdManager def initialize(initial_entries = []) @id_hash = {} ...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. require 'collada/exporter.rb'
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. if not file_loaded?("rubystdlib.rb") processor, platform, *rest = RUBY_PLATFORM.split("-") cas...
Ruby
# Author: Michael Burns (mburns@cs.princeton.edu) # Copyright (c) 2009 Michael Burns # # This program is distributed under the terms of the # GNU General Public License. See the COPYING file # for details. require 'sketchup.rb' module SelectionFilter def SelectionFilter.filter(type) new_selection = Sketch...
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby