问答
肺轻松
问题
创建问题
Description
患者提问题
Method and URL Structure
| Method |
Resource URL |
| POST |
/qa/question/create/ |
Request Parameters
| Name |
Description |
Required |
Default |
| order_number |
订单号 |
YES |
|
| allergy_history |
过敏史 |
YES |
|
| smoke_history |
吸烟史 |
YES |
|
| desc_files |
过往病历文件 |
YES |
|
| condition_description |
病情自述 |
YES |
|
Request
{ "order_number":"12257268238541425696240003", "allergy_history":"无过敏史", "smoke_history":"无吸烟史", "condition_description":"病情挺严重的", "desc_files":"http://123.jpg,http://123.jpg,http://123.jpg"}
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d '' http://127.0.0.1:8000/qa/question/create/
JSON Response
{ "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"}
获取问题列表
Description
获取问题列表
Method and URL Structure
| Method |
Resource URL |
| GET |
/qa/question/list/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/list/
JSON Response
{ "count": 1, "next": null, "previous": null, "results": [ { "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" } ]}
获取问题详情
Description
获取问题详情
Method and URL Structure
| Method |
Resource URL |
| GET |
/qa/question/detail/${pk}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/detail/3/
JSON Response
{ "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"}
修改问题
Description
修改问题
Method and URL Structure
| Method |
Resource URL |
| PUT |
/qa/question/update/${pk}/ |
Request Parameters
| Name |
Description |
Required |
Default |
| allergy_history |
过敏史 |
NO |
|
| smoke_history |
吸烟史 |
NO |
|
| desc_files |
过往病历文件 |
NO |
|
| condition_description |
病情自述 |
NO |
|
Request
{ "allergy_history":"无过敏史", "smoke_history":"无吸烟史", "condition_description":"病情挺严重的", "desc_files":"http://123.jpg,http://123.jpg,http://123.jpg"}
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/update/2/
JSON Response
{ "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"}
删除问题
Description
删除问题
Method and URL Structure
| Method |
Resource URL |
| DELETE |
/qa/question/destroy/${pk}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X DELETE -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/destroy/2/
JSON Response
| Name |
Description |
Default |
| detail |
失败原因 |
Not found |
| status |
成功 |
204 |
答案
创建答案
Description
医生回答问题
Method and URL Structure
| Method |
Resource URL |
| POST |
/qa/answer/create/ |
Request Parameters
| Name |
Description |
Required |
Default |
| question |
问题的 pk/id |
YES |
|
| diagnosis_result |
诊断结果 |
YES |
|
| extra_suggestion |
其他建议 |
YES |
|
| drug_suggestion |
用药建议 |
YES |
|
Request
{ "question":3, "diagnosis_result":"吃点头孢,吃一个疗程,就好了", "extra_suggestion":"平时多出蔬菜", "drug_suggestion":"多吃药💊"}
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d '' http://127.0.0.1:8000/qa/answer/create/
JSON Response
{ "pk": 9, "owner": { "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" }, "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "drug_suggestion":"多吃药💊", "create_time": "2017-03-22T16:41:09.317246"}
获取答案列表
Description
获取答案列表
Method and URL Structure
| Method |
Resource URL |
| GET |
/qa/answer/list/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/list/
JSON Response
{ "count": 1, "next": null, "previous": null, "results": [ { "pk": 9, "owner": { "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" }, "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "drug_suggestion":"多吃药💊", "create_time": "2017-03-22T16:41:09.317246" } ]}
获取答案详情
Description
获取答案详情
Method and URL Structure
| Method |
Resource URL |
| GET |
/qa/answer/detail/${pk}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/detail/3/
JSON Response
{ "pk": 9, "owner": { "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" }, "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "drug_suggestion":"多吃药💊", "create_time": "2017-03-22T16:41:09.317246"}
修改答案
Description
修改答案
Method and URL Structure
| Method |
Resource URL |
| PUT |
/qa/answer/update/${pk}/ |
Request Parameters
| Name |
Description |
Required |
Default |
| question |
问题的 pk/id |
YES |
|
| diagnosis_result |
诊断结果 |
YES |
|
| extra_suggestion |
其他建议 |
YES |
|
| drug_suggestion |
用药建议 |
YES |
|
Request
{ "question":3, "diagnosis_result":"吃点头孢,吃一个疗程,就好了", "extra_suggestion":"平时多出蔬菜", "drug_suggestion":"多吃药💊"}
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X PUT -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/update/2/
JSON Response
{ "pk": 9, "owner": { "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" }, "diagnosis_result": "吃点头孢,吃一个疗程,就好了", "extra_suggestion": "平时多出蔬菜", "drug_suggestion":"多吃药💊", "create_time": "2017-03-22T16:41:09.317246"}
删除答案
Description
删除答案
Method and URL Structure
| Method |
Resource URL |
| DELETE |
/qa/answer/destroy/${pk}/ |
| Name |
Description |
Required |
Default |
| Authorization |
Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 |
Yes |
|
* Authorization的值为登录成功后返回值
cURL Example
curl -X DELETE -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/destroy/2/
JSON Response
| Name |
Description |
Default |
| detail |
失败原因 |
Not found |
| status |
成功 |
204 |