问答订单
肺轻松
创建问答订单
Description
患者向医生下单
Method and URL Structure
| Method |
Resource URL |
| POST |
/qaorder/order/create/ |
Request Parameters
| Name |
Description |
Required |
Default |
| doctor |
医生的用户名 |
Yes |
|
| order_type |
订单类型 |
Yes |
|
"order_type": 在线咨询(online),包月服务(monthly)
Request
{ "doctor":"doctor1", "order_type":"online"}
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qaorder/order/create/
JSON Response
{ "pk": 18, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268251845025696240003", "amount": "19.00", "status": 0, "status_display": "待支付", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-23T10:11:26.514808"}
查看订单详情
Description
用户查看订单信息
Method and URL Structure
| Method |
Resource URL |
| GET |
/qaorder/order/detail/${order_number}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/detail/12257268228937975696240003/
JSON Response
{ "pk": 14, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "question": { "pk": 3, "owner": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "order": "12257268228937975696240003", "allergy_history": "无过敏史", "smoke_history": "无吸烟史", "condition_description": "无病", "file_list": [ "http://123.jpg", "http://123.jpg", "http://123.jpg" ], "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg", "create_time": "2017-03-22T15:05:52.773782" }, "answer": { "pk": 9, "owner": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "question": 3, "diagnosis_tag": [ { "pk": 3, "owner": "patient1", "name": "肺结核", "description": "这是一个肺结核" }, { "pk": 2, "owner": "patient1", "name": "哮喘", "description": "这是一个挺严重的哮喘病" } ], "drug": [ { "pk": 3, "owner": "doctor1", "name": "头孢", "standard": "0.25*20s", "total_dosage": "125mg*10盒(瓶)", "each_dosage": "0.5g", "day_times": "3次/天" }, { "pk": 1, "owner": "patient1", "name": "头孢", "standard": "0.25*20s", "total_dosage": "125mg*10盒(瓶)", "each_dosage": "0.5g", "day_times": "3次/天" } ], "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "create_time": "2017-03-22T16:41:09.317246" }, "order_number": "12257268228937975696240003", "amount": "15.00", "status": 4, "status_display": "待评价", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-21T14:38:51.060124"}
删除订单
Description
用户删除订单
Method and URL Structure
| Method |
Resource URL |
| GET |
/qaorder/order/destroy/${order_number}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/destroy/12257268228937975696240003/
JSON Response
| Name |
Description |
Default |
| detail |
失败原因 |
Not found |
| status |
成功 |
204 |
根据身份不同获取订单列表(或者过滤status)
Description
用户获取订单列表
Method and URL Structure
| Method |
Resource URL |
Description |
| GET |
/qaorder/order/${position}/list/ |
获取医生/患者下所有订单 |
Request Paramters
| Name |
Description |
Required |
Default |
| status |
订单状态 |
NO |
|
position 传值描述: 如果是患者端,则 position='patient'; 如果是医生端,则 position='doctor'
status 传值描述: 待支付,则 status=0; 已支付,则 status=1; 待回答,则 status=2; 已回答,则 status=3; 待评价,则 status=4; 已评价,则 status=5; 取消 ,则 status=6
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/doctor/list/?status=1
JSON Response
{ "count": 1, "next": null, "previous": null, "results": [ { "pk": 19, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268267676495696240003", "amount": "70.00", "status": 1, "status_display": "已支付", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-29T10:12:27.040199" } ]}
根据身份不同获取最新一条订单
Description
用户获取最新一条订单
Method and URL Structure
| Method |
Resource URL |
Description |
| GET |
/qaorder/order/${position}/newone/ |
获取医生/患者下最新一条订单 |
Request Paramters
| Name |
Description |
Required |
Default |
| username |
用户名 |
YES |
|
position 传值描述: 如果是患者端,则 position='patient'; 如果是医生端,则 position='doctor'
usernme 传值描述: 如果 position='patient', username:医生用户名 如果 position='doctor', username:患者用户名
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/patient/newone/?username=doctor2
JSON Response
{ "pk": 26, "patient": { "owner": "patient2", "invitation_code": "", "name": "", "avatar": "" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268323647365696240006", "amount": "0.00", "status": 0, "status_display": "待支付", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-06-27T15:48:55.811295"}
获取用户所有的待回答&已回答的所有订单
Description
用户获取待回答&已回答订单列表
Method and URL Structure
| Method |
Resource URL |
Description |
| GET |
/qaorder/order/${position}/list/qa/ |
获取医生/患者下所有订单 |
position 传值描述: 如果是患者端,则 position='patient'; 如果是医生端,则 position='doctor'
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/doctor/list/qa/
JSON Response
{ "count": 2, "next": null, "previous": null, "results": [ { "pk": 19, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268267676495696240003", "amount": "70.00", "status": 2, "status_display": "待回答", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-29T10:12:27.040199" }, { "pk": 18, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268251845025696240003", "amount": "19.00", "status": 3, "status_display": "已回答", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-23T10:11:26.514808" } ]}
取消订单
Description
用户可以对未付款的订单取消掉
Method and URL Structure
| Method |
Resource URL |
| PUT |
/qaorder/order/cancel/${order_number}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/cancel/12257268246663755696240003/
JSON Response
{ "pk": 16, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268246663755696240003", "amount": "15.00", "status": 6, "status_display": "取消", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-22T17:51:24.190047"}
结束订单
Description
用户可以对已回答的订单结束咨询
Method and URL Structure
| Method |
Resource URL |
| PUT |
/qaorder/order/finish/${order_number}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/finish/12257268228937975696240003/
JSON Response
{ "pk": 14, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "question": { "pk": 3, "owner": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "order": "12257268228937975696240003", "allergy_history": "无过敏史", "smoke_history": "无吸烟史", "condition_description": "无病", "file_list": [ "http://123.jpg", "http://123.jpg", "http://123.jpg" ], "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg", "create_time": "2017-03-22T15:05:52.773782" }, "answer": { "pk": 9, "owner": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "question": 3, "diagnosis_tag": [ { "pk": 3, "owner": "patient1", "name": "肺结核", "description": "这是一个肺结核" }, { "pk": 2, "owner": "patient1", "name": "哮喘", "description": "这是一个挺严重的哮喘病" } ], "drug": [ { "pk": 3, "owner": "doctor1", "name": "头孢", "standard": "0.25*20s", "total_dosage": "125mg*10盒(瓶)", "each_dosage": "0.5g", "day_times": "3次/天" }, { "pk": 1, "owner": "patient1", "name": "头孢", "standard": "0.25*20s", "total_dosage": "125mg*10盒(瓶)", "each_dosage": "0.5g", "day_times": "3次/天" } ], "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "create_time": "2017-03-22T16:41:09.317246" }, "order_number": "12257268228937975696240003", "amount": "15.00", "status": 4, "status_display": "待评价", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-21T14:38:51.060124"}
Error Response
{ "status": -4, "message": "不能结束订单"}
过滤订单列表(暂时废弃)
Description
用户过滤订单(根据订单的状态)
Method and URL Structure
| Method |
Resource URL |
| GET |
/qaorder/order/filter/ |
Request Paramters
| Name |
Description |
Required |
Default |
| status |
订单状态 |
YES |
|
status 传值描述: 待支付,则 status=0; 已支付,则 status=1; 待回答,则 status=2; 已回答,则 status=3; 待评价,则 status=4; 已评价,则 status=5; 取消 ,则 status=6
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/filter/?status=0
JSON Response
{ "count": 2, "next": null, "previous": null, "results": [ { "pk": 18, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor2", "invitation_code": "", "name": "doctor", "avatar": "http://123.jpg" }, "question": null, "answer": null, "order_number": "12257268251845025696240003", "amount": "19.00", "status": 0, "status_display": "待支付", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-23T10:11:26.514808" }, { "pk": 15, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "question": null, "answer": null, "order_number": "12257268238541425696240003", "amount": "15.00", "status": 0, "status_display": "待支付", "channel": "alipay", "channel_display": "支付宝", "order_type": "online", "order_type_display": "在线咨询", "create_time": "2017-03-21T15:00:09.963589" } ]}
订单评价
Description
患者进行对医生评价
Method and URL Structure
| Method |
Resource URL |
| PUT |
/qaorder/order/evaluate/${order_number}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
Request Paramters
| Name |
Description |
Required |
Default |
| scores |
评分 |
YES |
|
| content |
评价内容 |
YES |
|
cURL Example
curl -X PUT -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/evaluate/12257268228937975696240003/
JSON Response
{ "pk": 12, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "scores": 5, "scores_display": "五星", "content": "好评", "create_time": "2017-03-23T15:23:38.084583", "evaluate_type": "online", "evaluate_type_display": "在线咨询"}
获取某一医生的所有评价
Description
查看医生的评价
Method and URL Structure
| Method |
Resource URL |
| GET |
/qaorder/user/${username}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/user/doctor1/
JSON Response
{ "count": 12, "next": "http://127.0.0.1:8000/qaorder/user/doctor1/?page=2&page_size=4", "previous": null, "results": [ { "pk": 1, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "scores": 5, "scores_display": "五星", "content": "好评", "create_time": "2017-03-23T14:51:21.302837", "evaluate_type": "online", "evaluate_type_display": "在线咨询" }, { "pk": 2, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "scores": 5, "scores_display": "五星", "content": "好评", "create_time": "2017-03-23T14:51:43.167329", "evaluate_type": "online", "evaluate_type_display": "在线咨询" }, { "pk": 3, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "scores": 5, "scores_display": "五星", "content": "好评", "create_time": "2017-03-23T14:52:10.106598", "evaluate_type": "online", "evaluate_type_display": "在线咨询" }, { "pk": 4, "patient": { "owner": "patient1", "invitation_code": "123", "name": "patient", "avatar": "http://123.jpg" }, "doctor": { "owner": "doctor1", "invitation_code": "123456", "name": "doctor", "avatar": "" }, "scores": 5, "scores_display": "五星", "content": "好评", "create_time": "2017-03-23T14:53:50.544454", "evaluate_type": "online", "evaluate_type_display": "在线咨询" } ]}
订单支付
Description
支付问答订单
Method and URL Structure
| Method |
Resource URL |
| PATCH |
/qaorder/order/pay/${order_number}/ |
Request Parameter
| Name |
Description |
Required |
Default |
| channel |
支付方式 |
YES |
|
支付方式分三种:wx(微信),alipay(支付宝),balance(余额)
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X PATCH -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/order/pay/12257268238541425696240003/
JSON Response
{ "status": 0, "message": "", "charge": { "order_no": "12257268238541425696240003", "extra": {}, "app": "app_HOafLKjbnLm1jXrP", "livemode": true, "currency": "cny", "time_settle": null, "time_expire": 1490340878, "id": "ch_TabDi9v1u9G0fjnLiPq5OmDS", "subject": "肺轻松#1225726823854142569624", "failure_msg": null, "channel": "alipay", "metadata": { "owner": "patient1", "order_number": "12257268238541425696240003" }, "body": "肺轻松#12257268238541425696240003", "credential": { "alipay": { "orderInfo": "service=\"mobile.securitypay.pay\"&_input_charset=\"utf-8\"¬ify_url=\"https%3A%2F%2Fnotify.pingxx.com%2Fnotify%2Fcharges%2Fch_TabDi9v1u9G0fjnLiPq5OmDS\"&partner=\"2088601268521360\"&out_trade_no=\"12257268238541425696240003\"&subject=\"肺轻松#1225726823854142569624\"&body=\"肺轻松#12257268238541425696240003 ch_TabDi9v1u9G0fjnLiPq5OmDS\"&total_fee=\"15.00\"&payment_type=\"1\"&seller_id=\"2088601268521360\"&it_b_pay=\"2017-03-24 15:34:38\"&sign=\"Skm9ejPMkUIYTc%2F%2FDAF8lWnzSEx9LJyoAHYEL7GRAkPC317Pe%2BxYn9TqdRrpRs6AErregTec6eLFiCdpgaVob0yDAhML49yP%2BrdRhHqMpLzhdyr4293I5JmSZ1%2B7HKHWVpLG6r%2B2o80C1lLao7mSW2jgI9bheWTaTNQrfw5YK1Y%3D\"&sign_type=\"RSA\"" }, "object": "credential" }, "client_ip": "127.0.0.1", "description": null, "amount_refunded": 0, "refunded": false, "object": "charge", "paid": false, "amount_settle": 1500, "time_paid": null, "failure_code": null, "refunds": { "url": "/v1/charges/ch_TabDi9v1u9G0fjnLiPq5OmDS/refunds", "has_more": false, "object": "list", "data": [] }, "created": 1490254478, "transaction_no": null, "amount": 1500 }}
获取某一患者的所有记录(医生端)
Description
医生查看患者的问诊记录
Method and URL Structure
| Method |
Resource URL |
| GET |
/qaorder/patient/inquiry/record/${pk}/ |
url 中的 pk 为患者patient 的 pk
| Name |
Description |
Required |
Default |
| Authorization |
Token 5fcfbbe09e2c7b18f4e5f2cca1f0511e9255ab49 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qaorder/patient/inquiry/record/3/
JSON Response
{ "count": 3, "next": null, "previous": null, "results": [ { "pk": 15, "order_number": "12257268238541425696240003", "create_time": "2017-03-21T15:00:09.963589" }, { "pk": 14, "order_number": "12257268228937975696240003", "create_time": "2017-03-21T14:38:51.060124" }, { "pk": 13, "order_number": "12257268217187655696240003", "create_time": "2017-03-21T14:38:50.594895" } ]}