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, icd10: :condition_occurrence, condition_type: :condition_occurrence, # Procedures procedure: :procedure_occurrence, cpt: :procedure_occurrence, drg: :procedure_occurrence, hcpcs: :procedure_occurrence, icd9_procedure: :procedure_occurrence, procedure_cost: :procedure_cost, # Visits visit_occurrence: :visit_occurrence, place_of_service: :visit_occurrence, place_of_service_code: :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, rxnorm: :drug_exposure, drug_cost: :drug_cost, drug_type_concept_id: :drug_exposure, drug_type_concept: :drug_exposure, # Date Nodes date_range: :date, # Miscelaneous nodes concept: :misc, vsac: :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, #my_count, #my_n, #node_name, #type_color
Methods inherited from Nodes::Node
#arguments, #children, #columns, #evaluate, #select_it, #sql, #stream
Constructor Details
#initialize(name, values) ⇒ DotNode
Returns a new instance of DotNode.
60 61 62 63 |
# File 'lib/conceptql/graph_nodifier.rb', line 60 def initialize(name, values) @name = name.to_s super(values) end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
59 60 61 |
# File 'lib/conceptql/graph_nodifier.rb', line 59 def values @values end |
Instance Method Details
#display_name ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/conceptql/graph_nodifier.rb', line 65 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
80 81 82 83 |
# File 'lib/conceptql/graph_nodifier.rb', line 80 def types types = [TYPES[name.to_sym] || children.map(&:types)].flatten.uniq types.empty? ? [:misc] : types end |