cURL
curl --request POST \
--url https://api.{environment}.corti.app/v2/tools/coding/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"system": [
"icd10cm-outpatient",
"cpt"
],
"context": [
{
"type": "text",
"text": "Short arm splint applied in ED for pain control."
}
]
}
'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.codes.predict({
system: ["icd10cm-outpatient"],
context: [{
type: "text",
text: "Patient presents with uncontrolled type 2 diabetes."
}],
filter: {
include: [{
property: "code",
op: "is-a",
value: ["E11"]
}]
}
});
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Codes.PredictAsync(
new CodesGeneralPredictRequest
{
System = new List<CommonCodingSystemEnum>() { CommonCodingSystemEnum.Icd10CmOutpatient },
Context = new List<CommonAiContext>()
{
new CommonTextContext { Text = "Patient presents with uncontrolled type 2 diabetes." },
},
Filter = new CodesFilter
{
Include = new List<CodesFilterCondition>()
{
new CodesFilterCondition
{
Property = "code",
Op = CodesFilterConditionOp.IsA,
Value = new List<string>() { "E11" },
},
},
},
}
);
import requests
url = "https://api.{environment}.corti.app/v2/tools/coding/"
payload = {
"system": ["icd10cm-outpatient", "cpt"],
"context": [
{
"type": "text",
"text": "Short arm splint applied in ED for pain control."
}
]
}
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/tools/coding/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'system' => [
'icd10cm-outpatient',
'cpt'
],
'context' => [
[
'type' => 'text',
'text' => 'Short arm splint applied in ED for pain control.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-Name: <tenant-name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/v2/tools/coding/"
payload := strings.NewReader("{\n \"system\": [\n \"icd10cm-outpatient\",\n \"cpt\"\n ],\n \"context\": [\n {\n \"type\": \"text\",\n \"text\": \"Short arm splint applied in ED for pain control.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{environment}.corti.app/v2/tools/coding/")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"system\": [\n \"icd10cm-outpatient\",\n \"cpt\"\n ],\n \"context\": [\n {\n \"type\": \"text\",\n \"text\": \"Short arm splint applied in ED for pain control.\"\n }\n ]\n}")
.asString();{
"codes": [
{
"system": "icd10cm-outpatient",
"code": "R10.30",
"display": "Lower abdominal pain, unspecified",
"evidences": [
{
"contextIndex": 0,
"text": "Example text mentioning lower abdominal pain",
"start": 0,
"end": 44
}
],
"alternatives": [
{
"code": "R10.10",
"display": "Upper abdominal pain, unspecified"
},
{
"code": "R10.32",
"display": "Left lower quadrant pain"
}
]
}
],
"candidates": [
{
"system": "icd10cm-outpatient",
"code": "R50.9",
"display": "Fever, unspecified",
"evidences": [
{
"contextIndex": 1,
"text": "Example text mentioning fever",
"start": 0,
"end": 29
}
],
"alternatives": [
{
"code": "R50.2",
"display": "Drug induced fever"
},
{
"code": "R50.82",
"display": "Postprocedural fever"
}
]
}
],
"usageInfo": {
"creditsConsumed": 123
}
}Codes
Predict Codes
Predict medical codes from provided context.
This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, ICD-10 (international), ICD-10-UK, CIM-10-FR, ICD-10-GM, OPCS-4, OPS, CCAM, CPT, SNOMED CT, MedDRA, SKS, KVÅ and ICD-O-3 codes based on input text string or documentId.
More than one code system may be defined in a single request.
Code prediction requests have two possible values for context:
-
-
The response includes two sets of results:
-
-
All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).
More than one code system may be defined in a single request.
Code prediction requests have two possible values for context:
-
text: One set of code prediction results will be returned based on all input text defined.-
documentId: Code prediction will be based on that defined document only.The response includes two sets of results:
-
Codes: Codes predicted by the model.-
Candidates: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).
POST
/
tools
/
coding
/
cURL
curl --request POST \
--url https://api.{environment}.corti.app/v2/tools/coding/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-Name: <tenant-name>' \
--data '
{
"system": [
"icd10cm-outpatient",
"cpt"
],
"context": [
{
"type": "text",
"text": "Short arm splint applied in ED for pain control."
}
]
}
'import { CortiClient, CortiEnvironment } from "@corti/sdk";
const client = new CortiClient({
environment: CortiEnvironment.Eu,
auth: {
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET"
},
tenantName: "YOUR_TENANT_NAME"
});
await client.codes.predict({
system: ["icd10cm-outpatient"],
context: [{
type: "text",
text: "Patient presents with uncontrolled type 2 diabetes."
}],
filter: {
include: [{
property: "code",
op: "is-a",
value: ["E11"]
}]
}
});
using Corti;
var client = new CortiClient(
"TENANT_NAME",
CortiClientEnvironment.Eu,
new CortiClientAuth.ClientCredentials("client_id", "client_secret")
);
await client.Codes.PredictAsync(
new CodesGeneralPredictRequest
{
System = new List<CommonCodingSystemEnum>() { CommonCodingSystemEnum.Icd10CmOutpatient },
Context = new List<CommonAiContext>()
{
new CommonTextContext { Text = "Patient presents with uncontrolled type 2 diabetes." },
},
Filter = new CodesFilter
{
Include = new List<CodesFilterCondition>()
{
new CodesFilterCondition
{
Property = "code",
Op = CodesFilterConditionOp.IsA,
Value = new List<string>() { "E11" },
},
},
},
}
);
import requests
url = "https://api.{environment}.corti.app/v2/tools/coding/"
payload = {
"system": ["icd10cm-outpatient", "cpt"],
"context": [
{
"type": "text",
"text": "Short arm splint applied in ED for pain control."
}
]
}
headers = {
"Tenant-Name": "<tenant-name>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{environment}.corti.app/v2/tools/coding/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'system' => [
'icd10cm-outpatient',
'cpt'
],
'context' => [
[
'type' => 'text',
'text' => 'Short arm splint applied in ED for pain control.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Tenant-Name: <tenant-name>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{environment}.corti.app/v2/tools/coding/"
payload := strings.NewReader("{\n \"system\": [\n \"icd10cm-outpatient\",\n \"cpt\"\n ],\n \"context\": [\n {\n \"type\": \"text\",\n \"text\": \"Short arm splint applied in ED for pain control.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-Name", "<tenant-name>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{environment}.corti.app/v2/tools/coding/")
.header("Tenant-Name", "<tenant-name>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"system\": [\n \"icd10cm-outpatient\",\n \"cpt\"\n ],\n \"context\": [\n {\n \"type\": \"text\",\n \"text\": \"Short arm splint applied in ED for pain control.\"\n }\n ]\n}")
.asString();{
"codes": [
{
"system": "icd10cm-outpatient",
"code": "R10.30",
"display": "Lower abdominal pain, unspecified",
"evidences": [
{
"contextIndex": 0,
"text": "Example text mentioning lower abdominal pain",
"start": 0,
"end": 44
}
],
"alternatives": [
{
"code": "R10.10",
"display": "Upper abdominal pain, unspecified"
},
{
"code": "R10.32",
"display": "Left lower quadrant pain"
}
]
}
],
"candidates": [
{
"system": "icd10cm-outpatient",
"code": "R50.9",
"display": "Fever, unspecified",
"evidences": [
{
"contextIndex": 1,
"text": "Example text mentioning fever",
"start": 0,
"end": 29
}
],
"alternatives": [
{
"code": "R50.2",
"display": "Drug induced fever"
},
{
"code": "R50.82",
"display": "Postprocedural fever"
}
]
}
],
"usageInfo": {
"creditsConsumed": 123
}
}Headers
Body
application/json
List of coding systems for prediction
Required array length:
1 - 38 elementsAvailable options:
icd10cm-inpatient, icd10cm-outpatient, icd10pcs, cpt, icd10int-inpatient, icd10int-outpatient, icd10uk-inpatient, icd10uk-outpatient, cim10fr-inpatient, cim10fr-outpatient, icd10gm-inpatient, icd10gm-outpatient, opcs4, ops, ccam, snomedctint, snomedctde, snomedctfr, snomedctuk, snomedctes, snomedctdk, snomedctse, snomedctus, snomedctno, snomedctat, snomedctnl, meddra-it, meddra-en, meddra-fr, meddra-es, meddra-de, meddra-no, meddra-se, sks, kvaa, icdo3int, icdo3fr, icdo3de Example:
["icd10cm-outpatient", "cpt"]
Response
List of predicted codes and candidate codes per system defined in the request, including evidence supporting the code prediction.
Was this page helpful?