Sha256: 9594d32e27b4d7c4a822b4a4867b6d9122e68903126187a2da0715542dfb303e

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Doctors
  class Practice
    include Id::Model
    include Id::Form

    field :id
    field :code
    field :name
    field :latitude
    field :longitude
    field :distance
    field :gender,                 default: []
    field :phone,                  key: 'telephoneNumber'
    field :email,                  key: 'emailAddress'
    field :patient_count,          key: 'numberOfPatients'
    field :accepting_new_patients, key: 'acceptingNewPatients'
    field :online_prescriptions,   key: 'onlinePrescriptionOrdering'
    field :pims_url,               key: 'pimsUrl'
    field :opens_early,            key: 'opensEarly'
    field :opens_weekends,         key: 'opensWeekends'
    field :opens_late,             key: 'opensLate'

    has_one  :address,  type: Address
    has_many :services, type: Service

    def self.find(id)
      new API.find(id)
    end

    def to_param
      id
    end

    def has_female_gps?
      gender.include? 'female'
    end

    def has_male_gps?
      gender.include? 'male'
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doctors-0.0.1 lib/doctors/practice.rb