Class: HealthDataStandards::CQM::Bundle

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
lib/health-data-standards/models/cqm/bundle.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.activeObject



18
19
20
# File 'lib/health-data-standards/models/cqm/bundle.rb', line 18

def self.active
  self.where({active: true})
end

Instance Method Details

#deleteObject



35
36
37
38
39
40
# File 'lib/health-data-standards/models/cqm/bundle.rb', line 35

def delete
  self.measures.destroy
  self.records.destroy
  self.value_sets.destroy
  super
end

#measuresObject



22
23
24
# File 'lib/health-data-standards/models/cqm/bundle.rb', line 22

def measures
	 HealthDataStandards::CQM::Measure.where({bundle_id: self.id}).order_by([["id", :asc],["sub_id",:asc]])
end

#recordsObject



26
27
28
# File 'lib/health-data-standards/models/cqm/bundle.rb', line 26

def records
	Record.where(bundle_id: self._id, test_id: nil).order_by([["last", :asc]])
end

#value_setsObject



31
32
33
# File 'lib/health-data-standards/models/cqm/bundle.rb', line 31

def value_sets
  HealthDataStandards::SVS::ValueSet.in(bundle_id: self.id)
end