weixin_33724046 2016-04-05 06:43 采纳率: 0%
浏览 85

如何集成NPI查找?

There's a site called NPI registry lookup which will show the information about the doctor you're searching for. i am getting this error XMLHttpRequest cannot load https://npiregistry.cms.hhs.gov/api/?number=1306935523. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:58202' is therefore not allowed access.

<script type="text/javascript">
            $(document).ready(function () {              
                $('#btnGetNpi').click(function () {                                 
                    $.ajax({
                        async: true,
                        crossDomain: true,
                        url: 'https://npiregistry.cms.hhs.gov/api/?number=' + $('#txtnpi').val(),
                        method: 'get',                       
                        dataType: 'json',
                        success: function (data) {
                            debugger;
                            resultElement.html('FirstName:' + data.basic[0].first_name);
                        },
                        error: function (jqXHR, exception) {
                            alert(exception);
                        }
                    });
                });
            });
    </script>

</div>
  • 写回答

2条回答 默认 最新

  • weixin_33701564 2017-03-17 03:27
    关注

    I'm not sure if this is what you're looking for, but the US Gov has a free API for doing NPI lookups, so you could pull your code from here: https://npiregistry.cms.hhs.gov/ It has a link to the API, which shows how to request info from the NPI db. There are several other websites that do this too, so you could crib code from them....

    Application Programming Interface (API) | Read-Only The API is a new, faster alternative to the downloadable NPPES data files. It allows systems to access NPPES public data in real-time, rather than through batched uploads. The API retrieves data from NPPES daily.

    NPPES Read API Interactive Test Application System administrators can use the interactive demo to experiment with generating queries. The API will generate its output at https://npiregistry.cms.hhs.gov/api/.

    There are several sites that do NPI lookups. Look at their code. Other sites do it. Copy the successful ones.

    Those of you who are coders should be able to make this sing!

    评论

报告相同问题?