|
@@ -56,6 +56,8 @@ func DialysisApiRegistRouters() {
|
56
|
56
|
|
57
|
57
|
beego.Router("/api/func_per/get", &DialysisApiController{}, "Get:GetFuncPurview")
|
58
|
58
|
|
|
59
|
+ beego.Router("/api/doctoradvice/get", &DialysisApiController{}, "Get:GetLastOrNextDoctorAdvice")
|
|
60
|
+
|
59
|
61
|
}
|
60
|
62
|
|
61
|
63
|
func (c *DialysisApiController) PostPrescription() {
|
|
@@ -5107,3 +5109,30 @@ func (this *DialysisApiController) GetFuncPurview() {
|
5107
|
5109
|
})
|
5108
|
5110
|
}
|
5109
|
5111
|
}
|
|
5112
|
+
|
|
5113
|
+func (this *DialysisApiController) GetLastOrNextDoctorAdvice() {
|
|
5114
|
+ change_type, _ := this.GetInt64("type", 0)
|
|
5115
|
+ record_date := this.GetString("record_time")
|
|
5116
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
5117
|
+
|
|
5118
|
+ timeLayout := "2006-01-02"
|
|
5119
|
+ loc, _ := time.LoadLocation("Local")
|
|
5120
|
+ theAdviceRecordTime, _ := time.ParseInLocation(timeLayout, record_date, loc)
|
|
5121
|
+ record_time := theAdviceRecordTime.Unix()
|
|
5122
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
5123
|
+ advices, err := service.GetDoctorAdviceByType(change_type, record_time, adminUserInfo.CurrentOrgId, patient_id)
|
|
5124
|
+ if err == nil {
|
|
5125
|
+ if len(advices) == 0 {
|
|
5126
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDoctorAdviceEmpty)
|
|
5127
|
+ return
|
|
5128
|
+ } else {
|
|
5129
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
5130
|
+ "advices": advices,
|
|
5131
|
+ })
|
|
5132
|
+ return
|
|
5133
|
+ }
|
|
5134
|
+ } else {
|
|
5135
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
5136
|
+ return
|
|
5137
|
+ }
|
|
5138
|
+}
|