[关闭]
@chenwei123 2017-03-23T09:26:23.000000Z 字数 8881 阅读 509

问答

肺轻松


问题

创建问题

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

  1. {
  2. "order_number":"12257268238541425696240003",
  3. "allergy_history":"无过敏史",
  4. "smoke_history":"无吸烟史",
  5. "condition_description":"病情挺严重的",
  6. "desc_files":"http://123.jpg,http://123.jpg,http://123.jpg"
  7. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d '' http://127.0.0.1:8000/qa/question/create/

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": {
  4. "owner": "patient1",
  5. "invitation_code": "123",
  6. "name": "patient",
  7. "avatar": "http://123.jpg"
  8. },
  9. "order": "12257268228937975696240003",
  10. "allergy_history": "无过敏史",
  11. "smoke_history": "无吸烟史",
  12. "condition_description": "无病",
  13. "file_list": [
  14. "http://123.jpg",
  15. "http://123.jpg",
  16. "http://123.jpg"
  17. ],
  18. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  19. "create_time": "2017-03-22T15:05:52.773782"
  20. }

获取问题列表

Description

获取问题列表

Method and URL Structure

Method Resource URL
GET /qa/question/list/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/list/

JSON Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "owner": {
  9. "owner": "patient1",
  10. "invitation_code": "123",
  11. "name": "patient",
  12. "avatar": "http://123.jpg"
  13. },
  14. "order": "12257268228937975696240003",
  15. "allergy_history": "无过敏史",
  16. "smoke_history": "无吸烟史",
  17. "condition_description": "无病",
  18. "file_list": [
  19. "http://123.jpg",
  20. "http://123.jpg",
  21. "http://123.jpg"
  22. ],
  23. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  24. "create_time": "2017-03-22T15:05:52.773782"
  25. }
  26. ]
  27. }

获取问题详情

Description

获取问题详情

Method and URL Structure

Method Resource URL
GET /qa/question/detail/${pk}/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/detail/3/

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": {
  4. "owner": "patient1",
  5. "invitation_code": "123",
  6. "name": "patient",
  7. "avatar": "http://123.jpg"
  8. },
  9. "order": "12257268228937975696240003",
  10. "allergy_history": "无过敏史",
  11. "smoke_history": "无吸烟史",
  12. "condition_description": "无病",
  13. "file_list": [
  14. "http://123.jpg",
  15. "http://123.jpg",
  16. "http://123.jpg"
  17. ],
  18. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  19. "create_time": "2017-03-22T15:05:52.773782"
  20. }

修改问题

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

  1. {
  2. "allergy_history":"无过敏史",
  3. "smoke_history":"无吸烟史",
  4. "condition_description":"病情挺严重的",
  5. "desc_files":"http://123.jpg,http://123.jpg,http://123.jpg"
  6. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/question/update/2/

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": {
  4. "owner": "patient1",
  5. "invitation_code": "123",
  6. "name": "patient",
  7. "avatar": "http://123.jpg"
  8. },
  9. "order": "12257268228937975696240003",
  10. "allergy_history": "无过敏史",
  11. "smoke_history": "无吸烟史",
  12. "condition_description": "无病",
  13. "file_list": [
  14. "http://123.jpg",
  15. "http://123.jpg",
  16. "http://123.jpg"
  17. ],
  18. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  19. "create_time": "2017-03-22T15:05:52.773782"
  20. }

删除问题

Description

删除问题

Method and URL Structure

Method Resource URL
DELETE /qa/question/destroy/${pk}/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. 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

  1. {
  2. "question":3,
  3. "diagnosis_result":"吃点头孢,吃一个疗程,就好了",
  4. "extra_suggestion":"平时多出蔬菜",
  5. "drug_suggestion":"多吃药💊"
  6. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d '' http://127.0.0.1:8000/qa/answer/create/

JSON Response

  1. {
  2. "pk": 9,
  3. "owner": {
  4. "owner": "doctor1",
  5. "invitation_code": "123456",
  6. "name": "doctor",
  7. "avatar": ""
  8. },
  9. "question": {
  10. "pk": 3,
  11. "owner": {
  12. "owner": "patient1",
  13. "invitation_code": "123",
  14. "name": "patient",
  15. "avatar": "http://123.jpg"
  16. },
  17. "order": "12257268228937975696240003",
  18. "allergy_history": "无过敏史",
  19. "smoke_history": "无吸烟史",
  20. "condition_description": "无病",
  21. "file_list": [
  22. "http://123.jpg",
  23. "http://123.jpg",
  24. "http://123.jpg"
  25. ],
  26. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  27. "create_time": "2017-03-22T15:05:52.773782"
  28. },
  29. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  30. "extra_suggestion": "平时多出蔬菜",
  31. "drug_suggestion":"多吃药💊",
  32. "create_time": "2017-03-22T16:41:09.317246"
  33. }

获取答案列表

Description

获取答案列表

Method and URL Structure

Method Resource URL
GET /qa/answer/list/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/list/

JSON Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 9,
  8. "owner": {
  9. "owner": "doctor1",
  10. "invitation_code": "123456",
  11. "name": "doctor",
  12. "avatar": ""
  13. },
  14. "question": {
  15. "pk": 3,
  16. "owner": {
  17. "owner": "patient1",
  18. "invitation_code": "123",
  19. "name": "patient",
  20. "avatar": "http://123.jpg"
  21. },
  22. "order": "12257268228937975696240003",
  23. "allergy_history": "无过敏史",
  24. "smoke_history": "无吸烟史",
  25. "condition_description": "无病",
  26. "file_list": [
  27. "http://123.jpg",
  28. "http://123.jpg",
  29. "http://123.jpg"
  30. ],
  31. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  32. "create_time": "2017-03-22T15:05:52.773782"
  33. },
  34. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  35. "extra_suggestion": "平时多出蔬菜",
  36. "drug_suggestion":"多吃药💊",
  37. "create_time": "2017-03-22T16:41:09.317246"
  38. }
  39. ]
  40. }

获取答案详情

Description

获取答案详情

Method and URL Structure

Method Resource URL
GET /qa/answer/detail/${pk}/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X GET -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/detail/3/

JSON Response

  1. {
  2. "pk": 9,
  3. "owner": {
  4. "owner": "doctor1",
  5. "invitation_code": "123456",
  6. "name": "doctor",
  7. "avatar": ""
  8. },
  9. "question": {
  10. "pk": 3,
  11. "owner": {
  12. "owner": "patient1",
  13. "invitation_code": "123",
  14. "name": "patient",
  15. "avatar": "http://123.jpg"
  16. },
  17. "order": "12257268228937975696240003",
  18. "allergy_history": "无过敏史",
  19. "smoke_history": "无吸烟史",
  20. "condition_description": "无病",
  21. "file_list": [
  22. "http://123.jpg",
  23. "http://123.jpg",
  24. "http://123.jpg"
  25. ],
  26. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  27. "create_time": "2017-03-22T15:05:52.773782"
  28. },
  29. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  30. "extra_suggestion": "平时多出蔬菜",
  31. "drug_suggestion":"多吃药💊",
  32. "create_time": "2017-03-22T16:41:09.317246"
  33. }

修改答案

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

  1. {
  2. "question":3,
  3. "diagnosis_result":"吃点头孢,吃一个疗程,就好了",
  4. "extra_suggestion":"平时多出蔬菜",
  5. "drug_suggestion":"多吃药💊"
  6. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. curl -X PUT -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' http://127.0.0.1:8000/qa/answer/update/2/

JSON Response

  1. {
  2. "pk": 9,
  3. "owner": {
  4. "owner": "doctor1",
  5. "invitation_code": "123456",
  6. "name": "doctor",
  7. "avatar": ""
  8. },
  9. "question": {
  10. "pk": 3,
  11. "owner": {
  12. "owner": "patient1",
  13. "invitation_code": "123",
  14. "name": "patient",
  15. "avatar": "http://123.jpg"
  16. },
  17. "order": "12257268228937975696240003",
  18. "allergy_history": "无过敏史",
  19. "smoke_history": "无吸烟史",
  20. "condition_description": "无病",
  21. "file_list": [
  22. "http://123.jpg",
  23. "http://123.jpg",
  24. "http://123.jpg"
  25. ],
  26. "desc_files": "http://123.jpg,http://123.jpg,http://123.jpg",
  27. "create_time": "2017-03-22T15:05:52.773782"
  28. },
  29. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  30. "extra_suggestion": "平时多出蔬菜",
  31. "drug_suggestion":"多吃药💊",
  32. "create_time": "2017-03-22T16:41:09.317246"
  33. }

删除答案

Description

删除答案

Method and URL Structure

Method Resource URL
DELETE /qa/answer/destroy/${pk}/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

* Authorization的值为登录成功后返回值

cURL Example

  1. 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

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注