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 🙏

© 2026 – Pkg Stats / Ryan Hefner

infermedica

v1.0.16

Published

Node interface to the Infermedica REST API: https://developer.infermedica.com/docs/api

Readme

Infermedica (unofficial)

Node Interface To The Infermedica Rest Api. Npm Package

Description

This is a Node interface to the Infermedica Rest Api.

Installation

npm install infermedica --save

Usage examples

Estimate triage level based on provided patient information


const Infermedica = require('infermedica')
/** 
 * Provide credentials
 * This reference can help you explore the Infermedica API with your own data. 
 * Make sure that your application id and application key are correct and get started. 
 * Below they are passed in as environment variables
 */
const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    sex: "male",
    age: 70,
    evidence: [
        {
            "id": "s_1193",
            "choice_id": "present"
        },
        {
            "id": "s_488",
            "choice_id": "present"
        },
        {
            "id": "s_418",
            "choice_id": "present"
        }
    ]
}

infermedica.postTriage(context).then(res => {
    console.log(res)
})

Infermedica Methods


// Returns a list of all available conditions
infermedica.getConditions()

// Returns details of a single condition specified by id parameter 
infermedica.getCondition(conditionId)

// Suggests possible diagnoses and relevant observations
infermedica.postDiagnosis({ 
    sex, 
    age, 
    evidence, 
    extras, 
    target, 
    evaluated_at 
}) 

// Explains which evidence impact probability of selected condition
infermedica.postExplain({ 
    sex, 
    age, 
    evidence, 
    extras, 
    target, 
    evaluated_at 
})

// Returns information about data used by diagnostic engine
infermedica.getInfo() 

// Returns a list of all available lab tests
infermedica.getLabTests()

// Returns details of a single lab test specified by id parameter
infermedica.getLabTest(labTestId)

// Returns a single observation matching given phrase
infermedica.getLookUp({ phrase, sex })

// Returns list of mentions of observation found in given text
infermedica.postParse({ 
    text, 
    context, 
    concept_types, 
    correct_spelling, 
    include_tokens 
})

// Returns a list of all available risk factors
infermedica.getRiskFactors()

// Returns details of a single risk factor specified by id parameter
infermedica.getRiskFactor(riskFactorId) 

// Returns list of observations matching the given phrase
infermedica.getSearch({ 
    phrase, 
    sex, 
    maxResults, 
    type 
})

// Suggests possible symptoms based on provided patient information
infermedica.postSuggest({ 
    sex, 
    age, 
    evidence, 
    extras, 
    evaluated_at }, max_results)

// Returns a list of all available symptoms
infermedica.getSymptoms()

// Returns details of a single symptom specified by id parameter
infermedica.getSymptom(symptomId)

// Estimates triage level based on provided patient information
infermedica.postTriage({ 
    sex, 
    age, 
    evidence, 
    extras, 
    evaluated_at
})

Actions

getConditions

Returns a list of all available conditions.

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getConditions().then(conditions => {
    console.log(conditions)
})

getCondition

Returns details of a single condition specified by id parameter

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getCondition('c_522').then(condition => {
    console.log(condition)
})

postDiagnosis

Suggests possible diagnoses and relevant observations

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    sex: "male",
    age: 70,
    evidence: [
        {
            "id": "s_1193",
            "choice_id": "present"
        },
        {
            "id": "s_488",
            "choice_id": "present"
        },
        {
            "id": "s_418",
            "choice_id": "present"
        }
    ]
}

infermedica.postDiagnosis(context).then(diagnosis => {
    console.log(diagnosis)
})

postExplain

Explains which evidence impact probability of selected condition

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    sex: "male",
    age: 70,
    target: "c_49",
    evidence: [
        {
            "id": "s_1193",
            "choice_id": "present"
        },
        {
            "id": "s_488",
            "choice_id": "present"
        },
        {
            "id": "s_418",
            "choice_id": "present"
        }
    ]
}

infermedica.postExplain(context).then(explain => {
    console.log(explain)
})

getInfo

Returns information about data used by diagnostic engine

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getInfo().then(info => {
    console.log(info)
})

getLabTests

Returns a list of all available lab tests

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getLabTests().then(labTests => {
    console.log(labTests)
})

getLabTest

Returns details of a single lab test specified by id parameter

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getLabTest('lt_350').then(labTest => {
    console.log(labTest)
})

getLookUp

Returns a single observation matching given phrase

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY
})

const context = {
    sex: "female",
    phrase: "headache"
}

infermedica.getLookUp(context).then(lookUp => {
    console.log(lookUp)
})

postParse

Returns list of mentions of observation found in given text

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    "text": "I feel smoach pain but no couoghing today",
}

infermedica.postParse(context).then(parse => {
    console.log(parse)
})

getRiskFactors

Returns a list of all available risk factors

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getRiskFactors().then(riskFactors => {
    console.log(riskFactors)
})

getRiskFactor

Returns details of a single risk factor specified by id parameter

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getRiskFactor('p_28').then(riskFactor => {
    console.log(riskFactor)
})

getSearch

Returns list of observations matching the given phrase

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    sex: "male",
    phrase: "stomache pain",
    type: "symptom",
    maxResults: 8
}

infermedica.getSearch(context).then(search => {
    console.log(search)
})

postSuggest

Suggests possible symptoms based on provided patient information

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

const context = {
    sex: "male",
    age: 70,
    evidence: [
        {
            "id": "s_1193",
            "choice_id": "present"
        },
        {
            "id": "s_488",
            "choice_id": "present"
        },
        {
            "id": "s_418",
            "choice_id": "present"
        }
    ]
}

const maxResults = 8

infermedica.postSuggest(context, maxResults).then(suggest => {
    console.log(suggest)
})

getSymptoms

Returns a list of all available symptoms

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getSymptoms().then(symptoms => {
    console.log(symptoms)
})

getSymptom

Returns details of a single symptom specified by id parameter

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

infermedica.getSymptom('s_1190').then(symptom => {
    console.log(symptom)
})

postTriage

Estimates triage level based on provided patient information

const Infermedica = require('infermedica')

const infermedica = new Infermedica({ 
    appId: process.env.APP_ID, 
    appKey: process.env.APP_KEY 
})

 const context = {
    sex: "male",
    age: 70,
    evidence: [
        {
            "id": "s_1193",
            "choice_id": "present"
        },
        {
            "id": "s_488",
            "choice_id": "present"
        },
        {
            "id": "s_418",
            "choice_id": "present"
        }
    ]
}

infermedica.postTriage(context).then(triage => {
    console.log(triage)
})