|
@@ -10796,9 +10796,16 @@ func (c *DialysisAPIController) SaveLongMobileAdvice() {
|
10796
|
10796
|
patient_id := int64(dataBody["patient_id"].(float64))
|
10797
|
10797
|
|
10798
|
10798
|
day_count := int64(dataBody["day_count"].(float64))
|
|
10799
|
+
|
|
10800
|
+ groupNo := int64(dataBody["group_no"].(float64))
|
10799
|
10801
|
advice_doctor := c.GetMobileAdminUserInfo().AdminUser.Id
|
10800
|
10802
|
|
10801
|
10803
|
adviceLast, _ := service.GetLastLongAdviceList(org_id)
|
|
10804
|
+
|
|
10805
|
+ if groupNo <= 0 {
|
|
10806
|
+ group := service.GetMaxAdviceGroupID(org_id)
|
|
10807
|
+ groupNo = group + 1
|
|
10808
|
+ }
|
10802
|
10809
|
var template_id = ""
|
10803
|
10810
|
adviceLastId := strconv.FormatInt(adviceLast.ID, 10)
|
10804
|
10811
|
template_id = "M" + adviceLastId
|
|
@@ -10854,6 +10861,7 @@ func (c *DialysisAPIController) SaveLongMobileAdvice() {
|
10854
|
10861
|
PushStartTime: 0,
|
10855
|
10862
|
IsSettle: 0,
|
10856
|
10863
|
IsPrescription: 0,
|
|
10864
|
+ GroupNo: groupNo,
|
10857
|
10865
|
}
|
10858
|
10866
|
|
10859
|
10867
|
service.CreateMobileAdivce(advice)
|
|
@@ -10877,3 +10885,435 @@ func (c *DialysisAPIController) GetLongDoctorAdviceByPatient() {
|
10877
|
10885
|
"adminRoles": adminRoles,
|
10878
|
10886
|
})
|
10879
|
10887
|
}
|
|
10888
|
+
|
|
10889
|
+func (c *DialysisAPIController) SaveSelfChildDrugLongAdivce() {
|
|
10890
|
+
|
|
10891
|
+ org_id := c.GetMobileAdminUserInfo().Org.Id
|
|
10892
|
+ dataBody := make(map[string]interface{}, 0)
|
|
10893
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
10894
|
+ if err != nil {
|
|
10895
|
+ utils.ErrorLog(err.Error())
|
|
10896
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10897
|
+ return
|
|
10898
|
+ }
|
|
10899
|
+
|
|
10900
|
+ timeLayout := "2006-01-02"
|
|
10901
|
+ loc, _ := time.LoadLocation("Local")
|
|
10902
|
+
|
|
10903
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
10904
|
+ utils.ErrorLog("start_time")
|
|
10905
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10906
|
+ return
|
|
10907
|
+ }
|
|
10908
|
+
|
|
10909
|
+ startTime2, _ := dataBody["start_time"].(string)
|
|
10910
|
+ time_arr := strings.Split(startTime2, " ")
|
|
10911
|
+ if len(time_arr) > 0 {
|
|
10912
|
+ startTime2 = time_arr[0]
|
|
10913
|
+ }
|
|
10914
|
+ if dataBody["advice_date"] == nil || reflect.TypeOf(dataBody["advice_date"]).String() != "string" {
|
|
10915
|
+ utils.ErrorLog("advice_date")
|
|
10916
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10917
|
+ return
|
|
10918
|
+ }
|
|
10919
|
+ advice_date, _ := dataBody["advice_date"].(string)
|
|
10920
|
+
|
|
10921
|
+ var advicedateunix int64
|
|
10922
|
+ if len(advice_date) > 0 {
|
|
10923
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", advice_date+" 00:00:00", loc)
|
|
10924
|
+ if err != nil {
|
|
10925
|
+ fmt.Println(err)
|
|
10926
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10927
|
+ return
|
|
10928
|
+ }
|
|
10929
|
+ advicedateunix = theTime.Unix()
|
|
10930
|
+ }
|
|
10931
|
+
|
|
10932
|
+ adviceDate := startTime2
|
|
10933
|
+ if len(adviceDate) == 0 {
|
|
10934
|
+ utils.ErrorLog("len(adviceDate) == 0")
|
|
10935
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10936
|
+ return
|
|
10937
|
+ }
|
|
10938
|
+ theTime, err := time.ParseInLocation(timeLayout, adviceDate, loc)
|
|
10939
|
+ if err != nil {
|
|
10940
|
+ utils.ErrorLog(err.Error())
|
|
10941
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10942
|
+ return
|
|
10943
|
+ }
|
|
10944
|
+ AdviceDate := advicedateunix
|
|
10945
|
+ RecordDate := advicedateunix
|
|
10946
|
+
|
|
10947
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
10948
|
+ utils.ErrorLog("start_time")
|
|
10949
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10950
|
+ return
|
|
10951
|
+ }
|
|
10952
|
+ startTime, _ := dataBody["start_time"].(string)
|
|
10953
|
+
|
|
10954
|
+ if len(startTime) == 0 {
|
|
10955
|
+ utils.ErrorLog("len(start_time) == 0")
|
|
10956
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10957
|
+ return
|
|
10958
|
+ }
|
|
10959
|
+ theTime, err = time.ParseInLocation(timeLayout+" 15:04:05", startTime, loc)
|
|
10960
|
+
|
|
10961
|
+ if err != nil {
|
|
10962
|
+ utils.ErrorLog(err.Error())
|
|
10963
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
10964
|
+ return
|
|
10965
|
+ }
|
|
10966
|
+ StartTime := theTime.Unix()
|
|
10967
|
+
|
|
10968
|
+ advice_name, _ := dataBody["advice_name"].(string)
|
|
10969
|
+
|
|
10970
|
+ advice_desc, _ := dataBody["advice_desc"].(string)
|
|
10971
|
+
|
|
10972
|
+ delivery_way, _ := dataBody["delivery_way"].(string)
|
|
10973
|
+
|
|
10974
|
+ execution_frequency, _ := dataBody["execution_frequency"].(string)
|
|
10975
|
+
|
|
10976
|
+ prescribing_number := dataBody["prescribing_number"].(float64)
|
|
10977
|
+
|
|
10978
|
+ prescribing_number_unit := dataBody["prescribing_number_unit"].(string)
|
|
10979
|
+
|
|
10980
|
+ remark := dataBody["remark"].(string)
|
|
10981
|
+
|
|
10982
|
+ single_dose := dataBody["single_dose"].(float64)
|
|
10983
|
+
|
|
10984
|
+ single_dose_unit := dataBody["single_dose_unit"].(string)
|
|
10985
|
+
|
|
10986
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
10987
|
+
|
|
10988
|
+ groupNo := int64(dataBody["group_no"].(float64))
|
|
10989
|
+
|
|
10990
|
+ parent_id := int64(dataBody["parent_id"].(float64))
|
|
10991
|
+
|
|
10992
|
+ advice_doctor := c.GetMobileAdminUserInfo().AdminUser.Id
|
|
10993
|
+ advice := models.XtDoctorAdviceOne{
|
|
10994
|
+ UserOrgId: org_id,
|
|
10995
|
+ PatientId: patient_id,
|
|
10996
|
+ AdviceType: 1,
|
|
10997
|
+ AdviceDate: AdviceDate,
|
|
10998
|
+ StartTime: StartTime,
|
|
10999
|
+ AdviceName: advice_name,
|
|
11000
|
+ AdviceDesc: advice_desc,
|
|
11001
|
+ ReminderDate: 0,
|
|
11002
|
+ SingleDose: single_dose,
|
|
11003
|
+ SingleDoseUnit: single_dose_unit,
|
|
11004
|
+ PrescribingNumber: prescribing_number,
|
|
11005
|
+ PrescribingNumberUnit: prescribing_number_unit,
|
|
11006
|
+ DeliveryWay: delivery_way,
|
|
11007
|
+ ExecutionFrequency: execution_frequency,
|
|
11008
|
+ AdviceDoctor: advice_doctor,
|
|
11009
|
+ Status: 1,
|
|
11010
|
+ CreatedTime: time.Now().Unix(),
|
|
11011
|
+ UpdatedTime: time.Now().Unix(),
|
|
11012
|
+ AdviceAffirm: "",
|
|
11013
|
+ Remark: remark,
|
|
11014
|
+ StopTime: 0,
|
|
11015
|
+ StopReason: "",
|
|
11016
|
+ StopDoctor: 0,
|
|
11017
|
+ StopState: 0,
|
|
11018
|
+ ParentId: parent_id,
|
|
11019
|
+ ExecutionTime: 0,
|
|
11020
|
+ ExecutionStaff: 0,
|
|
11021
|
+ ExecutionState: 0,
|
|
11022
|
+ Checker: 0,
|
|
11023
|
+ RecordDate: RecordDate,
|
|
11024
|
+ DialysisOrderId: 0,
|
|
11025
|
+ CheckTime: 0,
|
|
11026
|
+ CheckState: 0,
|
|
11027
|
+ DrugSpec: 0,
|
|
11028
|
+ DrugSpecUnit: "",
|
|
11029
|
+ Groupno: groupNo,
|
|
11030
|
+ RemindType: 0,
|
|
11031
|
+ FrequencyType: 0,
|
|
11032
|
+ DayCount: 0,
|
|
11033
|
+ WeekDay: "",
|
|
11034
|
+ TemplateId: "",
|
|
11035
|
+ Modifier: 0,
|
|
11036
|
+ }
|
|
11037
|
+
|
|
11038
|
+ service.CreateMobileAdivceOne(advice)
|
|
11039
|
+
|
|
11040
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11041
|
+ "msg": "保存成功!",
|
|
11042
|
+ })
|
|
11043
|
+}
|
|
11044
|
+
|
|
11045
|
+func (c *DialysisAPIController) DeleteSelfAdviceSubAdvice() {
|
|
11046
|
+
|
|
11047
|
+ id, _ := c.GetInt64("id")
|
|
11048
|
+
|
|
11049
|
+ service.DeleteSelfAdviceSubAdvice(id)
|
|
11050
|
+
|
|
11051
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11052
|
+ "msg": "保存成功!",
|
|
11053
|
+ })
|
|
11054
|
+}
|
|
11055
|
+
|
|
11056
|
+func (c *DialysisAPIController) GetEditAdviceAction() {
|
|
11057
|
+
|
|
11058
|
+ id, _ := c.GetInt64("id")
|
|
11059
|
+ org_id := c.GetMobileAdminUserInfo().Org.Id
|
|
11060
|
+ advice, _ := service.GetEditAdviceActionList(id, org_id)
|
|
11061
|
+ drugList, _ := service.GetAllDrugList(org_id)
|
|
11062
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11063
|
+ "advice": advice,
|
|
11064
|
+ "drugList": drugList,
|
|
11065
|
+ })
|
|
11066
|
+}
|
|
11067
|
+
|
|
11068
|
+func (c *DialysisAPIController) UpdateLongMobileAdvice() {
|
|
11069
|
+
|
|
11070
|
+ dataBody := make(map[string]interface{}, 0)
|
|
11071
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
11072
|
+ if err != nil {
|
|
11073
|
+ utils.ErrorLog(err.Error())
|
|
11074
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11075
|
+ return
|
|
11076
|
+ }
|
|
11077
|
+
|
|
11078
|
+ timeLayout := "2006-01-02"
|
|
11079
|
+ loc, _ := time.LoadLocation("Local")
|
|
11080
|
+
|
|
11081
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
11082
|
+ utils.ErrorLog("start_time")
|
|
11083
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11084
|
+ return
|
|
11085
|
+ }
|
|
11086
|
+
|
|
11087
|
+ startTime2, _ := dataBody["start_time"].(string)
|
|
11088
|
+ time_arr := strings.Split(startTime2, " ")
|
|
11089
|
+ if len(time_arr) > 0 {
|
|
11090
|
+ startTime2 = time_arr[0]
|
|
11091
|
+ }
|
|
11092
|
+ if dataBody["advice_date"] == nil || reflect.TypeOf(dataBody["advice_date"]).String() != "string" {
|
|
11093
|
+ utils.ErrorLog("advice_date")
|
|
11094
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11095
|
+ return
|
|
11096
|
+ }
|
|
11097
|
+ advice_date, _ := dataBody["advice_date"].(string)
|
|
11098
|
+
|
|
11099
|
+ var advicedateunix int64
|
|
11100
|
+ if len(advice_date) > 0 {
|
|
11101
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", advice_date+" 00:00:00", loc)
|
|
11102
|
+ if err != nil {
|
|
11103
|
+ fmt.Println(err)
|
|
11104
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11105
|
+ return
|
|
11106
|
+ }
|
|
11107
|
+ advicedateunix = theTime.Unix()
|
|
11108
|
+ }
|
|
11109
|
+
|
|
11110
|
+ adviceDate := startTime2
|
|
11111
|
+ if len(adviceDate) == 0 {
|
|
11112
|
+ utils.ErrorLog("len(adviceDate) == 0")
|
|
11113
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11114
|
+ return
|
|
11115
|
+ }
|
|
11116
|
+ theTime, err := time.ParseInLocation(timeLayout, adviceDate, loc)
|
|
11117
|
+ if err != nil {
|
|
11118
|
+ utils.ErrorLog(err.Error())
|
|
11119
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11120
|
+ return
|
|
11121
|
+ }
|
|
11122
|
+ AdviceDate := advicedateunix
|
|
11123
|
+ RecordDate := advicedateunix
|
|
11124
|
+
|
|
11125
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
11126
|
+ utils.ErrorLog("start_time")
|
|
11127
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11128
|
+ return
|
|
11129
|
+ }
|
|
11130
|
+ startTime, _ := dataBody["start_time"].(string)
|
|
11131
|
+
|
|
11132
|
+ if len(startTime) == 0 {
|
|
11133
|
+ utils.ErrorLog("len(start_time) == 0")
|
|
11134
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11135
|
+ return
|
|
11136
|
+ }
|
|
11137
|
+ theTime, err = time.ParseInLocation(timeLayout+" 15:04:05", startTime, loc)
|
|
11138
|
+
|
|
11139
|
+ if err != nil {
|
|
11140
|
+ utils.ErrorLog(err.Error())
|
|
11141
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11142
|
+ return
|
|
11143
|
+ }
|
|
11144
|
+ StartTime := theTime.Unix()
|
|
11145
|
+
|
|
11146
|
+ advice_name, _ := dataBody["advice_name"].(string)
|
|
11147
|
+
|
|
11148
|
+ advice_desc, _ := dataBody["advice_desc"].(string)
|
|
11149
|
+
|
|
11150
|
+ delivery_way, _ := dataBody["delivery_way"].(string)
|
|
11151
|
+
|
|
11152
|
+ execution_frequency, _ := dataBody["execution_frequency"].(string)
|
|
11153
|
+
|
|
11154
|
+ prescribing_number := dataBody["prescribing_number"].(float64)
|
|
11155
|
+
|
|
11156
|
+ prescribing_number_unit := dataBody["prescribing_number_unit"].(string)
|
|
11157
|
+
|
|
11158
|
+ remark := dataBody["remark"].(string)
|
|
11159
|
+
|
|
11160
|
+ single_dose := dataBody["single_dose"].(float64)
|
|
11161
|
+
|
|
11162
|
+ single_dose_unit := dataBody["single_dose_unit"].(string)
|
|
11163
|
+
|
|
11164
|
+ id := int64(dataBody["id"].(float64))
|
|
11165
|
+
|
|
11166
|
+ frequency_type := int64(dataBody["frequency_type"].(float64))
|
|
11167
|
+
|
|
11168
|
+ frequency_week, _ := dataBody["frequency_week"].(string)
|
|
11169
|
+
|
|
11170
|
+ day_count := int64(dataBody["day_count"].(float64))
|
|
11171
|
+
|
|
11172
|
+ advice_doctor := c.GetMobileAdminUserInfo().AdminUser.Id
|
|
11173
|
+ advice := models.XtDoctorAdviceOne{
|
|
11174
|
+ AdviceDate: AdviceDate,
|
|
11175
|
+ StartTime: StartTime,
|
|
11176
|
+ AdviceName: advice_name,
|
|
11177
|
+ AdviceDesc: advice_desc,
|
|
11178
|
+ SingleDose: single_dose,
|
|
11179
|
+ SingleDoseUnit: single_dose_unit,
|
|
11180
|
+ PrescribingNumber: prescribing_number,
|
|
11181
|
+ PrescribingNumberUnit: prescribing_number_unit,
|
|
11182
|
+ DeliveryWay: delivery_way,
|
|
11183
|
+ ExecutionFrequency: execution_frequency,
|
|
11184
|
+ AdviceDoctor: advice_doctor,
|
|
11185
|
+ Remark: remark,
|
|
11186
|
+ RecordDate: RecordDate,
|
|
11187
|
+ FrequencyType: frequency_type,
|
|
11188
|
+ DayCount: day_count,
|
|
11189
|
+ WeekDay: frequency_week,
|
|
11190
|
+ }
|
|
11191
|
+
|
|
11192
|
+ service.UpdateMobileDoctorAdviceByIdOne(id, advice)
|
|
11193
|
+
|
|
11194
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11195
|
+ "advice": advice,
|
|
11196
|
+ })
|
|
11197
|
+}
|
|
11198
|
+
|
|
11199
|
+func (c *DialysisAPIController) UpdateEditDrugOrder() {
|
|
11200
|
+
|
|
11201
|
+ dataBody := make(map[string]interface{}, 0)
|
|
11202
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
11203
|
+ if err != nil {
|
|
11204
|
+ utils.ErrorLog(err.Error())
|
|
11205
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11206
|
+ return
|
|
11207
|
+ }
|
|
11208
|
+
|
|
11209
|
+ timeLayout := "2006-01-02"
|
|
11210
|
+ loc, _ := time.LoadLocation("Local")
|
|
11211
|
+
|
|
11212
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
11213
|
+ utils.ErrorLog("start_time")
|
|
11214
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11215
|
+ return
|
|
11216
|
+ }
|
|
11217
|
+
|
|
11218
|
+ startTime2, _ := dataBody["start_time"].(string)
|
|
11219
|
+ time_arr := strings.Split(startTime2, " ")
|
|
11220
|
+ if len(time_arr) > 0 {
|
|
11221
|
+ startTime2 = time_arr[0]
|
|
11222
|
+ }
|
|
11223
|
+ if dataBody["advice_date"] == nil || reflect.TypeOf(dataBody["advice_date"]).String() != "string" {
|
|
11224
|
+ utils.ErrorLog("advice_date")
|
|
11225
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11226
|
+ return
|
|
11227
|
+ }
|
|
11228
|
+ advice_date, _ := dataBody["advice_date"].(string)
|
|
11229
|
+
|
|
11230
|
+ var advicedateunix int64
|
|
11231
|
+ if len(advice_date) > 0 {
|
|
11232
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", advice_date+" 00:00:00", loc)
|
|
11233
|
+ if err != nil {
|
|
11234
|
+ fmt.Println(err)
|
|
11235
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11236
|
+ return
|
|
11237
|
+ }
|
|
11238
|
+ advicedateunix = theTime.Unix()
|
|
11239
|
+ }
|
|
11240
|
+
|
|
11241
|
+ adviceDate := startTime2
|
|
11242
|
+ if len(adviceDate) == 0 {
|
|
11243
|
+ utils.ErrorLog("len(adviceDate) == 0")
|
|
11244
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11245
|
+ return
|
|
11246
|
+ }
|
|
11247
|
+ theTime, err := time.ParseInLocation(timeLayout, adviceDate, loc)
|
|
11248
|
+ if err != nil {
|
|
11249
|
+ utils.ErrorLog(err.Error())
|
|
11250
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11251
|
+ return
|
|
11252
|
+ }
|
|
11253
|
+ AdviceDate := advicedateunix
|
|
11254
|
+ RecordDate := advicedateunix
|
|
11255
|
+
|
|
11256
|
+ if dataBody["start_time"] == nil || reflect.TypeOf(dataBody["start_time"]).String() != "string" {
|
|
11257
|
+ utils.ErrorLog("start_time")
|
|
11258
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11259
|
+ return
|
|
11260
|
+ }
|
|
11261
|
+ startTime, _ := dataBody["start_time"].(string)
|
|
11262
|
+
|
|
11263
|
+ if len(startTime) == 0 {
|
|
11264
|
+ utils.ErrorLog("len(start_time) == 0")
|
|
11265
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11266
|
+ return
|
|
11267
|
+ }
|
|
11268
|
+ theTime, err = time.ParseInLocation(timeLayout+" 15:04:05", startTime, loc)
|
|
11269
|
+
|
|
11270
|
+ if err != nil {
|
|
11271
|
+ utils.ErrorLog(err.Error())
|
|
11272
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
11273
|
+ return
|
|
11274
|
+ }
|
|
11275
|
+ StartTime := theTime.Unix()
|
|
11276
|
+
|
|
11277
|
+ advice_name, _ := dataBody["advice_name"].(string)
|
|
11278
|
+
|
|
11279
|
+ advice_desc, _ := dataBody["advice_desc"].(string)
|
|
11280
|
+
|
|
11281
|
+ delivery_way, _ := dataBody["delivery_way"].(string)
|
|
11282
|
+
|
|
11283
|
+ execution_frequency, _ := dataBody["execution_frequency"].(string)
|
|
11284
|
+
|
|
11285
|
+ prescribing_number := dataBody["prescribing_number"].(float64)
|
|
11286
|
+
|
|
11287
|
+ prescribing_number_unit := dataBody["prescribing_number_unit"].(string)
|
|
11288
|
+
|
|
11289
|
+ remark := dataBody["remark"].(string)
|
|
11290
|
+
|
|
11291
|
+ single_dose := dataBody["single_dose"].(float64)
|
|
11292
|
+
|
|
11293
|
+ single_dose_unit := dataBody["single_dose_unit"].(string)
|
|
11294
|
+
|
|
11295
|
+ id := int64(dataBody["id"].(float64))
|
|
11296
|
+
|
|
11297
|
+ advice_doctor := c.GetMobileAdminUserInfo().AdminUser.Id
|
|
11298
|
+ advice := models.XtDoctorAdviceOne{
|
|
11299
|
+ AdviceDate: AdviceDate,
|
|
11300
|
+ StartTime: StartTime,
|
|
11301
|
+ AdviceName: advice_name,
|
|
11302
|
+ AdviceDesc: advice_desc,
|
|
11303
|
+ SingleDose: single_dose,
|
|
11304
|
+ SingleDoseUnit: single_dose_unit,
|
|
11305
|
+ PrescribingNumber: prescribing_number,
|
|
11306
|
+ PrescribingNumberUnit: prescribing_number_unit,
|
|
11307
|
+ DeliveryWay: delivery_way,
|
|
11308
|
+ ExecutionFrequency: execution_frequency,
|
|
11309
|
+ AdviceDoctor: advice_doctor,
|
|
11310
|
+ Remark: remark,
|
|
11311
|
+ RecordDate: RecordDate,
|
|
11312
|
+ }
|
|
11313
|
+
|
|
11314
|
+ service.UpdateMobileDoctorAdviceById(id, advice)
|
|
11315
|
+
|
|
11316
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11317
|
+ "advice": advice,
|
|
11318
|
+ })
|
|
11319
|
+}
|