Sha256: 347d0527ec75c4ce5054fae7731f3bf2e79ebd5ff5bdb0a14bdd0aa11eb70b65

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

class Record

  include Mongoid::Document
  
  field :first, type: String
  field :last, type: String
  field :gender, type: String
  field :birthdate, type: Integer
  field :effective_time, type: Integer
  field :race, type: Hash
  field :ethnicity, type: Hash
  field :languages, type: Array
  field :test_id, type: BSON::ObjectId
  field :medical_record_number, type: String

  Sections = [:allergies, :care_goals, :conditions, :encounters, :immunizations, :medical_equipment,
   :medications, :procedures, :results, :social_history, :vital_signs]

  Sections.each do |section|
    embeds_many section, as: :entry_list, class_name: "Entry"
  end
  
  def over_18?
    Time.at(birthdate) < Time.now.years_ago(18)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
health-data-standards-0.7.0 lib/health-data-standards/models/record.rb