Web Components
Getting Started
The Delivery Web Component library allows you to interact with Healthwise content using JavaScript web components.
Before You Begin
This guide assumes you have a working knowledge of the Compass data model. If you are new, we recommend you review the data model reference before continuing. See the Data Model section for more information.
Installation
Include the web component library through the Healthwise Content Delivery Network (CDN).
<script src=" https://healthwisecdn.amazonaws.com/components/scripts/hw-web-components-1.0.0.min.js"></script>
Initialize the Web Components
To use the Web Components, include and initialize it with an embed code.
See Authentication to learn how to get a token or embed code.
At the start of your application or the webpage you plan to utilize the library, you can import the library as follows:
<script src=" https://healthwisecdn.amazonaws.com/components/scripts/hw-web-components-1.0.0.min.js" onload="window.Healthwise.setCredentials('your-ecode')"></script>
Available Web Components
hw-search
This retrieves a paginated list of content resources. You can narrow the search by supplying content filters. To paginate through the response, supply size and page parameters to the component.
Available Attributes
Attribute | Example | Description |
---|---|---|
term | arrhythmia | Optional - Include only content that match the given search term. |
top | 10 | The maximum number of resources to be retrieved from the beginning of the list. |
skip | 10 | The number of resources to skip from the beginning of the list before retrieving the specified top number of results. |
availableRenditionLocalization | es-us | Include only content with renditions available in the specified localization(s). |
concept | hwcv_20425 | Include only content for the specified concepts(s). |
snomed | 271737000 | Include only content that is associated with the given SNOMED CT code(s). |
icd10cm | E78.5 | Include only content that is associated with the given ICD-10-CM code(s). |
nucc | 207Q00000X | Include only content that is associated with the given NUCC code(s). |
loinc | 44877-9 | Include only content that is associated with the given LOINC code(s). |
cpt | 99406 | Include only content that is associated with the given CPT code(s). |
rxnorm | 253182 | Include only content that is associated with the given RxNorm code(s). |
Examples
Retrieve all the content records associated with the Asthma concept.
<hw-search concept="hwcv_20425"></hw-search>
Retrieve all the content records for a search on bladder cancer.
<hw-search term="bladder cancer"></hw-search>
hw-content
This displays a single piece of content rendered as HTML. You can request the content in the following ways:
- By its ID and localization.
- Semantically by its core set, aspect, and localization.
- Size might be optionally provided. If not provided, it will default to the shortest size.
Available Attributes
Attribute | Example | Description |
---|---|---|
hwid | acg1668 | ID of the content to render. |
coreSet | cc_00001 | Core content set to render. |
aspect | whatIs | Aspect of the core set to render. |
localization | en-us | Localization to render. |
size | longest | Optional – Size of the core set and aspect to render. If not specified, the shortest version will be rendered. |
includeTitle | true | Optional - Include the title in the rendition. |
includeDisclaimer | true | Optional - Include the disclaimer in the rendition. |
Either the hwid or the core set and aspect must be used to render content. Size is only respected with rendering a core set and aspect. A content ID already has an inherent size.
Examples
Display the American-English rendition of the topic abo2094:
<hw-content hwid= "abo2094" localization="en-us"></hw-content>
Display the longest available, American-English rendition of the What Is aspect of the Abscessed Tooth core set:
<hw-content coreSet= "cc_00004" aspect="whatis" localization="en-us" size="longest"></hw-content>
hw-disclaimer
This displays the Healthwise content disclaimer rendered as HMTL for the given localization.
Available Attributes
Attribute | Example | Description |
---|---|---|
localization | en-us | Localization to render. |
Examples
Display the Healthwise disclaimer in American-English.
<hw-disclaimer localization="en-us"></hw-disclaimer>
Versioning
The web components package follows Semantic Versioning (SemVer) for version numbers. SemVer consists of three parts: MAJOR.MINOR.PATCH.
- MAJOR version: Increments for incompatible API changes. Update cautiously, as it might require code adjustments.
- MINOR version: Adds new features in a backward-compatible manner. Update for added functionalities.
- PATCH version: Includes backward-compatible bug fixes. Update for bug resolutions.
For example, upgrading from 1.2.3 to 1.3.0 introduces new features, while 1.2.3 to 1.2.4 includes only bug fixes.