Nongnooch Roongpiboonsopit • almost 5 years ago
How to get a title label from code?
I would like to assemble an individual name with a title but only get a code for a title as shown below. How could I get a label for a corresponding title's code?
title: {
"code": "TIT.WUS.DR",
"label": "Physician & Surgeon"
}
Note that I am using a JavaScript SDK through cdn.
Thanks!
Comments are closed.

1 comment
Francois Barrailla Manager • almost 5 years ago
Hi Nongnooch,
In order to be able to get the label for a title's code, you can use the JS API SDK `labelsByCode` method:
https://docs.healthcarelocator.com/index.htm#t=JavaScript%2FOverview_for_SDK_integration_within_JavaScript_apps.htm
const hclAPI = new HclAPI({ apiKey: 'YOUR_API_KEY' })
hclAPI.labelsByCode({
codeTypes: ['TIT'],
criteria: 'TIT.WUS.DR'
})
Not that it is not part of the SDK UI, so you need to include this script first:
https://static.healthcarelocator.com/v1/hcl-sdk-api/hcl-sdk-api.js