ソースを参照

Merge branch '20201014_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20201014_xt_api_new_branch

csx 4 年 前
コミット
da5524956c
共有6 個のファイルを変更した129 個の追加63 個の削除を含む
  1. 51 59
      controllers/his_api_controller.go
  2. 42 1
      controllers/his_project_api_controller.go
  3. 0 2
      models/his_models.go
  4. 25 0
      service/his_project_service.go
  5. 10 0
      service/his_service.go
  6. 1 1
      service/patient_service.go

+ 51 - 59
controllers/his_api_controller.go ファイルの表示

9
 	"github.com/astaxie/beego"
9
 	"github.com/astaxie/beego"
10
 	"reflect"
10
 	"reflect"
11
 	"strconv"
11
 	"strconv"
12
-	"strings"
13
 	"time"
12
 	"time"
14
 )
13
 )
15
 
14
 
24
 	beego.Router("/api/hisprescription/config", &HisApiController{}, "get:GetHisPrescriptionConfig")
23
 	beego.Router("/api/hisprescription/config", &HisApiController{}, "get:GetHisPrescriptionConfig")
25
 
24
 
26
 	beego.Router("/api/hisprescription/create", &HisApiController{}, "post:CreateHisPrescription")
25
 	beego.Router("/api/hisprescription/create", &HisApiController{}, "post:CreateHisPrescription")
27
-	beego.Router("/api/hisdoctoradvice/create", &HisApiController{}, "post:CreateHisDoctorAdvice")
28
-	//beego.Router("/api/hisproject/create", &HisApiController{}, "post:CreateHisProject")
29
-	//beego.Router("/api/hisorder/create", &HisApiController{}, "post:CreateHisOrder")
30
-	//beego.Router("/api/hisadditional/create", &HisApiController{}, "post:CreateHisAdditionalCharge")
31
 
26
 
32
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
27
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
33
 	beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
28
 	beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
121
 	//drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
116
 	//drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
122
 	drugways, _, _ := service.GetDrugWayDics(adminInfo.CurrentOrgId)
117
 	drugways, _, _ := service.GetDrugWayDics(adminInfo.CurrentOrgId)
123
 	efs, _, _ := service.GetExecutionFrequencyDics(adminInfo.CurrentOrgId)
118
 	efs, _, _ := service.GetExecutionFrequencyDics(adminInfo.CurrentOrgId)
124
-	//获取所有项目
125
-	projects, _ := service.GetAllProjectList(adminInfo.CurrentOrgId)
126
-	//获取所有项目组套
119
+
120
+	doctors, _ := service.GetHisAdminUserDoctors(adminInfo.CurrentOrgId)
127
 
121
 
128
 	c.ServeSuccessJSON(map[string]interface{}{
122
 	c.ServeSuccessJSON(map[string]interface{}{
129
 		"drugs":            drugs,
123
 		"drugs":            drugs,
130
 		"advices_template": advices,
124
 		"advices_template": advices,
131
-		"projects":         projects,
132
 		"drugways":         drugways,
125
 		"drugways":         drugways,
133
 		"efs":              efs,
126
 		"efs":              efs,
127
+		"doctors":          doctors,
134
 	})
128
 	})
135
 }
129
 }
136
 func (c *HisApiController) CreateHisPrescription() {
130
 func (c *HisApiController) CreateHisPrescription() {
137
 	record_date := c.GetString("record_date")
131
 	record_date := c.GetString("record_date")
138
 	patient_id, _ := c.GetInt64("patient_id")
132
 	patient_id, _ := c.GetInt64("patient_id")
133
+	//diagnose := c.GetString("diagnose")
134
+	//sick_history := c.GetString("sick_history")
139
 	doctor, _ := c.GetInt64("doctor")
135
 	doctor, _ := c.GetInt64("doctor")
140
-
141
-	diagnose := c.GetString("diagnose")
142
-	special_sick_history := c.GetString("special_sick_history")
136
+	//departm/**/ent, _ := c.GetInt64("department")
143
 
137
 
144
 	dataBody := make(map[string]interface{}, 0)
138
 	dataBody := make(map[string]interface{}, 0)
145
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
139
 	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
159
 	adminInfo := c.GetAdminUserInfo()
153
 	adminInfo := c.GetAdminUserInfo()
160
 	recordDateTime := theTime.Unix()
154
 	recordDateTime := theTime.Unix()
161
 
155
 
162
-	//types, _ := c.GetInt64("type")
163
-	var prescriptions []*models.HisPrescription
156
+	if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
157
+		prescriptions, _ := dataBody["prescriptions"].([]interface{})
164
 
158
 
165
-	if dataBody["prescription"] != nil && reflect.TypeOf(dataBody["prescription"]).String() == "[]interface {}" {
166
-		prescriptions, _ := dataBody["prescription"].([]interface{})
167
 		if len(prescriptions) > 0 {
159
 		if len(prescriptions) > 0 {
168
 			for _, item := range prescriptions {
160
 			for _, item := range prescriptions {
169
 				items := item.(map[string]interface{})
161
 				items := item.(map[string]interface{})
188
 					Status:     1,
180
 					Status:     1,
189
 					Doctor:     doctor,
181
 					Doctor:     doctor,
190
 				}
182
 				}
191
-				//prescriptions = append(prescriptions, prescription)
192
 				service.SaveHisPrescription(prescription)
183
 				service.SaveHisPrescription(prescription)
193
 
184
 
194
 				if items["advices"] != nil && reflect.TypeOf(items["advices"]).String() == "[]interface {}" {
185
 				if items["advices"] != nil && reflect.TypeOf(items["advices"]).String() == "[]interface {}" {
195
 					advices := items["advices"].([]interface{})
186
 					advices := items["advices"].([]interface{})
187
+					group := service.GetMaxAdviceGroupID(adminInfo.CurrentOrgId)
188
+					groupNo := group + 1
189
+					ctime := time.Now().Unix()
190
+					mtime := ctime
196
 					if len(advices) > 0 {
191
 					if len(advices) > 0 {
197
 						for _, advice := range advices {
192
 						for _, advice := range advices {
198
 							var s models.HisDoctorAdviceInfo
193
 							var s models.HisDoctorAdviceInfo
194
+							s.PrescriptionId = prescription.ID
195
+							s.AdviceType = 2
196
+							s.AdviceDoctor = adminInfo.AdminUser.Id
197
+							s.StopState = 2
198
+							s.ExecutionState = 2
199
+							s.AdviceDate = recordDateTime
200
+							s.Status = 1
201
+							s.UserOrgId = adminInfo.CurrentOrgId
202
+							s.RecordDate = recordDateTime
203
+							s.StartTime = recordDateTime
204
+							s.Groupno = groupNo
205
+							s.CreatedTime = ctime
206
+							s.UpdatedTime = mtime
207
+							s.PatientId = patient_id
199
 
208
 
200
 							errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
209
 							errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
201
 							if errcode > 0 {
210
 							if errcode > 0 {
202
 								c.ServeFailJSONWithSGJErrorCode(errcode)
211
 								c.ServeFailJSONWithSGJErrorCode(errcode)
203
 								return
212
 								return
204
 							}
213
 							}
205
-							advice.Children = append(advice.Children, &s)
214
+							service.CreateHisDoctorAdvice(&s)
206
 						}
215
 						}
207
 					}
216
 					}
208
 				}
217
 				}
456
 }
465
 }
457
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
466
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
458
 
467
 
459
-	if json["advice_name"] == nil || reflect.TypeOf(json["advice_name"]).String() != "string" {
460
-		utils.ErrorLog("advice_name")
468
+	if json["drug_name"] == nil || reflect.TypeOf(json["drug_name"]).String() != "string" {
469
+		utils.ErrorLog("drug_name")
461
 		return enums.ErrorCodeParamWrong
470
 		return enums.ErrorCodeParamWrong
462
 	}
471
 	}
463
-	adviceName, _ := json["advice_name"].(string)
472
+	adviceName, _ := json["drug_name"].(string)
464
 	if len(adviceName) == 0 {
473
 	if len(adviceName) == 0 {
465
 		utils.ErrorLog("len(advice_name) == 0")
474
 		utils.ErrorLog("len(advice_name) == 0")
466
 		return enums.ErrorCodeParamWrong
475
 		return enums.ErrorCodeParamWrong
467
 	}
476
 	}
468
 	advice.AdviceName = adviceName
477
 	advice.AdviceName = adviceName
469
-
470
 	adviceDesc, _ := json["advice_desc"].(string)
478
 	adviceDesc, _ := json["advice_desc"].(string)
471
 	advice.AdviceDesc = adviceDesc
479
 	advice.AdviceDesc = adviceDesc
472
-
473
 	if json["drug_spec"] != nil && reflect.TypeOf(json["drug_spec"]).String() == "string" {
480
 	if json["drug_spec"] != nil && reflect.TypeOf(json["drug_spec"]).String() == "string" {
474
 		drugSpec, _ := strconv.ParseFloat(json["drug_spec"].(string), 64)
481
 		drugSpec, _ := strconv.ParseFloat(json["drug_spec"].(string), 64)
475
 		advice.DrugSpec = drugSpec
482
 		advice.DrugSpec = drugSpec
476
 	}
483
 	}
477
-
478
 	if json["remark"] != nil && reflect.TypeOf(json["remark"]).String() == "string" {
484
 	if json["remark"] != nil && reflect.TypeOf(json["remark"]).String() == "string" {
479
 		remark, _ := json["remark"].(string)
485
 		remark, _ := json["remark"].(string)
480
 		advice.Remark = remark
486
 		advice.Remark = remark
481
 	}
487
 	}
482
-
483
-	if json["way"] == nil {
484
-		advice.Way = 0
485
-
486
-	} else {
487
-		if json["way"] != nil || reflect.TypeOf(json["way"]).String() == "float64" {
488
-			way := int64(json["way"].(float64))
489
-			advice.Way = way
490
-		}
491
-
492
-	}
493
-
494
-	if json["drug_id"] == nil {
488
+	if json["id"] == nil {
495
 		advice.DrugId = 0
489
 		advice.DrugId = 0
496
 	} else {
490
 	} else {
497
-		if json["drug_id"] != nil || reflect.TypeOf(json["drug_id"]).String() == "float64" {
498
-			drug_id := int64(json["drug_id"].(float64))
491
+		if json["id"] != nil || reflect.TypeOf(json["id"]).String() == "float64" {
492
+			drug_id := int64(json["id"].(float64))
499
 			advice.DrugId = drug_id
493
 			advice.DrugId = drug_id
500
 		}
494
 		}
501
 	}
495
 	}
502
 
496
 
503
-	if json["drug_name_id"] == nil {
504
-		advice.DrugNameId = 0
505
-	} else {
506
-		if json["drug_name_id"] != nil || reflect.TypeOf(json["drug_name_id"]).String() == "float64" {
507
-			drug_name_id := int64(json["drug_name_id"].(float64))
508
-			advice.DrugNameId = drug_name_id
509
-		}
510
-	}
511
-
512
-	if json["drug_spec_unit"] != nil && reflect.TypeOf(json["drug_spec_unit"]).String() == "string" {
513
-		drugSpecUnit, _ := json["drug_spec_unit"].(string)
497
+	if json["min_unit"] != nil && reflect.TypeOf(json["min_unit"]).String() == "string" {
498
+		drugSpecUnit, _ := json["min_unit"].(string)
514
 		advice.DrugSpecUnit = drugSpecUnit
499
 		advice.DrugSpecUnit = drugSpecUnit
515
 	}
500
 	}
516
-
517
 	if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
501
 	if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
518
 		singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
502
 		singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
519
 		advice.SingleDose = singleDose
503
 		advice.SingleDose = singleDose
520
 	}
504
 	}
521
-
522
-	if json["single_dose_unit"] != nil && reflect.TypeOf(json["single_dose_unit"]).String() == "string" {
523
-		singleDoseUnit, _ := json["single_dose_unit"].(string)
505
+	if json["min_unit"] != nil && reflect.TypeOf(json["min_unit"]).String() == "string" {
506
+		singleDoseUnit, _ := json["min_unit"].(string)
524
 		advice.SingleDoseUnit = singleDoseUnit
507
 		advice.SingleDoseUnit = singleDoseUnit
525
 	}
508
 	}
526
-
527
 	if json["prescribing_number"] != nil && reflect.TypeOf(json["prescribing_number"]).String() == "string" {
509
 	if json["prescribing_number"] != nil && reflect.TypeOf(json["prescribing_number"]).String() == "string" {
528
 		prescribingNumber, _ := strconv.ParseFloat(json["prescribing_number"].(string), 64)
510
 		prescribingNumber, _ := strconv.ParseFloat(json["prescribing_number"].(string), 64)
529
 		advice.PrescribingNumber = prescribingNumber
511
 		advice.PrescribingNumber = prescribingNumber
530
 	}
512
 	}
531
-
532
-	if json["prescribing_number_unit"] != nil && reflect.TypeOf(json["prescribing_number_unit"]).String() == "string" {
533
-		prescribingNumberUnit, _ := json["prescribing_number_unit"].(string)
513
+	if json["min_unit"] != nil && reflect.TypeOf(json["min_unit"]).String() == "string" {
514
+		prescribingNumberUnit, _ := json["min_unit"].(string)
534
 		advice.PrescribingNumberUnit = prescribingNumberUnit
515
 		advice.PrescribingNumberUnit = prescribingNumberUnit
535
 	}
516
 	}
536
 	if json["delivery_way"] != nil && reflect.TypeOf(json["delivery_way"]).String() == "string" {
517
 	if json["delivery_way"] != nil && reflect.TypeOf(json["delivery_way"]).String() == "string" {
537
 		deliveryWay, _ := json["delivery_way"].(string)
518
 		deliveryWay, _ := json["delivery_way"].(string)
538
 		advice.DeliveryWay = deliveryWay
519
 		advice.DeliveryWay = deliveryWay
539
 	}
520
 	}
540
-
541
 	if json["execution_frequency"] != nil && reflect.TypeOf(json["execution_frequency"]).String() == "string" {
521
 	if json["execution_frequency"] != nil && reflect.TypeOf(json["execution_frequency"]).String() == "string" {
542
 		executionFrequency, _ := json["execution_frequency"].(string)
522
 		executionFrequency, _ := json["execution_frequency"].(string)
543
 		advice.ExecutionFrequency = executionFrequency
523
 		advice.ExecutionFrequency = executionFrequency
544
 	}
524
 	}
525
+	if json["remark"] != nil && reflect.TypeOf(json["remark"]).String() == "string" {
526
+		remark, _ := json["remark"].(string)
527
+		advice.Remark = remark
528
+	}
529
+	//if json["retail_price"] != nil || reflect.TypeOf(json["retail_price"]).String() == "string" {
530
+	//	advice.Price = json["retail_price"].(float64)
531
+	//}
532
+
533
+	if json["retail_price"] != nil || reflect.TypeOf(json["retail_price"]).String() == "string" {
534
+		price, _ := strconv.ParseFloat(json["retail_price"].(string), 64)
535
+		advice.Price = price
536
+	}
545
 	return 0
537
 	return 0
546
 }
538
 }

+ 42 - 1
controllers/his_project_api_controller.go ファイルの表示

5
 	"XT_New/models"
5
 	"XT_New/models"
6
 	"XT_New/service"
6
 	"XT_New/service"
7
 	"XT_New/utils"
7
 	"XT_New/utils"
8
-	//"encoding/json"
9
 	"fmt"
8
 	"fmt"
10
 	"github.com/astaxie/beego"
9
 	"github.com/astaxie/beego"
11
 	"github.com/jinzhu/gorm"
10
 	"github.com/jinzhu/gorm"
52
 	beego.Router("/api/his/gettreatlist", &HisProjectApiController{}, "Get:GetTreatmentList")
51
 	beego.Router("/api/his/gettreatlist", &HisProjectApiController{}, "Get:GetTreatmentList")
53
 	beego.Router("/api/his/getpatientinformation", &HisProjectApiController{}, "Get:GetPatientInformation")
52
 	beego.Router("/api/his/getpatientinformation", &HisProjectApiController{}, "Get:GetPatientInformation")
54
 	beego.Router("/api/hist/getallprojecteam", &HisProjectApiController{}, "Get:GetAllProjectTeam")
53
 	beego.Router("/api/hist/getallprojecteam", &HisProjectApiController{}, "Get:GetAllProjectTeam")
54
+	beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
55
+	beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
55
 }
56
 }
56
 
57
 
57
 func (this *HisProjectApiController) SaveProject() {
58
 func (this *HisProjectApiController) SaveProject() {
821
 
822
 
822
 	adminUserInfo := this.GetAdminUserInfo()
823
 	adminUserInfo := this.GetAdminUserInfo()
823
 	orgId := adminUserInfo.CurrentOrgId
824
 	orgId := adminUserInfo.CurrentOrgId
825
+	fmt.Println("aaa")
824
 	team, err := service.GetAllProjectTeam(orgId)
826
 	team, err := service.GetAllProjectTeam(orgId)
825
 	if err != nil {
827
 	if err != nil {
826
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
828
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
830
 		"team": team,
832
 		"team": team,
831
 	})
833
 	})
832
 }
834
 }
835
+
836
+func (this *HisProjectApiController) GetProjectListById() {
837
+
838
+	adminUserInfo := this.GetAdminUserInfo()
839
+	orgId := adminUserInfo.CurrentOrgId
840
+	project_id := this.GetString("project_id")
841
+	idStrs := strings.Split(project_id, ",")
842
+	project, err := service.GetProjectListById(orgId, idStrs)
843
+	if err != nil {
844
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
845
+		return
846
+	}
847
+	this.ServeSuccessJSON(map[string]interface{}{
848
+		"project": project,
849
+	})
850
+}
851
+
852
+func (this *HisProjectApiController) GetHisPatientHistory() {
853
+	timeLayout := "2006-01-02"
854
+	loc, _ := time.LoadLocation("Local")
855
+	keyword := this.GetString("keyword")
856
+	start_time := this.GetString("start_time")
857
+	end_time := this.GetString("end_time")
858
+	register_type, _ := this.GetInt64("register_type")
859
+	limit, _ := this.GetInt64("limit")
860
+	page, _ := this.GetInt64("page")
861
+	fmt.Println(keyword, start_time, end_time, register_type, limit, page)
862
+	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
863
+	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
864
+	history, total, err := service.GetHisPatientHistory(keyword, startTime.Unix(), endTime.Unix(), register_type, limit, page)
865
+	if err != nil {
866
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
867
+		return
868
+	}
869
+	this.ServeSuccessJSON(map[string]interface{}{
870
+		"history": history,
871
+		"total":   total,
872
+	})
873
+}

+ 0 - 2
models/his_models.go ファイルの表示

192
 	DrugId                int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
192
 	DrugId                int64   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
193
 	Price                 float64 `gorm:"column:price" json:"price" form:"price"`
193
 	Price                 float64 `gorm:"column:price" json:"price" form:"price"`
194
 	PrescriptionId        int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
194
 	PrescriptionId        int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
195
-	Way                   int64   `gorm:"column:way" json:"way" form:"way"`
196
-	DrugNameId            int64   `gorm:"column:drug_name_id" json:"drug_name_id" form:"drug_name_id"`
197
 }
195
 }
198
 
196
 
199
 func (HisDoctorAdviceInfo) TableName() string {
197
 func (HisDoctorAdviceInfo) TableName() string {

+ 25 - 0
service/his_project_service.go ファイルの表示

278
 	err = XTReadDB().Model(&project).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
278
 	err = XTReadDB().Model(&project).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
279
 	return project, err
279
 	return project, err
280
 }
280
 }
281
+
282
+func GetProjectListById(orgid int64, ids []string) (project []*models.XtHisProject, err error) {
283
+	err = XTReadDB().Model(&project).Where("user_org_id = ? and id in (?)", orgid, ids).Find(&project).Error
284
+	return project, err
285
+}
286
+
287
+func GetHisPatientHistory(keyword string, startime int64, endtime int64, registtype int64, limit int64, page int64) (hisPatient []*models.XtHisPatient, total int64, err error) {
288
+	offset := (page - 1) * limit
289
+	likeKey := "%" + keyword + "%"
290
+	db := XTReadDB().Table("his_patient as x").Where("x.status = 1")
291
+	if len(keyword) > 0 {
292
+		db = db.Where("x.name like ?", likeKey)
293
+	}
294
+	if startime > 0 {
295
+		db = db.Where("x.record_date >= ?", startime)
296
+	}
297
+	if endtime > 0 {
298
+		db = db.Where("x.record_date<=?", endtime)
299
+	}
300
+	if registtype > 0 {
301
+		db = db.Where("x.register_type = ?", registtype)
302
+	}
303
+	err = db.Select("x.id,x.balance_accounts_type,x.medical_insurance_number,x.name,x.gender,x.id_type,x.medical_treatment_type,x.birthday,x.record_date,x.age,x.phone_number,x.id_card_no,x.register_type,x.admin_user_id,x.departments,x.is_need_cost_of_production,x.register_cost,x.treatment_cost,x.cost_of_production,x.total,x.user_org_id,x.patient_id,x.number").Count(&total).Offset(offset).Limit(limit).Find(&hisPatient).Error
304
+	return hisPatient, total, err
305
+}

+ 10 - 0
service/his_service.go ファイルの表示

146
 	}).Where("org_id = ? AND status=1 ", org_id).Find(&temps).Error
146
 	}).Where("org_id = ? AND status=1 ", org_id).Find(&temps).Error
147
 	return
147
 	return
148
 }
148
 }
149
+
150
+func GetHisAdminUserDoctors(org_id int64) (doctors []*models.UserAdminRole, err error) {
151
+	err = readUserDb.Model(&models.UserAdminRole{}).Where("org_id = ? AND status = 1 AND (user_type = 1 OR user_type = 2)", org_id).Find(&doctors).Error
152
+	return
153
+}
154
+
155
+func CreateHisDoctorAdvice(s *models.HisDoctorAdviceInfo) (err error) {
156
+	err = writeDb.Create(s).Error
157
+	return
158
+}

+ 1 - 1
service/patient_service.go ファイルの表示

547
 }
547
 }
548
 func GetMaxAdviceGroupID(orgId int64) (group int64) {
548
 func GetMaxAdviceGroupID(orgId int64) (group int64) {
549
 	var advice models.DoctorAdvice
549
 	var advice models.DoctorAdvice
550
-	err := readDb.Table("xt_doctor_advice").Where("user_org_id=?", orgId).Select("max(groupno) as groupno").First(&advice).Error
550
+	err := readDb.Table("his_doctor_advice_info").Where("user_org_id=?", orgId).Select("max(groupno) as groupno").First(&advice).Error
551
 	if err != nil {
551
 	if err != nil {
552
 		fmt.Println(err)
552
 		fmt.Println(err)
553
 		group = 0
553
 		group = 0