Matching Concepts to Nodes
Introduction
As discussed in the Concepts and Data Structures section, concepts are defined as nodes and each node has a unique id, which is used to pass and retrieve information in Kyla API. This section shows two ways to access node ids.
Finding Node
The first way to identify a node id for a concept is simply search for it using /search endpoint.
This functionality allows to search medical content for a keyword or a text and offers a list of potential matches. For example, a search for sore throat would result with a list of suggestions.
Let us consider example, where a user wishes to find node id corresponding to sore throat. In that case the call would be:
curl -X 'GET' \
'https://aiaas.kyla.com/engines/api/v1/diag/nodes/search?query=sore%20throat&types=ALL&page=0&limit=10' \
-H 'accept: application/json' \
-H 'Authorization: {your-access-token}'
The result would be similar to the content below (note that the output size was limited to 3 items for readability):
{
"content": [
{
"id": "N00143",
"title": "Sore Throat",
"outcomes": [
{
"outcome": "unknown",
"label": "Don't know"
},
{
"outcome": "present",
"label": "Yes"
},
{
"outcome": "absent",
"label": "No"
}
],
"type": "DISCRETE",
"unitOfContinuousType": null
},
{
"id": "N07233",
"title": "Unilateral Sore Throat",
"outcomes": [
{
"outcome": "unknown",
"label": "Don't know"
},
{
"outcome": "present",
"label": "present"
},
{
"outcome": "absent",
"label": "absent"
}
],
"type": "DISCRETE",
"unitOfContinuousType": null
},
{
"id": "N07194",
"title": "Chronic Sore Throat",
"outcomes": [
{
"outcome": "unknown",
"label": "Don't know"
},
{
"outcome": "present",
"label": "present"
},
{
"outcome": "absent",
"label": "absent"
}
],
"type": "DISCRETE",
"unitOfContinuousType": null
}
],
"number": 0,
"size": 3,
"totalPages": 339,
"totalElements": 1014
}
Retrieving All Nodes
An alternative approach is to access information on all nodes available in the Kyla AI service. This approach allows user to retrieve all concept information and possibly implement customized search functionality.
Retrieving information on all nodes is only possible by accessing nodes by a category. To retrieve all available nodes, four separate API endpoints should be accessed: /all_conditions, /all_risk_factors, /all_symptoms and /all_lab_tests.
It is important to realize that the diagnostic and prognostic API have different sets of nodes, therefore to avoid errors, correct endpoints corresponding to right service should be used.
The four categories listed above are not mutually exclusive. This means a node can belong to more than one category. For example, diabetes is a condition, but as well a risk factor to other conditions.