|
@@ -139,10 +139,13 @@ func (this *PharmacyController) TodayNumber() {
|
139
|
139
|
itotal, _ = service.GetTodayAdviceCount(stime, etime, orgid, 0)
|
140
|
140
|
|
141
|
141
|
drug, _ := service.GetAllBaseDrugList(orgid)
|
|
142
|
+
|
|
143
|
+ config, _ := service.GetDrugCodeConfig(orgid)
|
142
|
144
|
this.ServeSuccessJSON(map[string]interface{}{
|
143
|
145
|
"wtotal": wtotal,
|
144
|
146
|
"itotal": itotal,
|
145
|
147
|
"drug": drug,
|
|
148
|
+ "config": config,
|
146
|
149
|
})
|
147
|
150
|
return
|
148
|
151
|
|
|
@@ -351,6 +354,8 @@ func (this *PharmacyController) GetPharmacyContent() {
|
351
|
354
|
prescriptionListByToDay, _ := service.GetPrescriptionListByToDay(orgid, patient_id, stime)
|
352
|
355
|
|
353
|
356
|
diagnose, _ := service.FindAllDiagnose(orgid)
|
|
357
|
+
|
|
358
|
+ config, _ := service.GetDrugCodeConfig(orgid)
|
354
|
359
|
if err != nil {
|
355
|
360
|
utils.ErrorLog(err.Error())
|
356
|
361
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -367,6 +372,7 @@ func (this *PharmacyController) GetPharmacyContent() {
|
367
|
372
|
return_value["doctors"] = allDoctor
|
368
|
373
|
return_value["prescription"] = prescriptionListByToDay
|
369
|
374
|
return_value["diagnose"] = diagnose
|
|
375
|
+ return_value["config"] = config
|
370
|
376
|
//if is_medicine == 1{发药时间先不展示
|
371
|
377
|
// return_value["time"] = time
|
372
|
378
|
//}
|
|
@@ -402,12 +408,26 @@ func (this *PharmacyController) DispensingMedicine() {
|
402
|
408
|
etime = stime + 86399
|
403
|
409
|
}
|
404
|
410
|
tmp_bool := service.IsPharmacyConfig(orgid)
|
|
411
|
+ codeConfig, _ := service.GetDrugCodeConfig(orgid)
|
405
|
412
|
if tmp_bool == true {
|
406
|
413
|
advicelist, _ := service.FindeHisAdviceDocAdvice(orgid, patient_id, stime, etime)
|
407
|
414
|
if len(advicelist) > 0 {
|
|
415
|
+
|
408
|
416
|
var total int64
|
409
|
417
|
var prescribing_number_total int64
|
410
|
418
|
for _, item := range advicelist {
|
|
419
|
+
|
|
420
|
+ if codeConfig.IsOpen == 1 {
|
|
421
|
+ if item.DrugCode == "" || len(item.DrugCode) == 0 {
|
|
422
|
+ err := fmt.Errorf(service.FindDrugsName(item.DrugId) + "药品追溯码不能为空")
|
|
423
|
+ if err != nil {
|
|
424
|
+ utils.ErrorLog(err.Error())
|
|
425
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
|
426
|
+ return
|
|
427
|
+ }
|
|
428
|
+ }
|
|
429
|
+ }
|
|
430
|
+
|
411
|
431
|
//查询改药品信息
|
412
|
432
|
medical, _ := service.GetBaseDrugMedical(item.DrugId)
|
413
|
433
|
//如果是药房发药的方式
|
|
@@ -797,6 +817,7 @@ func (this *PharmacyController) MedicineDeparture() {
|
797
|
817
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数不足")
|
798
|
818
|
return
|
799
|
819
|
}
|
|
820
|
+
|
800
|
821
|
err = service.MedicineDeparture(ids, creater, orgid)
|
801
|
822
|
if err != nil {
|
802
|
823
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|