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



36
37
38
39
40
# File 'lib/rx_nav/concept.rb', line 36

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

#get_norm_infoObject



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

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



30
31
32
33
34
# File 'lib/rx_nav/concept.rb', line 30

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

#kindObject



14
15
16
17
# File 'lib/rx_nav/concept.rb', line 14

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

#nameObject



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

def name
  name = self.display_name ||
         self.full_name ||
         self.full_generic_name ||
         self.concept_name
  name ? name.capitalize : nil
end

#nuiObject



19
20
21
# File 'lib/rx_nav/concept.rb', line 19

def nui
  self.concept_nui
end

#to_sObject



23
24
25
# File 'lib/rx_nav/concept.rb', line 23

def to_s
  name
end