Sha256: 23576c3945d35664fbff3b22d7206ede353b259cee62cd6e6c0c33135db1f7c3
Contents?: true
Size: 882 Bytes
Versions: 47
Compression:
Stored size: 882 Bytes
Contents
module HealthDataStandards module Import module CDA class NarrativeReferenceHandler def initialize @id_map = {} end def build_id_map(doc) path = "//*[@ID]" ids = doc.xpath(path) ids.each do |id| tag = id['ID'] value = id.content @id_map[tag] = value end end # @param [String] tag # @return [String] text description of tag def lookup_tag(tag) value = @id_map[tag] # Not sure why, but sometimes the reference is #<Reference> and the ID value is <Reference>, and # sometimes it is #<Reference>. We look for both. if !value and tag[0] == '#' tag = tag[1,tag.length] value = @id_map[tag] end value end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems