Getting Started

Overview

GenHealth provides access to a foundational predictive analytics model for various healthcare use cases. This model is extremely flexible and can be used as part of an existing workflow, or be in a standalone manner for a wide variety of use cases.

πŸ“ Patient History Builder

πŸ“˜

Private beta

The patient history builder is currently in private beta. If you would like access to the API, please sign up for an account through the main site and then email [email protected] to ask for access

. The private history builder will let you:

  • Create a custom patient history: You may use demographic data, ICD diagnosis codes, CPT procedure codes, time gap tokens, and NDC prescription medication codes to create a representation of a patient history for input into our predictive model.
  • Generate a set of simulated patient futures: Once a patient history is created, you can generate a set of predicted futures.
  • Explore the aggregated set of patient futures: Use our graphs to explore the set of predicted future medical events, or download the JSON file directly to use in analysis.

To access the history builder, first:

  1. Create an account Log in, or Sign Up to create an account through the GenHealth main site.
  2. Email GenHealth at [email protected] to ask for predict permissions to be added to your account
  3. Navigate to the History Builder and begin creating patient histories and simulating futures.

βš™οΈ Inference API

πŸ“˜

Private beta

The inference API is currently in private beta. If you would like access to the API, please sign up for an account through the main site and then email [email protected] to ask for access

GenHealth also offers programmatic access to our inferenceAPI.

To get access please follow the instructions below:

  1. Login to your GenHealth API account and navigate to API Keys - https://genhealth.ai/account/api-keys
  2. Create an API key and copy the value
  3. Send a request to the API.

Example:

curl -XPOST 'https://api.genhealth.ai/predict' \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Token YOUR_TOKEN_HERE' \
        --data '{"history": [{"code": "64","system": "age","display": "64"},{"code": "E11","system": "ICD10CM","display": "Type 2 diabetes mellitus"},{"code": "E11.3551","system": "ICD10CM","display": "Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye"}], "num_predictions": 1, "generation_length": 10, "inference_threshold": 0.95, "inference_temperature": 0.95}'
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Token YOUR_TOKEN_HERE',
}

json_data = {
    'history': [
        {
            'code': '64',
            'system': 'age',
            'display': '64',
        },
        {
            'code': 'E11',
            'system': 'ICD10CM',
            'display': 'Type 2 diabetes mellitus',
        },
        {
            'code': 'E11.3551',
            'system': 'ICD10CM',
            'display': 'Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye',
        },
    ],
    'num_predictions': 1,
    'generation_length': 10,
    'inference_threshold': 0.95,
    'inference_temperature': 0.95,
}

response = requests.post('https://api.genhealth.ai/predict', headers=headers, json=json_data)
fetch('https://api.genhealth.ai/predict', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Token YOUR_TOKEN_HERE'
  },
  body: JSON.stringify({
    'history': [
      {
        'code': '64',
        'system': 'age',
        'display': '64'
      },
      {
        'code': 'E11',
        'system': 'ICD10CM',
        'display': 'Type 2 diabetes mellitus'
      },
      {
        'code': 'E11.3551',
        'system': 'ICD10CM',
        'display': 'Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye'
      }
    ],
    'num_predictions': 1,
    'generation_length': 10,
    'inference_threshold': 0.95,
    'inference_temperature': 0.95
  })
});

API Request

The inference API expects a history array within the body which is expected to contain an ordered sequence of medical events, demographic data, or meta tokens. For example:

[
  {
    "code": "64",
    "system": "age",
    "display": "64"
  },
  {
    "code": "E11",
    "system": "ICD10CM",
    "display": "Type 2 diabetes mellitus"
  },
  {
    "code": "E11.3551",
    "system": "ICD10CM",
    "display": "Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye"
  },
  {
    "code": "06-12-month",
    "system": "timegap",
    "display": "06-12-month"
  },
  {
    "code": "E11",
    "system": "ICD10CM",
    "display": "Type 2 diabetes mellitus"
  },
  {
    "code": "E11.3551",
    "system": "ICD10CM",
    "display": "Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye"
  }
]

Each object must contain a code, system and display value. A comprehensive list of acceptable codes and inputs can be found below in the systems section.

Creating Patient Histories

For example, to assemble a history for a 71 year old man with diabetes, you need to represent the patient in the history array using two tokens: one to represent the mans' age, and the second using the ICD-10 diagnosis code for diabetes. Every token in a patient's history must use a code from one of the systems described below.

[
  {
    "system": "age",
    "code": "71",
    "display": "71",
  },
  {
    "code": "E11",
    "system": "ICD10CM",
    "display": "Type 2 diabetes mellitus"
  },

API Response

The API will response will have the structure as defined below. Example:

{
  # an array of arays containing all predictions. each prediction array 
  # consists of objects which will be either individual predicted events, 
  # demographics, or meta tokens e.g. timegaps
  "predictions": [
    [
      {
        "system": "timegap",
        "code": "00-01-month",
        "display": "00-01-month"
      },
      {
        "system": "ICD10CM",
        "code": "E11",
        "display": "Type 2 diabetes mellitus"
      },
      {
        "system": "RXNORM-FREETEXT",
        "code": "chlorthalidone",
        "display": "chlorthalidone"
      },
      {
        "system": "ICD10CM",
        "code": "E11",
        "display": "Type 2 diabetes mellitus"
      },
      {
        "system": "RXNORM-FREETEXT",
        "code": "levothyroxine",
        "display": "levothyroxine"
      },
      {
        "system": "ICD10CM",
        "code": "E11.9",
        "display": "Type 2 diabetes mellitus without complications"
      }
    ]
  ],
  "history": [
    {
      "code": "64",
      "system": "age",
      "display": "64"
    },
    {
      "code": "E11",
      "system": "ICD10CM",
      "display": "Type 2 diabetes mellitus"
    },
    {
      "code": "E11.3551",
      "system": "ICD10CM",
      "display": "Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye"
    }
  ]
}

Systems

All elements in the API Request history array, and all outputted predictions will be elements from the following code systems.

SystemCode (example)Display (example)NotesDescriptor
age64same as systemCan be any between 1-121age
gendermalesame as systemmale or femalegender
timegap06-12-monthsame as systemThis is a meta token to indicate the passage of time without a medical event. Allowed values are:
00-01-month
06-12-month
03-06-month
12-99-month
timegap
ICD10CME11.3551Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eyeAny valid ICD 10 code. Display value is optionalDiagnoses, Symptoms and Procedures
CPT432488Removal of lung, other than pneumonectomy; with all remaining lung following previous removal of a portion of lung (completion pneumonectomy)Any valid CPT code. Display value is optional.Procedures & Services
NDC00406036562Acetaminophen 325 MG / Hydrocodone Bitartrate 5 MG Oral TabletAny valid NDC code. Display value optionDrugs
HCPCSQ4189Artacent ac, 1 mgAny valid HCPCS code.Procedures, Services, Products, & Supplies
RxNorm-freetext19210090.1 ML adalimumab 100 MG/ML Prefilled SyringeAny valid RxNorm free text display valueDrugs

To explore diagnosis codes, please see https://athena.ohdsi.org/search-terms/start

:gemini: Embeddings API

πŸ“˜

Private beta

The embeddings API is currently in private beta. If. you would like access to the API, please email [email protected]

The GenHealth.ai embeddings API provides a method to generate the embedding for any sequence or history of data. It returns a vector that you can use to run semantic search, training classifiers, or many other use cases.

curl -XPOST 'https://api.genhealth.ai/embeddings' \
        -H 'Content-Type: application/json' \
        -H 'Authorization: Token YOUR_TOKEN_HERE' \
        --data '{"history": [{"code": "64","system": "age","display": "64"},{"code": "E11","system": "ICD10CM","display": "Type 2 diabetes mellitus"},{"code": "E11.3551","system": "ICD10CM","display": "Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye"}]}'
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Token YOUR_TOKEN_HERE',
}

json_data = {
    'history': [
        {
            'code': '64',
            'system': 'age',
            'display': '64',
        },
        {
            'code': 'E11',
            'system': 'ICD10CM',
            'display': 'Type 2 diabetes mellitus',
        },
        {
            'code': 'E11.3551',
            'system': 'ICD10CM',
            'display': 'Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye',
        },
    ],
}

response = requests.post('https://api.genhealth.ai/embeddings', headers=headers, json=json_data)
fetch('https://api.genhealth.ai/embeddings', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Token YOUR_TOKEN_HERE'
  },
  body: JSON.stringify({
    'history': [
      {
        'code': '64',
        'system': 'age',
        'display': '64'
      },
      {
        'code': 'E11',
        'system': 'ICD10CM',
        'display': 'Type 2 diabetes mellitus'
      },
      {
        'code': 'E11.3551',
        'system': 'ICD10CM',
        'display': 'Type 2 diabetes mellitus with stable proliferative diabetic retinopathy, right eye'
      }
    ]
  })
});

Currently the response vector is 800 elements in the embedding.

{"embedding":[-0.3633899688720703,-0.1736675351858139,
              -0.21899628639221191,-0.5666848421096802,
              -0.8461626172065735,-0.1308348923921585,
              2.09614634513855,...]}