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
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Predict Codes
Predict medical codes from provided context.
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).
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
}
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}{
"requestid": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"validationErrors": [
{}
]
}Authorizations
Input your token
Headers
Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.
"base"
Body
List of coding systems for prediction
1 - 23 elementsicd10cm-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 ["icd10cm-outpatient", "cpt"]
Select either text or documentId as input context to the model for code prediction. Evidence indices in the response map to this array.
- Text
- DocumentID
Show child attributes
Show child attributes
Optional filter to restrict predicted codes.
Show child attributes
Show child attributes
Response
List of predicted codes and candidate codes per system defined in the request, including evidence supporting the code prediction.
Codes predicted by the model.
Show child attributes
Show child attributes
Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.
Show child attributes
Show child attributes
Credits consumed for this request.
Show child attributes
Show child attributes
Was this page helpful?