protocol.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 GetPatientType(c *gin.Context) {
  10. res, err := service.ProtocolService.GetPatientType(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 GetBodyPart(c *gin.Context) {
  18. res, err := service.ProtocolService.GetBodyPart(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 GetProcedure(c *gin.Context) {
  29. res, err := service.ProtocolService.GetProcedure(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 GetView(c *gin.Context) {
  40. res, err := service.ProtocolService.GetView(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. }