Class: CQM::StatementReference

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
app/models/cqm/cql_statement_dependency.rb

Overview

StatementReference notes a CQL Library/Statement which a given Statement (in which it is embedded) relies upon. This is also used for populations/stratifications/SDEs to reference their defining statement.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.transform_json(json_hash, target = StatementReference.new) ⇒ Object



55
56
57
58
59
60
61
# File 'app/models/cqm/cql_statement_dependency.rb', line 55

def self.transform_json(json_hash, target = StatementReference.new)
  result = target
  result['library_name'] = json_hash['library_name'] unless json_hash['library_name'].nil?
  result['statement_name'] = json_hash['statement_name'] unless json_hash['statement_name'].nil?

  result
end

Instance Method Details

#as_json(*args) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'app/models/cqm/cql_statement_dependency.rb', line 43

def as_json(*args)
  result = Hash.new
  unless self.library_name.nil?
    result['library_name'] = self.library_name
  end
  unless self.statement_name.nil?
    result['statement_name'] = self.statement_name
  end

  result
end