@vidal-community/vidal-side-effect
v0.3.0
Published
A simple web component
Downloads
44
Readme
VidalSideEffect
This project allows visualizing side effects as a tree map.
Install
npm install @vidal-community/vidal-side-effect
Usage
import @vidal-community/vidal-side-effect
Add <vidal-side-effect></vidal-side-effect>
to your HTML page
Access by javascript to the element and set the side effect supplier as an async function.
var vidalSideEffectElement = document.querySelector("vidal-side-effect");
vidalSideEffectElement.sideEffectSupplier = (url) => fetch('yourUrlForSideEffects' + url);
Properties
| Name | Type | Usage | default value | Notes |
|---|---|---|---|---|
| drugIds
| string[]
| Allows to give vidal drugs ids to the web component | []
| A vidal drug ids is vidal://DRUG_TYPE/drugId
|
| sideEffectSupplier
| (url) => Promise
| Allows to override url to call to get side effect tree | (url) => fetch(url)
| Call with /rest/side-effect/hierarchy?${(this.drugIds.map(vidalDrugId => 'q=' + vidalDrugId).join('&'))}
as Parameter |