⚡ Quick Start
Getting started with
fhir-dosage-utils
Installation
Install fhir-dosage-utils
using your desired package manager :
- npm
- Yarn
- pnpm
npm install fhir-dosage-utils
yarn add fhir-dosage-utils
pnpm add fhir-dosage-utils
Usage
main.js
import FhirDosageUtils from "fhir-dosage-utils";
// See https://jy95.github.io/fhir-dosage-utils/api/interface/Params for more info about config
const config = {
language: "en",
};
// A FHIR Dosage example
const dosage = {
timing: {
repeat: {
frequency: 1,
period: 8,
periodUnit: "h",
},
},
};
let dosageUtils = await FhirDosageUtils.build(config);
let dosageAsText = dosageUtils.fromDosageToText(dosage);
// display "1 time every 8 hours"
console.log(dosageAsText);
Output examples
tip
We have many examples available on documentation . Check them to see lib in action 😉