Initiate Smart Symptom Checker

Once you have requested and received your upgraded Access Token here a conversation can be started with the Smart Symptom Checker.

📘

The upgraded JWT token is obtained after logging in, getting the terms and coditions and accepting them.

Start a conversation

To start a new conversation, either a request should be made to the initial endpoint, providing a number of mandatory key/value pairs in the body.

Body

Request body schema: application/json

Key

Type

Description

gender

string

Gender of the person symptom check is for. Must be either "male" or "female"

year_of_birth

integer

Year of birth of the person symptom check is for. Must be in a four-digit format, e.g. 1978

initial_query

string

Symptom(s) being experienced.

Multiple symptoms can be separated using "and", e.g. "shaking and coughing"

Example request:

curl -X POST https://portal.your.md/api/v1/chat \
     -H "Authorization: eyJraWQiOi10Y2RmY2Q0OS1kM2QyJFRlZGMtYThlZi02MDY5ZjRmZWYwNmMiLCJhbFhiOiJSUzI1NiJ9.eyJzdWIiOiJ5bWRNb3JzZV9pcGp6ZlRtMmwwRlhvd01zaXBIaWlObGZmZVlLb1ZPeWZmcmhyYmJpcGlzN2pXSlkiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImRldmljZV9pZCI6InBhcnRuZXJfcmFtcF83NDdlNWE0OTlkNTYzNjI0ZGFjMjBmYTQ4NGU1ZjQwMzczYmNiODg5YmI2NzIzYzRmNTExMjgyOTY0NmFlZWI2IiwiaXNzIjoieW1kLWludGVybmFsLXNlcnZpY2UtcHJvZCIsImp0aSI6ImZiMmNjZjJiLTNlZDYtNGRkMi04NWY4LWM1NThiODUxN2U3ZCIsImlhdCI6MTY0Nzg2MjAxOSwiZXhwIjoxNjQ3ODYzODE5fQ.rLQknhj00FvBI6fAKOcutyE3kpcO9PSJI60-PGynuU-rpAGVFXGl3oJQjlmEiJdj6cm3_bGqJbZUFXiJ56eDUwJ13coLTcQwoBPwAf2tActpJnjRMJivCB_b_sialoYRH0OZkiOysmEV01L4aHq8R535UpVlY4U-wxhhD7JYhLpo-e9BRbl2EgQhuFXLzl3s4ZPCSH7yMLn5KqfJIgcCoqL2f6nduZbFVXeKCmMjh5F2hs6QdKZPbBBVZBG9an6ACncvnwgqvUC00CmzEh76znjI8Xxeq1wSmwNYpBXQS3mPjUCpJAXIk5kjCSucu0BHngHYYBU3tL4Ifcs-vhgLqQ" \
     -H "x-api-key: GrNh3vPVdckgA9mCHxdmaSM2ucaywMZ9HbRJ1qTa"\
     -H "Content-Type: application/json" -d '
        {
          "gender": "male",
          "year_of_birth": 1978,
          "initial_symptom": "shaking and coughing",
    		}      
		}'

Depending on the initial symptom(s) provided during the initiation, the API will immediately start an Assessment Flow.

Initial query answers

An Assessment Flow will be started once you have initiated the Smart Symptom Checker (SSC).

At the start of the Assessment Flow, the API will respond with a question containing a number of messages, and choices to confirm the symptom(s) provided.

Ratification question

This is a confirmation phase where the SSC asks the user to confirm the identified symptoms.

Example response

{
    "conversation_details": {
        "step_back_possible": false,
        "report_possible": false,
        "phase": "symptom_check",
        "conversation_ended": false,
        "symptoms_summary": {},
        "progress": {
            "stage": "Your symptoms",
            "percentage": 0
        }
    },
    "question": {
        "type": "generic",
        "messages": [
            {
                "text": "Sorry you're unwell, member - Just to check, are these your symptoms?"
            },
            {
                "text": "Please choose all the ones you have. (If something's missing, you can add it later.)"
            }
        ],
        "choices": [
            {
                "id": "assessment_C0015967",
                "text": "High temperature"
            },
            {
                "id": "assessment_C0018681",
                "text": "Headache"
            }
        ],
        "constraints": {
            "min_selections": 0,
            "max_selections": 2
        }
    }
}

Example request

{
    "type": "generic",
    "included": ["assessment_C0013456", "assessment_C2986574"],
    "excluded": []
}

Autocomplete phase

If the SSC did not detect any symptom in the initial input, the autocomplete phase will start. This is a question with no choices, because the answer will be based on what search results are selected.

Example response

{
    "conversation_details": {
        "step_back_possible": false,
        "report_possible": false,
        "phase": "autocomplete_add",
        "conversation_ended": false,
        "symptoms_summary": {},
        "progress": {
            "stage": "Your symptoms",
            "percentage": 0
        }
    },
    "question": {
        "type": "autocomplete",
        "messages": [
            {
                "text": "Could you possibly be more specific or rephrase, member?"
            },
            {
                "text": "You can add up to 3 symptoms, 1 at a time."
            }
        ]
    }
}

If you get this answer, you should give the user a textbox calling our symptom-search endpoint. Then, based on the user selected symptoms, you should call the chat endpoint with the respective ids provided.

Example request

{
    "type": "autocomplete",
    "included": ["assessment_C0018681","assessment_C0015967"],
    "excluded": [""]
}

What’s Next