Diagnosis API tutorial

Introduction
Setup
The current version of the Diagnosis API is available at https://diagnosisapi.azurewebsites.net. It is a standard web service (Web API) that accepts GET and POST requests. All responses (including error messages) use the JSON format. POST requests also take JSON inputs (make sure you include the header Content-Type: application/json).

Authentication
The Diagnosis API uses custom HTTP header to authenticate your requests. You will need to add AuthenticationID header to every request you make. For your Demo Development you can use AuthenticationID = DEMO_AuthenticationID. We will provide you with your unique AuthenticationID value after you made a production order registration.

First request
The most important part of the API, which handles medical diagnostics, is the /api/DDxItems/ endpoint, which accepts POST requests. Apart from laboratory test results, it requires a list of observed symptoms. The lists cannot be empty, so first you need to collect an initial information to run diagnosis.

Let's assume we have a patient, suffering from strong smell urine, frequent urination and yellow skin. Each observation is represented by a unique ID; in this case the symptom IDs are 164, 151 and 200, respectively. Also the patient has list of implemented Lab Test Procedures: ALT, Amalyse, AST, Total Bilirubin, GT Chlamydia, Appearance Urine, and ABO grouping. By entering and identified the tests values you can send (POST) both Symptoms and Tests lists to https://diagnosisapi.azurewebsites.net. Then GET Possible Health Conditions from the Diagnosis API.

In order to achieve best results and enable more features of the API, you have to provide as many test result and symptoms as possible. This will depend on the accuracy of the diagnoses obtained. The case described above can be represented with the following JSON object:

JSON for Symptoms List
[
{"ID":164},
{"ID":151},
{"ID":200}
]

JSON for Tests List
[
{"ID":43,"Value":"66","LowRangeValue":"8","HighRangeValue":"40","ReferenceType":0},
{"ID":44,"Value":"110","LowRangeValue":"23","HighRangeValue":"85","ReferenceType":0},
{"ID":45,"Value":"1","LowRangeValue":"10","HighRangeValue":"45","ReferenceType":0},
{"ID":47,"Value":"22","LowRangeValue":"0.2","HighRangeValue":"1","ReferenceType":0},
{"ID":132,"Value":"Negative","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0},
{"ID":175,"Value":"0","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0},
{"ID":114,"Value":"B","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0}
]

Your first request to the API could look like this:

cURL
curl 'https://diagnosisapi.azurewebsites.net/api/DDxItems/?AuthenticationID=DEMO_AuthenticationID' \
-X "POST" \
-H "Content-Type: application/json" -d '{"Id": "99999999"},
"Symptoms":[
{"ID":164},
{"ID":151},
{"ID":200}
],
"Tests": [
{"ID":43,"Value":"66","LowRangeValue":"8","HighRangeValue":"40","ReferenceType":0},
{"ID":44,"Value":"110","LowRangeValue":"23","HighRangeValue":"85","ReferenceType":0},
{"ID":45,"Value":"1","LowRangeValue":"10","HighRangeValue":"45","ReferenceType":0},
{"ID":47,"Value":"22","LowRangeValue":"0.2","HighRangeValue":"1","ReferenceType":0},
{"ID":132,"Value":"Negative","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0},
{"ID":175,"Value":"0","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0},
{"ID":114,"Value":"B","LowRangeValue":"0","HighRangeValue":"0","ReferenceType":0}
]'
Output
The response returned from https://diagnosisapi.azurewebsites.net/api/DDxItems/ will contain diagnosis according to the following structure:
long Id
string Name
string Description
string ICD9
string ICD10
string ICD11
int Weight
TestGetType Tests
        int ID
        bool Entered
        string Value
        string Status
        string UnitsType
        string LowRangeValue
        string HighRangeValue
        string UnitsTypeSI
        string LowRangeValueSI
        string HighRangeValueSI
        string ComboValuesList
        string NegativeComboValue
        string Comment
        int ReferenceType
SymptomGetType Symptoms
        int ID
        string Symptom
        bool Entered
        string SimilarSymptomsList
        string Category

So that represents list of possible health conditions (Diseases) described by the parameters above. Most possible disease ranked on the top of the list.
The output JSON looks like the following:
[
{"id":1,
"name":"Metabolic acidosis",
"description":"...description listed here...",
"icD9":"276.2",
"icD10":"E87.2",
"icD11":"5C73",
"weight":15,
"tests":"[
        {\"ID\" : 119, \"Entered\" : true, \"Value\" : \"220\", \"Status\" : \"High\", \"UnitsType\" : \"mmol/L\", \"LowRangeValue\" : \"98\", \"HighRangeValue\" : \"109\", \"UnitsTypeSI\" : \"\", \"LowRangeValueSI\" : \"0\", \"HighRangeValueSI\" : \"0\", \"ComboValuesList\" : \"\", \"NegativeComboValue\" : \"\", \"Comment\" : \"\", \"ReferenceType\" : 0},
        {\"ID\" : 212,\"Entered\" : false,\"Value\" : \"\",\"Status\" : \"Low\",\"UnitsType\" : \"unitless\",\"LowRangeValue\" : \"7.34\",\"HighRangeValue\" : \"7.44\",\"UnitsTypeSI\" : \"\",\"LowRangeValueSI\" : \"0\",\"HighRangeValueSI\" : \"0\",\"ComboValuesList\" : \"\",\"NegativeComboValue\" : \"\",\"Comment\" : \"\",\"ReferenceType\" : 0},
        {\"ID\" : 213,\"Entered\" : false,\"Value\" : \"\",\"Status\" : \"Low\",\"UnitsType\" : \"mEq/L\",\"LowRangeValue\" : \"22\",\"HighRangeValue\" : \"26\",\"UnitsTypeSI\" : \"\",\"LowRangeValueSI\" : \"0\",\"HighRangeValueSI\" : \"0\",\"ComboValuesList\" : \"\",\"NegativeComboValue\" : \"\",\"Comment\" : \"\",\"ReferenceType\" : 0},
        {\"ID\" : 214,\"Entered\" : false,\"Value\" : \"\",\"Status\" : \"Low\",\"UnitsType\" : \"mmHg\",\"LowRangeValue\" : \"35\",\"HighRangeValue\" : \"45\",\"UnitsTypeSI\" : \"\",\"LowRangeValueSI\" : \"0\",\"HighRangeValueSI\" : \"0\",\"ComboValuesList\" : \"\",\"NegativeComboValue\" : \"\",\"Comment\" : \"\",\"ReferenceType\" : 0}]",
"symptoms" : "[
        {\"ID\" : 1,\"Symptom\" : \"rapid breathing\",\"Entered\" : false,\"SimilarSymptomsList\" : \"\",\"Category\" : \"\"},
        {\"ID\" : 2,\"Symptom\" : \"lethargy\",\"Entered\" : false,\"SimilarSymptomsList\" : \"\",\"Category\" : \"\"},
        {\"ID\" : 3,\"Symptom\" : \"confusion\",\"Entered\" : false,\"SimilarSymptomsList\" : \"\",\"Category\" : \"\"}]"
},
{"id":138,
"name":"Renal Tubular Acidosis",
"description":"...description listed here...",
"icD9":"588.89",
"icD10":"N25.89",
"icD11":"GB90.44",
"weight":15,
"tests":"[...Tests listed here...]",
"symptoms":"[...Symptoms listed here...]"
},
{"id":139,
"name":"Fanconi syndrome",
"description":"...description listed here...",
"icD9":"270.0",
"icD10":"E72.00",
"icD11":"GB90.42",
"weight":15,
"tests":"[...Tests listed here...]",
"symptoms":"[...Symptoms listed here...]"
}
]

! Please note: Correct med-statistics data is not provided for Demo Development.



© All rights reserved 2022 Rustemsoft LLC