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

Version Path
health-data-standards-4.3.5 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.3.4 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.3.3 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.3.2 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.3.1 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.3.0 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.2.0 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.1.0 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.6 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.5 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.4 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.3 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.2 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.1 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-4.0.0 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-3.7.0 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-3.6.1 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-3.5.3 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-3.5.2 lib/health-data-standards/import/cda/narrative_reference_handler.rb
health-data-standards-3.5.1 lib/health-data-standards/import/cda/narrative_reference_handler.rb