[关闭]
@chenwei123 2017-03-23T09:28:50.000000Z 字数 16524 阅读 440

问答(废弃了)

肺轻松


诊断标签

创建诊断标签

Description

医生创建诊断标签

Method and URL Structure

Method Resource URL
POST /qa/diagnosis_tag/create/

Request Parameters

Name Description Required Default
name 诊断名称 Yes
description 诊断描述 NO

Request

  1. {
  2. "name":"肺结核",
  3. "description":"这是一个肺结核"
  4. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qa/diagnosis_tag/create/

JSON Response

  1. {
  2. "pk": 4,
  3. "owner": "doctor1",
  4. "name": "肺结核",
  5. "description": "这是一个肺结核"
  6. }

获取诊断标签列表

Description

获取诊断标签列表

Method and URL Structure

Method Resource URL
GET /qa/diagnosis_tag/list/

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qa/diagnosis_tag/list/

JSON Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 4,
  8. "owner": "doctor1",
  9. "name": "肺结核",
  10. "description": "这是一个肺结核"
  11. },
  12. {
  13. "pk": 3,
  14. "owner": "doctor1",
  15. "name": "肺结核",
  16. "description": "这是一个肺结核"
  17. },
  18. {
  19. "pk": 2,
  20. "owner": "doctor1",
  21. "name": "哮喘",
  22. "description": "这是一个挺严重的哮喘病"
  23. }
  24. ]
  25. }

获取诊断标签详情

Description

获取诊断标签详情

Method and URL Structure

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

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qa/diagnosis_tag/detail/2/

JSON Response

  1. {
  2. "pk": 2,
  3. "owner": "doctor1",
  4. "name": "哮喘",
  5. "description": "这是一个挺严重的哮喘病"
  6. }

修改诊断标签

Description

修改诊断标签

Method and URL Structure

Method Resource URL
PUT /qa/diagnosis_tag/update/${pk}/

Request Parameters

Name Description Required Default
name 诊断名称 NO
description 诊断描述 NO

Request

  1. {
  2. "name":"肺结核",
  3. "description":"这是一个肺结核"
  4. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qa/diagnosis_tag/update/2/

JSON Response

  1. {
  2. "pk": 2,
  3. "owner": "doctor1",
  4. "name": "哮喘",
  5. "description": "这是一个挺严重的哮喘病"
  6. }

删除诊断标签

Description

删除诊断标签

Method and URL Structure

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

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'order_type=online&doctor=doctor1' http://127.0.0.1:8000/qa/diagnosis_tag/destroy/2/

JSON Response

Name Description Default
detail 失败原因 Not found
status 成功 204

常用药

创建药

Description

医生创建药

Method and URL Structure

Method Resource URL
POST /qa/drug/create/

Request Parameters

Name Description Required Default
name 药名称 YES
standard 规格 YES
total_dosage 总量 YES
each_dosage 每次用量 YES
day_times 一天多少次 YES

Request

  1. {
  2. "name":"头孢",
  3. "standard":"0.25*20s",
  4. "total_dosage":"125mg*10盒(瓶)",
  5. "each_dosage":"0.5g",
  6. "day_times":"3次/天"
  7. }

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/drug/create/

JSON Response

  1. {
  2. "pk": 6,
  3. "owner": "doctor1",
  4. "name": "头孢",
  5. "standard": "0.25*20s",
  6. "total_dosage": "125mg*10盒(瓶)",
  7. "each_dosage": "0.5g",
  8. "day_times": "3次/天"
  9. }

获取药列表

Description

获取药列表

Method and URL Structure

Method Resource URL
GET /qa/drug/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/drug/list/

JSON Response

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 6,
  8. "owner": "doctor1",
  9. "name": "头孢",
  10. "standard": "0.25*20s",
  11. "total_dosage": "125mg*10盒(瓶)",
  12. "each_dosage": "0.5g",
  13. "day_times": "3次/天"
  14. },
  15. {
  16. "pk": 5,
  17. "owner": "doctor1",
  18. "name": "头孢",
  19. "standard": "0.25*20s",
  20. "total_dosage": "125mg*10盒(瓶)",
  21. "each_dosage": "0.5g",
  22. "day_times": "3次/天"
  23. },
  24. {
  25. "pk": 4,
  26. "owner": "doctor1",
  27. "name": "头孢",
  28. "standard": "0.25*20s",
  29. "total_dosage": "125mg*10盒(瓶)",
  30. "each_dosage": "0.5g",
  31. "day_times": "3次/天"
  32. },
  33. {
  34. "pk": 3,
  35. "owner": "doctor1",
  36. "name": "头孢",
  37. "standard": "0.25*20s",
  38. "total_dosage": "125mg*10盒(瓶)",
  39. "each_dosage": "0.5g",
  40. "day_times": "3次/天"
  41. }
  42. ]
  43. }

获取药详情

Description

获取药详情

Method and URL Structure

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

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/drug/detail/3/

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": "doctor1",
  4. "name": "头孢",
  5. "standard": "0.25*20s",
  6. "total_dosage": "125mg*10盒(瓶)",
  7. "each_dosage": "0.5g",
  8. "day_times": "3次/天"
  9. }

修改药

Description

修改💊

Method and URL Structure

Method Resource URL
PUT /qa/drug/update/${pk}/

Request Parameters

Name Description Required Default
name 药名称 NO
standard 规格 NO
total_dosage 总量 NO
each_dosage 每次用量 NO
day_times 一天多少次 NO

Request

  1. {
  2. "name":"头孢",
  3. "standard":"0.25*20s",
  4. "total_dosage":"125mg*10盒(瓶)",
  5. "each_dosage":"0.5g",
  6. "day_times":"3次/天"
  7. }

Request Header

Name Description Required Default
Authorization Token 48cebaf1955b6f45ee76515dbed221a1f229dd69 Yes

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

cURL Example

  1. curl -X POST -H 'Authorization: Token 48cebaf1955b6f45ee76515dbed221a1f229dd69' -d 'name=头孢&standard=0.25*20s&total_dosage=125mg*10盒(瓶)&each_dosage=0.5g&day_times=3次/天' http://127.0.0.1:8000/qa/drug/update/2/

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": "doctor1",
  4. "name": "头孢",
  5. "standard": "0.25*20s",
  6. "total_dosage": "125mg*10盒(瓶)",
  7. "each_dosage": "0.5g",
  8. "day_times": "3次/天"
  9. }

删除药

Description

删除💊

Method and URL Structure

Method Resource URL
DELETE /qa/drug/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/drug/destroy/2/

JSON Response

Name Description Default
detail 失败原因 Not found
status 成功 204

问题

创建问题

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
tag 诊断标签的 pk/id YES
drug 常用药的 pk/id YES

Request

  1. {
  2. "question":3,
  3. "diagnosis_result":"吃点头孢,吃一个疗程,就好了",
  4. "extra_suggestion":"平时多出蔬菜",
  5. "tag":"2,3",
  6. "drug":"1,3"
  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/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_tag": [
  30. {
  31. "pk": 3,
  32. "owner": "doctor1",
  33. "name": "肺结核",
  34. "description": "这是一个肺结核"
  35. },
  36. {
  37. "pk": 2,
  38. "owner": "doctor1",
  39. "name": "哮喘",
  40. "description": "这是一个挺严重的哮喘病"
  41. }
  42. ],
  43. "drug": [
  44. {
  45. "pk": 3,
  46. "owner": "doctor1",
  47. "name": "头孢",
  48. "standard": "0.25*20s",
  49. "total_dosage": "125mg*10盒(瓶)",
  50. "each_dosage": "0.5g",
  51. "day_times": "3次/天"
  52. },
  53. {
  54. "pk": 1,
  55. "owner": "patient1",
  56. "name": "头孢",
  57. "standard": "0.25*20s",
  58. "total_dosage": "125mg*10盒(瓶)",
  59. "each_dosage": "0.5g",
  60. "day_times": "3次/天"
  61. }
  62. ],
  63. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  64. "extra_suggestion": "平时多出蔬菜",
  65. "create_time": "2017-03-22T16:41:09.317246"
  66. }

获取答案列表

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_tag": [
  35. {
  36. "pk": 3,
  37. "owner": "doctor1",
  38. "name": "肺结核",
  39. "description": "这是一个肺结核"
  40. },
  41. {
  42. "pk": 2,
  43. "owner": "doctor1",
  44. "name": "哮喘",
  45. "description": "这是一个挺严重的哮喘病"
  46. }
  47. ],
  48. "drug": [
  49. {
  50. "pk": 3,
  51. "owner": "doctor1",
  52. "name": "头孢",
  53. "standard": "0.25*20s",
  54. "total_dosage": "125mg*10盒(瓶)",
  55. "each_dosage": "0.5g",
  56. "day_times": "3次/天"
  57. },
  58. {
  59. "pk": 1,
  60. "owner": "patient1",
  61. "name": "头孢",
  62. "standard": "0.25*20s",
  63. "total_dosage": "125mg*10盒(瓶)",
  64. "each_dosage": "0.5g",
  65. "day_times": "3次/天"
  66. }
  67. ],
  68. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  69. "extra_suggestion": "平时多出蔬菜",
  70. "create_time": "2017-03-22T16:41:09.317246"
  71. }
  72. ]
  73. }

获取答案详情

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_tag": [
  30. {
  31. "pk": 3,
  32. "owner": "doctor1",
  33. "name": "肺结核",
  34. "description": "这是一个肺结核"
  35. },
  36. {
  37. "pk": 2,
  38. "owner": "doctor1",
  39. "name": "哮喘",
  40. "description": "这是一个挺严重的哮喘病"
  41. }
  42. ],
  43. "drug": [
  44. {
  45. "pk": 3,
  46. "owner": "doctor1",
  47. "name": "头孢",
  48. "standard": "0.25*20s",
  49. "total_dosage": "125mg*10盒(瓶)",
  50. "each_dosage": "0.5g",
  51. "day_times": "3次/天"
  52. },
  53. {
  54. "pk": 1,
  55. "owner": "patient1",
  56. "name": "头孢",
  57. "standard": "0.25*20s",
  58. "total_dosage": "125mg*10盒(瓶)",
  59. "each_dosage": "0.5g",
  60. "day_times": "3次/天"
  61. }
  62. ],
  63. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  64. "extra_suggestion": "平时多出蔬菜",
  65. "create_time": "2017-03-22T16:41:09.317246"
  66. }

修改答案

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
tag 诊断标签的 pk/id YES
drug 常用药的 pk/id YES

Request

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

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_tag": [
  30. {
  31. "pk": 3,
  32. "owner": "doctor1",
  33. "name": "肺结核",
  34. "description": "这是一个肺结核"
  35. },
  36. {
  37. "pk": 2,
  38. "owner": "doctor1",
  39. "name": "哮喘",
  40. "description": "这是一个挺严重的哮喘病"
  41. }
  42. ],
  43. "drug": [
  44. {
  45. "pk": 3,
  46. "owner": "doctor1",
  47. "name": "头孢",
  48. "standard": "0.25*20s",
  49. "total_dosage": "125mg*10盒(瓶)",
  50. "each_dosage": "0.5g",
  51. "day_times": "3次/天"
  52. },
  53. {
  54. "pk": 1,
  55. "owner": "patient1",
  56. "name": "头孢",
  57. "standard": "0.25*20s",
  58. "total_dosage": "125mg*10盒(瓶)",
  59. "each_dosage": "0.5g",
  60. "day_times": "3次/天"
  61. }
  62. ],
  63. "diagnosis_result": "吃点头孢,吃一个疗程,就好了",
  64. "extra_suggestion": "平时多出蔬菜",
  65. "create_time": "2017-03-22T16:41:09.317246"
  66. }

删除答案

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

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