from ekacare import EkaCareClient# Initialize with client credentialsclient = EkaCareClient( client_id="your_client_id", client_secret="your_client_secret")# Or initialize with an existing access tokenclient = EkaCareClient( client_id="your_client_id", client_secret="your_client_secret", access_token="your_access_token")# Manually get an access tokentoken_response = client.auth.login()access_token = token_response["access_token"]
# Upload a documentresponse = client.records.upload_document( file_path="/path/to/lab_report.pdf", document_type="lr", # lab report tags=["covid", "test"], title="COVID-19 Test Report")document_id = response["document_id"]# List documentsdocuments = client.records.list_documents()for doc in documents.get("items", []): print(doc["record"]["item"]["document_id"])# Get a specific documentdocument = client.records.get_document(document_id)# Update a documentclient.records.update_document( document_id=document_id, document_type="ps", # prescription tags=["medication"])# Delete a documentclient.records.delete_document(document_id)# Retrieve health records in FHIR formatrecords = client.records.retrieve_health_records( identifier="care_context_123", hip_id="hip123", health_id="user@abdm")
# Get Clinic Detailsresponse = client.clinic_doctor.get_clinic_details("YOUR_CLINIC_ID")# Get Doctor Detailsresponse = client.clinic_doctor.get_doctor_details("YOUR_DOCTOR_ID")
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
For input type question
Copy
Ask AI
user_input = "2001-03-14" # example date of birthfirst_question_response = response( # format the user's input question=first_question, answer=user_input)
For choice type question
Copy
Ask AI
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