Skip to main content

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

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
AttributeExampleDescription
termarrhythmiaOptional - Include only content that match the given search term.
top10The maximum number of resources to be retrieved from the beginning of the list.
skip10The number of resources to skip from the beginning of the list before retrieving the specified top number of results.
availableRenditionLocalizationes-usInclude only content with renditions available in the specified localization(s).
concepthwcv_20425Include only content for the specified concepts(s).
snomed271737000Include only content that is associated with the given SNOMED CT code(s).
icd10cmE78.5Include only content that is associated with the given ICD-10-CM code(s).
nucc207Q00000XInclude only content that is associated with the given NUCC code(s).
loinc44877-9Include only content that is associated with the given LOINC code(s).
cpt99406Include only content that is associated with the given CPT code(s).
rxnorm253182Include 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
AttributeExampleDescription
hwidacg1668ID of the content to render.
coreSetcc_00001Core content set to render.
aspectwhatIsAspect of the core set to render.
localizationen-usLocalization to render.
sizelongestOptional – Size of the core set and aspect to render. If not specified, the shortest version will be rendered.
includeTitletrueOptional - Include the title in the rendition.
includeDisclaimertrueOptional - 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
AttributeExampleDescription
localizationen-usLocalization 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.