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

aiza-rrg-integration-ts

v2.3.0

Published

Made with create-react-library

Downloads

10

Readme

aiza-rrg-integration-ts

NPM JavaScript Style Guide

Overview

The AizaRRGIntegration library facilitates the integration of a radiology report generation service into your React application. It requires an API key for authentication and a response function to handle the generated report data.

Install

npm install aiza-rrg-integration-ts

or

yarn add aiza-rrg-integration-ts

Usage

Below is an example of how to use the AizaRRGIntegration component in a React application:

import { AizaRRGIntegration } from 'aiza-rrg-integration';

function App() {
  // Define the response function to handle the results from AizaRRGIntegration
  const handleResponse = (
    radiology_report: string,
    report_title: string,
    audio: object,
    error: boolean,
    is_invalid: boolean
  ) => {
    if (error) {
      console.error("An error occurred while processing the report.");
    } else if (is_invalid) {
      console.warn("The generated report is invalid.");
    } else {
      console.log("Radiology Report:", radiology_report);
      console.log("Report Title:", report_title);
      // You can also handle the audio object if needed
      console.log("Audio Object:", audio);
    }
  };

  // Define the response function to handle the ICD and CPT codes
  const responseCodeFunction = (icd_code: any, cpt_code: any): void => {
    console.log("ICD Code:", icd_code);
    console.log("CPT Code:", cpt_code);
  };

  return (
    <>
      <AizaRRGIntegration
        xapi='your xpai key'  // Replace with your actual x-api key
        responseFunction={handleResponse}
        responseCodeFunction={responseCodeFunction}
        modality='CT'
        bodypart='Abdomen'
        protocol='No Contrast'
        platform={1}  // Set platform type (1 for web, 0 for mobile)
        age='30'  // Optional patient's age
        gender='male'  // Optional patient's gender
      />
    </>
  );
}

export default App;

Prop Details

xapi

  • Type: string
  • Description: The API key used to authenticate your application with the radiology report generation service.
  • Example: 'your-xapi-key'

responseFunction

  • Type: function
  • Description: A callback function that handles the response from the service. It receives five parameters: radiology_report, report_title, audio, error, and is_invalid.
const handleResponse = (
  radiology_report: string,
  report_title: string,
  audio: object,
  error: boolean,
  is_invalid: boolean
) => {
  if (error) {
    console.error("An error occurred while processing the report.");
  } else if (is_invalid) {
    console.warn("The generated report is invalid.");
  } else {
    console.log("Radiology Report:", radiology_report);
    console.log("Report Title:", report_title);
    console.log("Audio:", audio);
  }
};

responseCodeFunction

Type: function Description: A callback function that handles the response for ICD and CPT codes. It receives two parameters: icd_code and cpt_code.

const responseCodeFunction = (icd_code: any, cpt_code: any): void => {
  console.log("ICD Code:", icd_code);
  console.log("CPT Code:", cpt_code);
};

Integration

To integrate the AizaRRGIntegration component into your application:

  1. Import the AizaRRGIntegration component from the aiza-rrg-integration-ts package.
  2. Provide the required xapi prop with your API key.
  3. Define a response handling function to process the data returned by the service.
  4. Include the AizaRRGIntegration component in your component tree.

By following these steps, you can easily generate and handle radiology reports within your React application.

By following these steps, you can easily generate and handle radiology reports and corresponding ICD and CPT codes within your React application.