Package Exports
- rxnormie
- rxnormie/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rxnormie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
RxNormie
A simple but robust TypeScript client for the RxNorm API — for normies 😊. This package provides a simple and intuitive way to interact with the RxNorm API.
Installation
# Using npm
npm install rxnormie
# Using yarn
yarn add rxnormie
# Using pnpm
pnpm add rxnormie
Usage
Basic Usage
import { RxNormie } from 'rxnormie';
// Initialize the client
const rxnormie = new RxNormie();
// If you have an API key (optional)
// const rxnormie = new RxNormie('your-api-key');
// Example: Filter a drug by property
async function filterDrugByProperty() {
// Filter for a drug with specific property
// For example, checking if a drug with rxcui "198440" has the property "TTY" with value "SBD"
const result = await rxnormie.filterByProperty('198440', 'TTY', 'SBD');
if (result) {
console.log('Drug matches the filter criteria');
} else {
console.log('Drug does not match the filter criteria');
}
}
filterDrugByProperty();
API Reference
RxNormie
The main class for interacting with the RxNorm API.
Constructor
constructor(apiKey?: string)
apiKey
(optional): Your RxNorm API key if you have one
Methods
filterByProperty(rxcui: string, propName: string, propValues: string): Promise<string | null>
Filter a drug by its properties.
rxcui
: The RxNorm concept unique identifierpropName
: The name of the property to filter bypropValues
: The values of the property to match- Returns: The rxcui if the drug matches the criteria, otherwise null