Class: RxNav::Concept

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/rx_nav/concept.rb

Instance Method Summary collapse

Instance Method Details

#get_ndfrt_infoObject



38
39
40
41
42
# File 'lib/rx_nav/concept.rb', line 38

def get_ndfrt_info
  nui = get_nui
  info = RxNav::NDFRT.get_info(nui)
  merge_concept info
end

#get_norm_infoObject



44
45
46
47
48
49
50
# File 'lib/rx_nav/concept.rb', line 44

def get_norm_info
  rxcui = get_rxcui
  info = RxNav::RxNorm.properties rxcui
  info.quantity = RxNav::RxNorm.quantity rxcui
  info.strength = RxNav::RxNorm.strength rxcui
  merge_concept info
end

#get_terms_infoObject

Supplementary calls to fetch info from other DBs Note: these methods return false if no information was found



32
33
34
35
36
# File 'lib/rx_nav/concept.rb', line 32

def get_terms_info
  rxcui = get_rxcui
  info = RxNav::RxTerms.all_info(rxcui)
  merge_concept info
end

#kindObject



16
17
18
19
# File 'lib/rx_nav/concept.rb', line 16

def kind
  kind = self.concept_kind
  kind ? titleize_kind(self.concept_kind) : nil
end

#nameObject



6
7
8
9
10
11
12
13
14
# File 'lib/rx_nav/concept.rb', line 6

def name
  name = self.display_name ||
         self.synonym ||
         self.full_name ||
         self.full_generic_name ||
         self.concept_name ||
         @table[:name]
  name ? titleize_str(name) : nil
end

#nuiObject



21
22
23
# File 'lib/rx_nav/concept.rb', line 21

def nui
  self.concept_nui
end

#to_sObject



25
26
27
# File 'lib/rx_nav/concept.rb', line 25

def to_s
  name
end