Update Consultation
Send consultation status result. This endpoint is expected to be hit when consultation starts AND ends.
Path
post
{host}/v1/epharmacy/partner/consultation/update
Request Header
Parameter | Type | Description | Example | Required |
---|---|---|---|---|
X-Consultation-Partner | string | Consultation Partner Identifier | Halodoc | true |
Authorization | string | Access Token with Bearer. Refers to Authentication Guide | Bearer LSPr7x7sRGaewzwZE6IcuA | true |
Request Parameters
Parameter | Type | Description | Example | Required |
---|---|---|---|---|
tokopedia_consultation_id | string | Identifier of consultation ID from tokopedia | 123 | true |
is_cart_modified | boolean | Cart modified or not | false | true |
consultation | Object | Consultation Data | {} | true |
Consultation Status Code
Status Message Code | Example | When to use |
---|---|---|
SUCCESS | {"consultation_status": "SUCCESS"} | when doctor is found and user open the chat and when doctor approves consultation |
FAILED | { "consultation_status": "FAILED"} | when the consultation ends but no prescription is generated, more detail can see consultation failed status message code below |
Consultation Status Message Code
Status Message Code | Consultation Status | When to use |
---|---|---|
STARTED | SUCCESS | After found the doctor and user open the chat |
APPROVE | SUCCESS | After doctor approves consultation |
DOCTOR_NOT_FOUND | FAILED | When user tries to start consultation but no doctor was found |
ABANDONED | FAILED | When the consultation session is started but either the doctor is unresponsive / user manually ends the consultation before send any message |
PATIENT_NO_RESPONSE | FAILED | When the consultation session is started but user is unresponsive |
MEDICINE_NOT_MATCH_DIAGNOSIS | FAILED | If the diagnosis does not match the product you intend to purchase at checkout |
PATIENT_IDENTITY_INCOMPLETE | FAILED | The patient's identity is not complete |
PATIENT_SYMPTOM_INCOMPLETE | FAILED | The patient's symptoms are incomplete |
NOT_FOR_MEDICATION_PURPOSE | FAILED | When is not intended for use in the selection or administration of medication. |
QTY_UNREASONABLE | FAILED | The quantity that user has requested seems unreasonable |
OTHERS | FAILED | When the failed reason is outside of the message code. Max value is 200 characters |
Example Request
[M] = mandatory
[O] = optional
when starting the consultation
{
[M] "tokopedia_consultation_id": 12345,
[M] "is_cart_modified": false,
[M] "consultation": {
[M] "consultation_id": "-",
[M] "consultation_status": "SUCCESS",
[M] "consultation_status_message": "STARTED",
[O] "consultation_status_message_rejected": "",
[O] "consultation_notes": {},
[O] "start_time": 1655383073000,
[O] "customer_order_id": "Y751W0-0467",
[M] "type": "pd_erx_consultation"
}
}
when ending the consultation
approve consultation
{
[M] "tokopedia_consultation_id": 12345,
[M] "is_cart_modified": false,
[M] "consultation": {
[M] "consultation_id": "04MGZ3-0554",
[M] "consultation_status": "SUCCESS",
[M] "consultation_status_message": "APPROVE",
[O] "consultation_status_message_rejected": "",
[M] "consultation_notes": {
[O] "medical_recommendation": [],
[O] "doctor": {
[O] "name": "Dr. Toma Osipov",
[O] "specialties": "General",
[O] "notes": [
{
[O] "comments": "Symptoms : coldb\nPossible diagnosis : W02.3",
[O] "symptoms": "coldb",
[O] "possible_diagnosis": "W02.3",
[O] "primary_diagnostic_code": "5e993d19-c4b9-4383-b4c7-350512f766b6",
[O] "secondary_diagnostic_code": "ffd84cbb-9fdf-4483-b8c4-43cda833f5ae"
}
]
},
[M] "prescription": [
{
[O] "id": "fcd1dcc8-ae24-4796-bb88-be164480e433",
[M] "type": "medical_recommendation",
[M] "document_url": "https://www.abc.com/prescription",
[M] "expiry_time_value": 7,
[M] "expiry_time_unit": "DAYS",
[O] "max_redeem_count": 1,
[M] "expiry_date": 1656003599999,
[M] "status": "valid",
[M] "reason": "",
[O] "redemption_left": 1
}],
[O] "patient": {
[O] "name": "Full Patient Name",
[O] "address": "",
[O] "email": "",
[O] "phone_number": "",
[O] "date_of_birth": "",
[O] "gender": "",
[O] "partner_patient_id": "",
},
},
[M] "start_time": 1655383073000,
[O] "end_time": 1655383075000,
[O] "customer_order_id": "Y751W0-0467",
[M] "type": "pd_erx_consultation"
}
}
approve consultation with qty change
Doctor can suggest the qty change in medical_recommendation
Object Array. If quantity set as 0
the consultation will be partial rejected
{
[M] "tokopedia_consultation_id": 12345,
[M] "is_cart_modified": true,
[M] "consultation": {
[M] "consultation_id": "04MGZ3-0554",
[M] "consultation_status": "SUCCESS",
[M] "consultation_status_message": "APPROVE",
[O] "consultation_status_message_rejected": "",
[M] "consultation_notes": {
[O] "medical_recommendation": [{
[M] "tokopedia_product_id": 1234,
[O] "product_name": "IOS Red Medicine",
[M] "quantity": 0,
[O] "frequency_unit": "daily",
[O] "frequency_value": 1,
[O] "dosage_quantity_unit": "bottle",
[O] "dosage_quantity_value": 1,
[O] "selling_unit": "1"
},
{
[M] "tokopedia_product_id": 23467,
[O] "product_name": "Pandol Syrup",
[M] "quantity": 1,
[O] "frequency_unit": "daily",
[O] "frequency_value": 1,
[O] "dosage_quantity_unit": "bottle",
[O] "dosage_quantity_value": 1,
[O] "selling_unit": "1"
}],
[O] "doctor": {
[O] "name": "Dr. Toma Osipov",
[O] "specialties": "General",
[O] "notes": [
{
[O] "comments": "Symptoms : coldb\nPossible diagnosis : W02.3",
[O] "symptoms": "coldb",
[O] "possible_diagnosis": "W02.3",
[O] "primary_diagnostic_code": "5e993d19-c4b9-4383-b4c7-350512f766b6",
[O] "secondary_diagnostic_code": "ffd84cbb-9fdf-4483-b8c4-43cda833f5ae"
}
]
},
[M] "prescription": [
{
[O] "id": "fcd1dcc8-ae24-4796-bb88-be164480e433",
[M] "type": "medical_recommendation",
[M] "document_url": "https://www.abc.com/prescription",
[M] "expiry_time_value": 7,
[M] "expiry_time_unit": "DAYS",
[O] "max_redeem_count": 1,
[M] "expiry_date": 1656003599999,
[M] "status": "valid",
[M] "reason": "",
[O] "redemption_left": 1
}
],
[O] "patient": {
[O] "name": "Full Patient Name",
[O] "address": "",
[O] "email": "",
[O] "phone_number": "",
[O] "date_of_birth": "",
[O] "gender": "",
[O] "partner_patient_id": "",
},
},
[M] "start_time": 1655383073000,
[O] "customer_order_id": "Y751W0-0467",
[M] "type": "pd_erx_consultation"
}
}
reject consultation
{
[M] "tokopedia_consultation_id": 12345,
[M] "is_cart_modified": false,
[M] "consultation": {
[M] "consultation_id": "04MGZ3-0554",
[M] "consultation_status": "FAILED",
[M] "consultation_status_message": "PATIENT_NO_RESPONSE",
[O] "consultation_status_message_rejected": "",
[M] "consultation_notes": {
[O] "medical_recommendation": [],
[O] "doctor": {
[O] "name": "Dr. Toma Osipov",
[O] "specialties": "General",
[O] "notes": [
{
[O] "comments": "Symptoms : coldb\nPossible diagnosis : W02.3",
[O] "symptoms": "coldb",
[O] "possible_diagnosis": "W02.3",
[O] "primary_diagnostic_code": "5e993d19-c4b9-4383-b4c7-350512f766b6",
[O] "secondary_diagnostic_code": "ffd84cbb-9fdf-4483-b8c4-43cda833f5ae"
}
]
},
[O] "prescription": [],
[O] "patient": {
[O] "name": "Full Patient Name",
[O] "address": "",
[O] "email": "",
[O] "phone_number": "",
[O] "date_of_birth": "",
[O] "gender": "",
[O] "partner_patient_id": "",
},
},
[M] "start_time": 1655383073000,
[O] "customer_order_id": "Y751W0-0467",
[M] "type": "pd_erx_consultation"
}
}
Success Response Example
{
"header": {
"server_prosess_time": "640.893417ms",
"code": 200
},
"data": {
"Status": "OK",
"ErrorMessage": "",
"Errors": null
}
}
Error Response Example
{
"header": {
"server_prosess_time": "291.815542ms",
"code": 400
},
"data": null,
"error": "ERROR_ALREADY_UPDATE_CONSULTATION"
}