npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aitriage-sdk-dev

v1.0.6

Published

A JavaScript SDK for seamless integration with the Aitriage API. Provides methods for authentication, assessment management, patient data retrieval, and more.

Downloads

33

Readme

Aitriage SDK (JavaScript)

Overview

The Aitriage SDK is a JavaScript library designed to simplify integration with the Aitriage API. It provides convenient methods for authentication, retrieval, and management of data related to medical assessments and patient information.

Features

  • Authentication: Secure login using API keys.
  • Assessment Management:
    • Fetch lists of assessments and detailed information for specific assessments.
    • Retrieve segments (parts) of assessments.
    • Export assessment reports as PDF files.
  • Patient Management:
    • Fetch lists of patients and detailed information for specific patients.
    • Retrieve notes associated with patients.

Installation

Install the Aitriage SDK using npm or yarn:

npm install aitriage-sdk
# or
yarn add aitriage-sdk

Usage

Follow these steps to integrate and use the Aitriage SDK in your JavaScript project:

  1. Import and Initialize:

    import { AitriageSdk, MODE } from 'aitriage-sdk'
    
    const apiKey = 'YOUR_API_KEY'
    const accountNo = 'YOUR_ACCOUNT_NO'
    
    const aitriageSdk = new AitriageSdk(apiKey, accountNo, MODE.DEVELOPMENT) // Or MODE.PRODUCTION for production environment
  2. Authenticate:

    const loginResponse = await aitriageSdk.loginByApiKey()
  3. Interact with the API:

    try {
        const assessmentQuery = { limit: 10, page: 1 }
        const assessments = await aitriageSdk.getListAssessment(assessmentQuery)
        console.log('Assessments:', assessments)
    
        const patientDetails = await aitriageSdk.getDetailPatient('CUSTOMER_ID')
        console.log('Patient details:', patientDetails)
    
        // ... Use other SDK methods as needed (see API Reference)
    } catch (error) {
        console.error('API Error:', error)
        // Handle API errors appropriately
    }

Important Notes

  • Authentication is Key: Always call loginByApiKey() before using other SDK methods. This ensures proper authentication and authorization for your API requests.
  • Asynchronous Operations: Many SDK methods (e.g., getListAssessment, getDetailPatient) are asynchronous. Use await within async functions or .then() to handle their results and potential errors.
  • Error Handling: Implement robust error handling around SDK method calls. Catch and handle errors to prevent your application from crashing and to provide informative feedback to users.
  • Rate Limits: Be aware of the Aitriage API's rate limits to avoid exceeding them. If you encounter rate limiting errors, implement backoff strategies to retry requests after a delay.
  • Type Definitions: Leverage the TypeScript type definitions included in the SDK to get autocompletion, type checking, and better code maintainability. Refer to the types.ts file for details on available types.