Class: FHIR::RxNormMeds
Class Method Summary collapse
- .local_rxnorm_reference?(reference, record, contained) ⇒ Boolean
- .reference_matchs?(reference, entry) ⇒ Boolean
- .rxnorm?(codeableconcept) ⇒ Boolean
Methods inherited from Rubrics
Class Method Details
.local_rxnorm_reference?(reference, record, contained) ⇒ Boolean
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/rubrics/rxnorm_meds.rb', line 48 def self.local_rxnorm_reference?(reference,record,contained) if contained && reference.reference && reference.reference.start_with?('#') contained.each do |resource| return true if resource.is_a?(FHIR::Medication) && reference.reference[1..-1]==resource.id end end record.entry.each do |entry| if entry.resource.is_a?(FHIR::Medication) && reference_matchs?(reference,entry) return true end end false end |
.reference_matchs?(reference, entry) ⇒ Boolean
62 63 64 65 66 67 68 69 70 |
# File 'lib/rubrics/rxnorm_meds.rb', line 62 def self.reference_matchs?(reference,entry) if reference.reference.start_with?('urn:uuid:') (reference.reference == entry.fullUrl) elsif reference.reference.include?('Medication/') (reference.reference.split('Medication/').last.split('/').first == entry.id) else false # unable to verify reference points to RXNORM end end |
.rxnorm?(codeableconcept) ⇒ Boolean
43 44 45 46 |
# File 'lib/rubrics/rxnorm_meds.rb', line 43 def self.rxnorm?(codeableconcept) return false if codeableconcept.nil? || codeableconcept.coding.nil? codeableconcept.coding.any?{|x| x.system=='http://www.nlm.nih.gov/research/umls/rxnorm' && FHIR::Terminology.get_description('RXNORM',x.code)} end |