Skip to main content
You can take assessments using eka client

0. Prerequisites

  • Install the eka client using pip:
pip install eka-client
  • Import the client:
from eka_client import EkaClient
  • Initialize the client:
client = EkaClient(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

1. To start an assessment:

first_question_form = client.assessment.start(
    age=20, 
    gender="M", 
    workflow_id=4002,
    practitioner_uuid="example_pract_uuid_123",
    patient_uuid="example_patient_uuid_123",
    unique_identifier="example_unique_id_123",
    context=additional_context
)
You can set additional context as a stringified json.
import json
additional_context = json.loads(
    {
        "name": "Rakesh",
        "city": "Pune"
    }
)
Click here to know more about eka care assessment platform.

2. Continue the assessment (get next question)

To get the next question, you need to answer the first question. The response can be a string for input type questions or a list of strings (ids) for choice type questions. get response
user_input = "2001-03-14"  # example date of birth
first_question_response = response(  # format the user's input
    question=first_question, 
    answer=user_input
)
choice_ids = ["abc", "def"] 
first_question_response = response(  # format the user's choices
    question=first_question 
    answer=choice_ids
)
Click here to know more about types of question component
get the next question using first_question_response
client.assessment.next(
    qid=0, 
    user_response=first_response
)

3. Submit the assessment when all questions are answered

client.assessment.submit()
I