Git Product home page Git Product logo

Comments (3)

ssayer avatar ssayer commented on July 3, 2024

Thanks for working the XPath out for me :). This issue is actually in health data standards, but I've updated that library to look for NPI instead of "care provider."

from pophealth.

kclaes avatar kclaes commented on July 3, 2024

Provider import works if all attributes are available.
However, the extract_data method in provider_import_utils.rb does not cope well with nil because it accesses content without checking the value of the at_xpath method.
Also, in provider_importer.rb, we have the following code:

          if actor.at_xpath('./ccr:Person/ccr:Name/ccr:CurrentName/ccr:Given')
            provider[:given_name] = actor.at_xpath('./ccr:Person/ccr:Name/ccr:CurrentName/ccr:Given').content
            provider[:family_name] = actor.at_xpath('./ccr:Person/ccr:Name/ccr:CurrentName/ccr:Family').content
          end

The nil-check is done for CurrentName/Given, but not for Family -> potential error?

If you fix the extract_data function to cope with nils, I guess it can just become

            provider[:given_name] = extract_data(actor, './ccr:Person/ccr:Name/ccr:CurrentName/ccr:Given')
            provider[:family_name] = extract_data(actor, './ccr:Person/ccr:Name/ccr:CurrentName/ccr:Family')
            provider[:specialty] = extract_data(actor, './ccr:Specialty/ccr:Text')

I changed the definition of extract_data to this

  # 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 || result.content == ""
      nil
    else
      result
    end
  end

but perhaps there's a shorter ruby-way to do this ;)

from pophealth.

ssayer avatar ssayer commented on July 3, 2024

commited this to develop

from pophealth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.