Overview of SDK for JavaScript apps

HealthCare Locator services are made available through its APIs and integrating the SDK for JavaScript makes it easy to interface with the services from within your app.

With the integrated SDK and subscription API key, your app is ready to carry out search operations on healthcare professionals (HCPs) and their activities with healthcare organizations (HCOs).

Topics cover:

         sample apps

         service calls to get data without implementing UI

Tip

         Recommend customizing the prebuilt search screens of the HealthCare Locator SDK as part of you app UI.

Note

         Review the JavaScript requirements.

Sample apps

Download the sample Angular and React apps to demonstrate SDK integration. You can find them in the examples/web folder in the following location:

https://github.com/hcl-sdk/HealthCareLocatorWebSDK

Live sample app

Try our live sample app to experience the features and screens of the HealthCare Locator SDK:

https://www.healthcarelocator.com/sample/search.html

To use our app, click Settings in the menu and add the API key you received after signup.

Service calls to get data without implementing UI

The SDK for JavaScript provides the methods to get data without implementing the UI. For details, see the following:

         hclAPI.activities

         hclAPI.activityByID

         hclAPI.individualsByID

         hclAPI.codesByLabel

         hclAPI.labelsByCode

hclAPI.activities

To get search results on HCP activities, your app sends an hclAPI.activities request to HCL where criteria from the request is passed by GraphQL in an activities search query to the Autocomplete endpoint of the Activity API. The JSON response contains search results structured as GraphQL schema objects.

Parameters

See descriptions in the activities search query made by GraphQL.

Returns

Promise<[Activity]>

Example

JavaScript

 

 

    const params = {

      first: 50,

      offset: 0,

      country: "ca",

      specialties: ["SP.WCA.75"]

    };

    hclAPI

      .activities(params)

      .then(result => {

        // The list of activities

      })

      .catch(err => {

        // An error happened.

      })

 

hclAPI.activityByID

To get details on an HCP activity with HCO, your app sends an hclAPI.activityByID request to HCL where criteria from the request is passed by GraphQL in an activityByID details query to the Activities endpoint of the Activity API. The JSON response contains a profile result structured as a GraphQL schema object.

Parameters

See descriptions in the activityByID details/profile query made by GraphQL.

Return

Promise<Activity>

Example

JavaScript

 

 

    const params = {

      id: 'WCAM0000048701',

    };

    hclAPI

      .activityByID(params)

      .then(result => {

        // The activity instance

      })

      .catch(err => {

        // An error happened.

      })

 

hclAPI.individualsByID

To get details on an HCP, your app sends an hclAPI.individualsByID request to HCL where criteria from the request is passed by GraphQL in an individualByID details query to the Activities endpoint of the Activity API. The JSON response contains a profile result structured as a GraphQL schema object.

Parameters

See descriptions in the individualByID details/profile query made by GraphQL.

Return

Promise<Individual>

Example

JavaScript

 

 

    const params = {

      id: 'WCAM0000048701',

    };

    hclAPI

      .individualsByID(params)

      .then(result => {

        // The individual instance

      })

      .catch(err => {

        // An error happened

      })

 

hclAPI.codesByLabel

To get search results on codes by label, your app sends an hclAPI.codesByLabel request to HCL where criteria from the request is passed by GraphQL in an codesByLabel search query to the Autocomplete endpoint of the Activity API. The JSON response contains search results structured as GraphQL schema objects.

Parameters

See descriptions in the codesByLabel search query made by GraphQL.

Return

Promise<CodeResult>

Example

JavaScript

 

 

    const paramsCodes = {

      first: 5,

      offset: 0,

      criteria: '',

      locale: 'en',

      codeTypes: ["TIT"],

    }

    hclAPI

      .codesByLabel(paramsCodes)

      .then(result => {

        // The list of codes

      })

      .catch(err => {

        // An error happened.

      })

 

hclAPI.labelsByCode

To get search results on labels by code, your app sends an hclAPI.labelsByCode request to HCL where criteria from the request is passed by GraphQL in an labelsByCode search query to the Autocomplete endpoint of the Activity API. The JSON response contains search results structured as GraphQL schema objects.

Parameters

See descriptions in the labelsByCode search query made by GraphQL.

Returns

Promise<CodeResult>

Example

JavaScript

 

 

    const paramsCodes = {

      first: 5,

      offset: 0,

      criteria: '',

      locale: 'en',

      codeTypes: ["TIT"],

    }

    hclAPI

      .labelsByCode(paramsCodes)

      .then(result => {

        // The list of codes

      })

      .catch(err => {

        // An error happened.

      })