Sha256: 66fef3b59c1a90a8f37c69238573283c636a34444ec197ef75017048809f8e71
Contents?: true
Size: 722 Bytes
Versions: 19
Compression:
Stored size: 722 Bytes
Contents
module ProviderImportUtils def extract_provider(performer, element_name="assignedEntity") provider_data = extract_provider_data(performer, false, "./cda:#{element_name}") find_or_create_provider(provider_data) end def find_or_create_provider(provider_hash) provider = Provider.where(npi: provider_hash[:npi]).first if provider_hash[:npi] && !provider_hash[:npi].empty? provider ||= Provider.create(provider_hash) end # Returns nil if result is an empty string, block allows text munging of result if there is one def extract_data(subject, query) result = subject.at_xpath(query) if result.nil? || result.content.empty? nil else result.content end end end
Version data entries
19 entries across 19 versions & 1 rubygems