protocol.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package v1
  2. import (
  3. "github.com/gin-gonic/gin"
  4. )
  5. import (
  6. "auth-server/common"
  7. "auth-server/service"
  8. )
  9. func GetPatientTypeList(c *gin.Context) {
  10. res, err := service.ProtocolClient.GetPatientTypeList(common.GC2GM(c), common.IsEnabled(c))
  11. if err != nil {
  12. common.HttpErr(c, err)
  13. return
  14. }
  15. common.HttpSuccess(c, res)
  16. }
  17. func GetBodyPartList(c *gin.Context) {
  18. res, err := service.ProtocolClient.GetBodyPartList(common.GC2GM(c),
  19. common.GetQueryString(c, "patient_type"),
  20. common.GetQueryString(c, "modality"),
  21. common.IsEnabled(c))
  22. if err != nil {
  23. common.HttpErr(c, err)
  24. return
  25. }
  26. common.HttpSuccess(c, res)
  27. }
  28. func GetProcedureList(c *gin.Context) {
  29. res, err := service.ProtocolClient.GetProcedureList(common.GC2GM(c),
  30. common.GetQueryString(c, "patient_type"),
  31. common.GetQueryString(c, "body_part"),
  32. common.IsEnabled(c))
  33. if err != nil {
  34. common.HttpErr(c, err)
  35. return
  36. }
  37. common.HttpSuccess(c, res)
  38. }
  39. func GetViewList(c *gin.Context) {
  40. res, err := service.ProtocolClient.GetViewList(common.GC2GM(c),
  41. common.GetQueryString(c, "patient_type"),
  42. common.GetQueryString(c, "body_part"),
  43. common.GetQueryString(c, "procedure_id"),
  44. common.IsEnabled(c))
  45. if err != nil {
  46. common.HttpErr(c, err)
  47. return
  48. }
  49. common.HttpSuccess(c, res)
  50. }
  51. func GetView(c *gin.Context) {
  52. id := c.Param("id")
  53. res, err := service.ProtocolClient.GetView(common.GC2GM(c), &id)
  54. if err != nil {
  55. common.HttpErr(c, err)
  56. return
  57. }
  58. common.HttpSuccess(c, res)
  59. }
  60. func GetAprByView(c *gin.Context) {
  61. id := c.Param("id")
  62. res, err := service.ProtocolClient.GetApr(common.GC2GM(c), &id, nil, common.IsEnabled(c))
  63. if err != nil {
  64. common.HttpErr(c, err)
  65. return
  66. }
  67. common.HttpSuccess(c, res)
  68. }
  69. func GetApr(c *gin.Context) {
  70. id := c.Param("id")
  71. res, err := service.ProtocolClient.GetApr(common.GC2GM(c), nil, &id, common.IsEnabled(c))
  72. if err != nil {
  73. common.HttpErr(c, err)
  74. return
  75. }
  76. common.HttpSuccess(c, res)
  77. }