Class: ConceptQL::GraphNodifier::DotNode
- Inherits:
-
Nodes::Node
- Object
- Nodes::Node
- ConceptQL::GraphNodifier::DotNode
- Includes:
- Behaviors::Dottable
- Defined in:
- lib/conceptql/graph_nodifier.rb
Direct Known Subclasses
Constant Summary collapse
- TYPES =
{ # Conditions condition: :condition_occurrence, primary_diagnosis: :condition_occurrence, icd9: :condition_occurrence, # Procedures procedure: :procedure_occurrence, cpt: :procedure_occurrence, hcpcs: :procedure_occurrence, icd9_procedure: :procedure_occurrence, procedure_cost: :procedure_cost, # Visits visit_occurrence: :visit_occurrence, place_of_service: :visit_occurrence, # Person person: :person, gender: :person, race: :person, # Payer payer: :payer_plan_period, # Death death: :death, # Observation loinc: :observation, # Drug drug_exposure: :drug_exposure, drug_cost: :drug_cost, # Date Nodes date_range: :date, # Miscelaneous nodes concept: :misc }
Constants included from Behaviors::Dottable
Behaviors::Dottable::TYPE_COLORS
Constants inherited from Nodes::Node
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #display_name ⇒ Object
-
#initialize(name, values) ⇒ DotNode
constructor
A new instance of DotNode.
- #types ⇒ Object
Methods included from Behaviors::Dottable
#graph_it, #graph_node, #link_to, #node_name, #type_color
Methods inherited from Nodes::Node
#arguments, #children, #columns, #date_columns, #evaluate, #select_it, #stream
Constructor Details
#initialize(name, values) ⇒ DotNode
Returns a new instance of DotNode.
52 53 54 55 |
# File 'lib/conceptql/graph_nodifier.rb', line 52 def initialize(name, values) @name = name.to_s super(values) end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
51 52 53 |
# File 'lib/conceptql/graph_nodifier.rb', line 51 def values @values end |
Instance Method Details
#display_name ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/conceptql/graph_nodifier.rb', line 57 def display_name @__display_name ||= begin output = @name.dup output += ": #{arguments.join(', ')}" unless arguments.empty? if output.length > 100 parts = output.split output = parts.each_slice(output.length / parts.count).map do |subparts| subparts.join(' ') end.join ('\n') end output += "\n#{.map{|k,v| "#{k}: #{v}"}.join("\n")}" unless .nil? || .empty? output end end |
#types ⇒ Object
72 73 74 75 |
# File 'lib/conceptql/graph_nodifier.rb', line 72 def types types = [TYPES[name.to_sym] || children.map(&:types)].flatten.uniq types.empty? ? [:misc] : types end |