Browse Source

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

XMLWAN 3 years ago
parent
commit
c5bfdff8c1

+ 44 - 8
controllers/his_api_controller.go View File

92
 
92
 
93
 	beego.Router("/api/privateexpenses/get", &HisApiController{}, "get:GetPrivateExpensesInfo")
93
 	beego.Router("/api/privateexpenses/get", &HisApiController{}, "get:GetPrivateExpensesInfo")
94
 
94
 
95
+	beego.Router("/api/changemedtype/post", &HisApiController{}, "post:ChangeMedType")
96
+
95
 }
97
 }
96
 
98
 
97
 func (c *HisApiController) Sscard() {
99
 func (c *HisApiController) Sscard() {
229
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
231
 	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
230
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
232
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
231
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
233
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
234
+	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
232
 
235
 
233
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
236
 	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
234
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
237
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
252
 		"schedule":            sch,
255
 		"schedule":            sch,
253
 		"count":               count,
256
 		"count":               count,
254
 		"drugStockConfig":     drugStockConfig,
257
 		"drugStockConfig":     drugStockConfig,
258
+		"last_info":           lastPatientPrescriptionInfo,
255
 	})
259
 	})
256
 	return
260
 	return
257
 
261
 
292
 	record_date := c.GetString("record_date")
296
 	record_date := c.GetString("record_date")
293
 	patient_id, _ := c.GetInt64("patient_id")
297
 	patient_id, _ := c.GetInt64("patient_id")
294
 	reg_type, _ := c.GetInt64("reg_type")
298
 	reg_type, _ := c.GetInt64("reg_type")
295
-	diagnose, _ := c.GetInt64("diagnose")
299
+	diagnose := c.GetString("diagnose")
296
 	sick_type, _ := c.GetInt64("sick_type")
300
 	sick_type, _ := c.GetInt64("sick_type")
297
 	sick_history := c.GetString("sick_history")
301
 	sick_history := c.GetString("sick_history")
298
 	doctor_id, _ := c.GetInt64("doctor", 0)
302
 	doctor_id, _ := c.GetInt64("doctor", 0)
729
 	record_date := c.GetString("record_date")
733
 	record_date := c.GetString("record_date")
730
 	patient_id, _ := c.GetInt64("patient_id")
734
 	patient_id, _ := c.GetInt64("patient_id")
731
 	reg_type, _ := c.GetInt64("reg_type")
735
 	reg_type, _ := c.GetInt64("reg_type")
732
-	diagnose, _ := c.GetInt64("diagnose", 0)
736
+	//diagnose, _ := c.GetInt64("diagnose", 0)
737
+	diagnose := c.GetString("diagnose")
733
 	sick_type, _ := c.GetInt64("sick_type")
738
 	sick_type, _ := c.GetInt64("sick_type")
734
 	sick_history := c.GetString("sick_history")
739
 	sick_history := c.GetString("sick_history")
735
 	doctor_id, _ := c.GetInt64("doctor", 0)
740
 	doctor_id, _ := c.GetInt64("doctor", 0)
2582
 	medical_expenses, _ := c.GetFloat("medical_expenses")
2587
 	medical_expenses, _ := c.GetFloat("medical_expenses")
2583
 	social_type, _ := c.GetInt64("social_type")
2588
 	social_type, _ := c.GetInt64("social_type")
2584
 
2589
 
2585
-	diagnosis_id, _ := c.GetInt64("diagnosis")
2590
+	//diagnosis_id, _ := c.GetInt64("diagnosis")
2591
+
2592
+	diagnosis_ids := c.GetString("diagnosis")
2593
+
2586
 	sick_type, _ := c.GetInt64("sick_type")
2594
 	sick_type, _ := c.GetInt64("sick_type")
2587
 	reg_type := c.GetString("p_type")
2595
 	reg_type := c.GetString("p_type")
2588
 
2596
 
2672
 			Departments:            department,
2680
 			Departments:            department,
2673
 			Doctor:                 doctor,
2681
 			Doctor:                 doctor,
2674
 			PType:                  reg_type,
2682
 			PType:                  reg_type,
2675
-			Diagnosis:              diagnosis_id,
2683
+			Diagnosis:              diagnosis_ids,
2676
 			SickType:               sick_type,
2684
 			SickType:               sick_type,
2677
 		}
2685
 		}
2678
 		service.CreateHisPatient(&hisPatient)
2686
 		service.CreateHisPatient(&hisPatient)
2711
 			Departments:            department,
2719
 			Departments:            department,
2712
 			Doctor:                 doctor,
2720
 			Doctor:                 doctor,
2713
 			PType:                  reg_type,
2721
 			PType:                  reg_type,
2714
-			Diagnosis:              diagnosis_id,
2722
+			Diagnosis:              diagnosis_ids,
2715
 			SickType:               sick_type,
2723
 			SickType:               sick_type,
2716
 		}
2724
 		}
2717
 		service.CreateHisPatient(&hisPatient)
2725
 		service.CreateHisPatient(&hisPatient)
2750
 	fapiao_code := c.GetString("fapiao_code")
2758
 	fapiao_code := c.GetString("fapiao_code")
2751
 	fapiao_number := c.GetString("fapiao_number")
2759
 	fapiao_number := c.GetString("fapiao_number")
2752
 
2760
 
2753
-	diagnosis_id, _ := c.GetInt64("diagnosis")
2761
+	diagnosis_id := c.GetString("diagnosis")
2754
 	sick_type, _ := c.GetInt64("sick_type")
2762
 	sick_type, _ := c.GetInt64("sick_type")
2755
 	reg_type, _ := c.GetInt64("p_type")
2763
 	reg_type, _ := c.GetInt64("p_type")
2756
 	order_id, _ := c.GetInt64("order_id")
2764
 	order_id, _ := c.GetInt64("order_id")
2862
 			SettleType:            settle_accounts_type,
2870
 			SettleType:            settle_accounts_type,
2863
 			FaPiaoCode:            fapiao_code,
2871
 			FaPiaoCode:            fapiao_code,
2864
 			FaPiaoNumber:          fapiao_number,
2872
 			FaPiaoNumber:          fapiao_number,
2873
+			Diagnosis:             diagnosis_id,
2865
 			PType:                 2,
2874
 			PType:                 2,
2866
 		}
2875
 		}
2867
 		err = service.CreateOrder(order)
2876
 		err = service.CreateOrder(order)
3006
 			tempOrder.FaPiaoNumber = fapiao_number
3015
 			tempOrder.FaPiaoNumber = fapiao_number
3007
 			tempOrder.PType = 2
3016
 			tempOrder.PType = 2
3008
 			tempOrder.MedfeeSumamt = totals
3017
 			tempOrder.MedfeeSumamt = totals
3018
+			tempOrder.Diagnosis = diagnosis_id
3009
 
3019
 
3010
 			err = service.SaveHisOrder(&tempOrder)
3020
 			err = service.SaveHisOrder(&tempOrder)
3011
 			err = service.UpdataOrderStatusTwo(tempOrder.Number, adminUser.CurrentOrgId)
3021
 			err = service.UpdataOrderStatusTwo(tempOrder.Number, adminUser.CurrentOrgId)
3368
 	}
3378
 	}
3369
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
3379
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
3370
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3380
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3381
+
3382
+	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3383
+
3371
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
3384
 	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
3372
 	//获取所有科室信息
3385
 	//获取所有科室信息
3373
 	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
3386
 	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
3378
 		"prescription":        prescriptions,
3391
 		"prescription":        prescriptions,
3379
 		"case_history":        case_history,
3392
 		"case_history":        case_history,
3380
 		"info":                patientPrescriptionInfo,
3393
 		"info":                patientPrescriptionInfo,
3394
+		"last_info":           lastPatientPrescriptionInfo,
3381
 		"month_prescriptions": monthPrescriptions,
3395
 		"month_prescriptions": monthPrescriptions,
3382
 		"order":               order,
3396
 		"order":               order,
3383
 		"doctors":             doctors,
3397
 		"doctors":             doctors,
4407
 	timeLayout := "2006-01-02"
4421
 	timeLayout := "2006-01-02"
4408
 	loc, _ := time.LoadLocation("Local")
4422
 	loc, _ := time.LoadLocation("Local")
4409
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
4423
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
4410
-	diagnosis_id, _ := c.GetInt64("diagnosis")
4424
+	diagnosis_id := c.GetString("diagnosis")
4411
 	sick_type, _ := c.GetInt64("sick_type")
4425
 	sick_type, _ := c.GetInt64("sick_type")
4412
 	reg_type, _ := c.GetInt64("p_type")
4426
 	reg_type, _ := c.GetInt64("p_type")
4413
 
4427
 
4501
 		PType:              2,
4515
 		PType:              2,
4502
 		IsPre:              1,
4516
 		IsPre:              1,
4503
 		MedType:            strconv.Itoa(int(reg_type)),
4517
 		MedType:            strconv.Itoa(int(reg_type)),
4518
+		Diagnosis:          diagnosis_id,
4504
 	}
4519
 	}
4505
 	err = service.CreateOrder(order)
4520
 	err = service.CreateOrder(order)
4506
 	if err != nil {
4521
 	if err != nil {
4609
 		}
4624
 		}
4610
 		service.CreateOrderInfo(info)
4625
 		service.CreateOrderInfo(info)
4611
 	}
4626
 	}
4612
-	his.Diagnosis = diagnosis_id
4613
 	his.SickType = sick_type
4627
 	his.SickType = sick_type
4614
 	service.UpdataHisPateint(&his)
4628
 	service.UpdataHisPateint(&his)
4615
 	err = service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
4629
 	err = service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
4646
 	})
4660
 	})
4647
 
4661
 
4648
 }
4662
 }
4663
+
4664
+func (this *HisApiController) ChangeMedType() {
4665
+	med_type := this.GetString("med_type")
4666
+	id, _ := this.GetInt64("id")
4667
+
4668
+	prescription, _ := service.GetPrescriptionById(id, this.GetAdminUserInfo().CurrentOrgId)
4669
+	prescription.MedType = med_type
4670
+	err := service.SaveHisPrescription(&prescription)
4671
+
4672
+	if err == nil {
4673
+		this.ServeSuccessJSON(map[string]interface{}{
4674
+			"msg": "修改成功",
4675
+		})
4676
+
4677
+	} else {
4678
+
4679
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
4680
+		return
4681
+
4682
+	}
4683
+
4684
+}

+ 5 - 2
controllers/his_project_api_controller.go View File

904
 	social_type, _ := this.GetInt64("social_type")
904
 	social_type, _ := this.GetInt64("social_type")
905
 	id_card_type, _ := this.GetInt64("id_card_type")
905
 	id_card_type, _ := this.GetInt64("id_card_type")
906
 
906
 
907
-	diagnosis_id, _ := this.GetInt64("diagnosis")
907
+	//diagnosis_id, _ := this.GetInt64("diagnosis")
908
+
909
+	diagnosis_ids := this.GetString("diagnosis")
910
+
908
 	sick_type, _ := this.GetInt64("sick_type")
911
 	sick_type, _ := this.GetInt64("sick_type")
909
 	reg_type := this.GetString("p_type")
912
 	reg_type := this.GetString("p_type")
910
 
913
 
978
 		Phone:                  phone,
981
 		Phone:                  phone,
979
 		SocialType:             social_type,
982
 		SocialType:             social_type,
980
 		IdCardType:             id_card_type,
983
 		IdCardType:             id_card_type,
981
-		Diagnosis:              diagnosis_id,
984
+		Diagnosis:              diagnosis_ids,
982
 		PType:                  reg_type,
985
 		PType:                  reg_type,
983
 		SickType:               sick_type,
986
 		SickType:               sick_type,
984
 	}
987
 	}

+ 2 - 1
models/his_hospital_models.go View File

28
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
28
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
29
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
29
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
30
 
30
 
31
-	IsPre int64 `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
31
+	IsPre     int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
32
+	Diagnosis string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
32
 }
33
 }
33
 
34
 
34
 func (HisHospitalOrder) TableName() string {
35
 func (HisHospitalOrder) TableName() string {

+ 12 - 8
models/his_models.go View File

127
 	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
127
 	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
128
 	IdCardType             int64   `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
128
 	IdCardType             int64   `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
129
 	PType                  int64   `gorm:"column:p_type" json:"p_type" form:"p_type"`
129
 	PType                  int64   `gorm:"column:p_type" json:"p_type" form:"p_type"`
130
-	Diagnosis              int64   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
130
+	Diagnosis              string  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
131
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
131
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
132
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
132
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
133
 }
133
 }
312
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
312
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
313
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
313
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
314
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
314
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
315
+	PrescribingNumberUnit       string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
315
 }
316
 }
316
 
317
 
317
 func (Drug) TableName() string {
318
 func (Drug) TableName() string {
374
 	Mtime              int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
375
 	Mtime              int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
375
 	Creator            int64           `gorm:"column:creator" json:"creator" form:"creator"`
376
 	Creator            int64           `gorm:"column:creator" json:"creator" form:"creator"`
376
 	Modifier           int64           `gorm:"column:modifier" json:"modifier" form:"modifier"`
377
 	Modifier           int64           `gorm:"column:modifier" json:"modifier" form:"modifier"`
377
-	Diagnosis          int64           `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
378
+	Diagnosis          string          `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
378
 	RegisterType       int64           `gorm:"column:register_type" json:"register_type" form:"register_type"`
379
 	RegisterType       int64           `gorm:"column:register_type" json:"register_type" form:"register_type"`
379
 	Doctor             string          `gorm:"column:doctor" json:"doctor" form:"doctor"`
380
 	Doctor             string          `gorm:"column:doctor" json:"doctor" form:"doctor"`
380
 	Departments        int64           `gorm:"column:departments" json:"departments" form:"departments"`
381
 	Departments        int64           `gorm:"column:departments" json:"departments" form:"departments"`
472
 
473
 
473
 	AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
474
 	AdminUser AdminUser `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
474
 
475
 
475
-	SettleType      int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
476
-	SettleStartTime int64 `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
477
-	SettleEndTime   int64 `gorm:"column:settle_end_time" json:"settle_end_time" form:"settle_end_time"`
478
-	IsPre           int64 `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
476
+	SettleType      int64  `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
477
+	SettleStartTime int64  `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
478
+	SettleEndTime   int64  `gorm:"column:settle_end_time" json:"settle_end_time" form:"settle_end_time"`
479
+	IsPre           int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
480
+	Diagnosis       string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
479
 }
481
 }
480
 
482
 
481
 func (TempHisOrder) TableName() string {
483
 func (TempHisOrder) TableName() string {
696
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
698
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
697
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
699
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
698
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
700
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
701
+	PrescribingNumberUnit       string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
699
 }
702
 }
700
 
703
 
701
 func (VMDrug) TableName() string {
704
 func (VMDrug) TableName() string {
855
 	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
858
 	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
856
 	IdCardType             int64   `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
859
 	IdCardType             int64   `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
857
 	PType                  string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
860
 	PType                  string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
858
-	Diagnosis              int64   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
861
+	Diagnosis              string  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
859
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
862
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
860
 	//HisOrder               models.HisOrder `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,SettleAccountsDate" json:"order"`
863
 	//HisOrder               models.HisOrder `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,SettleAccountsDate" json:"order"`
861
 }
864
 }
956
 
959
 
957
 	HisFundSettleListResult HisFundSettleListResult `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"result"`
960
 	HisFundSettleListResult HisFundSettleListResult `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"result"`
958
 	IsPre                   int64                   `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
961
 	IsPre                   int64                   `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
962
+	Diagnosis               string                  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
959
 }
963
 }
960
 
964
 
961
 func (HisOrder) TableName() string {
965
 func (HisOrder) TableName() string {
1042
 	Idetinfo               string  `gorm:"column:idetinfo" json:"idetinfo" form:"idetinfo"`
1046
 	Idetinfo               string  `gorm:"column:idetinfo" json:"idetinfo" form:"idetinfo"`
1043
 	IptOtpNo               string  `gorm:"column:ipt_otp_no" json:"ipt_otp_no" form:"ipt_otp_no"`
1047
 	IptOtpNo               string  `gorm:"column:ipt_otp_no" json:"ipt_otp_no" form:"ipt_otp_no"`
1044
 	PType                  string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
1048
 	PType                  string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
1045
-	Diagnosis              int64   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
1049
+	Diagnosis              string  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
1046
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
1050
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
1047
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
1051
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
1048
 }
1052
 }

+ 1 - 0
models/self_drug_models.go View File

66
 	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
66
 	HospApprFlag           int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
67
 	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
67
 	LmtUsedFlag            int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
68
 	Total                  float64 `gorm:"column:total" json:"total" form:"total"`
68
 	Total                  float64 `gorm:"column:total" json:"total" form:"total"`
69
+	PrescribingNumberUnit  string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
69
 }
70
 }
70
 
71
 
71
 func (XtBaseDrug) TableName() string {
72
 func (XtBaseDrug) TableName() string {

+ 17 - 16
models/service/stock_service.go View File

507
 }
507
 }
508
 
508
 
509
 type Drug struct {
509
 type Drug struct {
510
-	ID              int64   `gorm:"column:id" json:"id" form:"id"`
511
-	DrugName        string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
512
-	DrugSpec        string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
513
-	DrugType        int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
514
-	DrugStockLimit  string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
515
-	DrugOriginPlace string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
516
-	DrugDosageForm  int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
517
-	Manufacturer    int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
518
-	Status          int64   `gorm:"column:status" json:"status" form:"status"`
519
-	Ctime           int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
520
-	Mtime           int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
521
-	OrgId           int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
522
-	DrugCode        string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
523
-	HospApprFlag    int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
524
-	LmtUsedFlag     int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
525
-	Total           float64 `gorm:"column:total" json:"total" form:"total"`
510
+	ID                    int64   `gorm:"column:id" json:"id" form:"id"`
511
+	DrugName              string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
512
+	DrugSpec              string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
513
+	DrugType              int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
514
+	DrugStockLimit        string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
515
+	DrugOriginPlace       string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
516
+	DrugDosageForm        int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
517
+	Manufacturer          int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
518
+	Status                int64   `gorm:"column:status" json:"status" form:"status"`
519
+	Ctime                 int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
520
+	Mtime                 int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
521
+	OrgId                 int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
522
+	DrugCode              string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
523
+	HospApprFlag          int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
524
+	LmtUsedFlag           int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
525
+	Total                 float64 `gorm:"column:total" json:"total" form:"total"`
526
+	PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
526
 }
527
 }
527
 
528
 
528
 func (Drug) TableName() string {
529
 func (Drug) TableName() string {

+ 19 - 17
service/drug_stock_service.go View File

6
 )
6
 )
7
 
7
 
8
 type DrugConfig struct {
8
 type DrugConfig struct {
9
-	ID           int64        `gorm:"column:id" json:"id" form:"id"`
10
-	DrugName     string       `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
11
-	DrugCategory int64        `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
12
-	DrugSpec     string       `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
13
-	DrugType     int64        `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
14
-	DrugStatus   string       `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
15
-	Status       int64        `gorm:"column:status" json:"status" form:"status"`
16
-	OrgId        int64        `gorm:"column:org_id" json:"org_id" form:"org_id"`
17
-	Manufacturer int64        `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
18
-	DrugSpecs    []DrugConfig `gorm:"ForeignKey:DrugName;AssociationForeignKey:DrugName" json:"drug_specs"`
19
-	RetailPrice  float64      `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
20
-	LastPrice    float64      `gorm:"column:last_price" json:"last_price" form:"last_price"`
21
-	MinUnit      string       `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
22
-	HospApprFlag int64        `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
23
-	LmtUsedFlag  int64        `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
24
-	Total        float64      `gorm:"column:total" json:"total" form:"total"`
9
+	ID                    int64        `gorm:"column:id" json:"id" form:"id"`
10
+	DrugName              string       `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
11
+	DrugCategory          int64        `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
12
+	DrugSpec              string       `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
13
+	DrugType              int64        `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
14
+	DrugStatus            string       `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
15
+	Status                int64        `gorm:"column:status" json:"status" form:"status"`
16
+	OrgId                 int64        `gorm:"column:org_id" json:"org_id" form:"org_id"`
17
+	Manufacturer          int64        `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
18
+	DrugSpecs             []DrugConfig `gorm:"ForeignKey:DrugName;AssociationForeignKey:DrugName" json:"drug_specs"`
19
+	RetailPrice           float64      `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
20
+	LastPrice             float64      `gorm:"column:last_price" json:"last_price" form:"last_price"`
21
+	MinUnit               string       `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
22
+	HospApprFlag          int64        `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
23
+	LmtUsedFlag           int64        `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
24
+	Total                 float64      `gorm:"column:total" json:"total" form:"total"`
25
+	PrescribingNumberUnit string       `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
25
 }
26
 }
26
 
27
 
27
 func (DrugConfig) TableName() string {
28
 func (DrugConfig) TableName() string {
91
 	QueryWarehouseOutInfo []models.DrugWarehouseOutInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"query_drug_warehouseout_info"`
92
 	QueryWarehouseOutInfo []models.DrugWarehouseOutInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"query_drug_warehouseout_info"`
92
 	QueryCancelStockInfo  []models.DrugCancelStockInfo  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"query_drug_cancel_stock_info"`
93
 	QueryCancelStockInfo  []models.DrugCancelStockInfo  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"query_drug_cancel_stock_info"`
93
 
94
 
94
-	Total float64 `gorm:"column:total" json:"total" form:"total"`
95
+	Total                 float64 `gorm:"column:total" json:"total" form:"total"`
96
+	PrescribingNumberUnit string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
95
 }
97
 }
96
 
98
 
97
 func (DrugStockInfo) TableName() string {
99
 func (DrugStockInfo) TableName() string {

+ 1 - 1
service/his_hospital_service.go View File

140
 	Mtime              int64              `gorm:"column:mtime" json:"mtime" form:"mtime"`
140
 	Mtime              int64              `gorm:"column:mtime" json:"mtime" form:"mtime"`
141
 	Creator            int64              `gorm:"column:creator" json:"creator" form:"creator"`
141
 	Creator            int64              `gorm:"column:creator" json:"creator" form:"creator"`
142
 	Modifier           int64              `gorm:"column:modifier" json:"modifier" form:"modifier"`
142
 	Modifier           int64              `gorm:"column:modifier" json:"modifier" form:"modifier"`
143
-	Diagnosis          int64              `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
143
+	Diagnosis          string             `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
144
 	RegisterType       int64              `gorm:"column:register_type" json:"register_type" form:"register_type"`
144
 	RegisterType       int64              `gorm:"column:register_type" json:"register_type" form:"register_type"`
145
 	Doctor             string             `gorm:"column:doctor" json:"doctor" form:"doctor"`
145
 	Doctor             string             `gorm:"column:doctor" json:"doctor" form:"doctor"`
146
 	Departments        string             `gorm:"column:departments" json:"departments" form:"departments"`
146
 	Departments        string             `gorm:"column:departments" json:"departments" form:"departments"`

+ 2 - 2
service/his_project_service.go View File

263
 }
263
 }
264
 
264
 
265
 func UpdateHisPrescriptionHisID(his_patient_id int64, patient_id int64, record_time int64, org_id int64) {
265
 func UpdateHisPrescriptionHisID(his_patient_id int64, patient_id int64, record_time int64, org_id int64) {
266
-	XTWriteDB().Model(&models.HisPrescription{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ?", record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
267
-	XTWriteDB().Model(&models.HisPrescriptionInfo{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ?", record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
266
+	XTWriteDB().Model(&models.HisPrescription{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ? AND his_patient_id = 0", record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
267
+	XTWriteDB().Model(&models.HisPrescriptionInfo{}).Where("record_date = ? AND user_org_id = ? AND patient_id = ?  AND his_patient_id = 0", record_time, org_id, patient_id).Updates(map[string]interface{}{"his_patient_id": his_patient_id})
268
 
268
 
269
 	return
269
 	return
270
 }
270
 }

+ 13 - 2
service/his_service.go View File

66
 	Mtime              int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
66
 	Mtime              int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
67
 	Creator            int64  `gorm:"column:creator" json:"creator" form:"creator"`
67
 	Creator            int64  `gorm:"column:creator" json:"creator" form:"creator"`
68
 	Modifier           int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
68
 	Modifier           int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
69
-	Diagnosis          int64  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
69
+	Diagnosis          string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
70
 	RegisterType       int64  `gorm:"column:register_type" json:"register_type" form:"register_type"`
70
 	RegisterType       int64  `gorm:"column:register_type" json:"register_type" form:"register_type"`
71
 	Doctor             string `gorm:"column:doctor" json:"doctor" form:"doctor"`
71
 	Doctor             string `gorm:"column:doctor" json:"doctor" form:"doctor"`
72
 	Departments        string `gorm:"column:departments" json:"departments" form:"departments"`
72
 	Departments        string `gorm:"column:departments" json:"departments" form:"departments"`
111
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
111
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
112
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
112
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
113
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
113
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
114
+	Diagnosis    string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
114
 }
115
 }
115
 
116
 
116
 func (VMHisOrder) TableName() string {
117
 func (VMHisOrder) TableName() string {
694
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
695
 	PackingPrice                float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
695
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
696
 	DrugDay                     string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
696
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
697
 	Total                       float64 `gorm:"column:total" json:"total" form:"total"`
698
+	PrescribingNumberUnit       string  `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
697
 
699
 
698
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
700
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
699
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
701
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
805
 
807
 
806
 }
808
 }
807
 
809
 
810
+func FindLastPatientPrescriptionInfoTwo(org_id int64, patient_id int64, record_date int64, p_type int64) (info models.HisPrescriptionInfo, err error) {
811
+	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date < ? AND patient_id = ? AND p_type = ? ", org_id, record_date, patient_id, p_type).First(&info).Error
812
+	return
813
+
814
+}
815
+
808
 func FindHisPatientPrescriptionInfo(org_id int64, patient_id int64, record_date int64, p_type int64, his_patient_id int64) (info models.HisPrescriptionInfo, err error) {
816
 func FindHisPatientPrescriptionInfo(org_id int64, patient_id int64, record_date int64, p_type int64, his_patient_id int64) (info models.HisPrescriptionInfo, err error) {
809
 	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ? AND his_patient_id = ? ", org_id, record_date, patient_id, p_type, his_patient_id).First(&info).Error
817
 	err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ? AND his_patient_id = ? ", org_id, record_date, patient_id, p_type, his_patient_id).First(&info).Error
810
 	return
818
 	return
913
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
921
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
914
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
922
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
915
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
923
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
924
+	Diagnosis    string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
916
 }
925
 }
917
 
926
 
918
 func (HisOrder) TableName() string {
927
 func (HisOrder) TableName() string {
953
 	Mtime                 int64                        `gorm:"column:mtime" json:"mtime" form:"mtime"`
962
 	Mtime                 int64                        `gorm:"column:mtime" json:"mtime" form:"mtime"`
954
 	Creator               int64                        `gorm:"column:creator" json:"creator" form:"creator"`
963
 	Creator               int64                        `gorm:"column:creator" json:"creator" form:"creator"`
955
 	Modifier              int64                        `gorm:"column:modifier" json:"modifier" form:"modifier"`
964
 	Modifier              int64                        `gorm:"column:modifier" json:"modifier" form:"modifier"`
956
-	Diagnosis             int64                        `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
965
+	Diagnosis             string                       `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
957
 	RegisterType          int64                        `gorm:"column:register_type" json:"register_type" form:"register_type"`
966
 	RegisterType          int64                        `gorm:"column:register_type" json:"register_type" form:"register_type"`
958
 	Doctor                string                       `gorm:"column:doctor" json:"doctor" form:"doctor"`
967
 	Doctor                string                       `gorm:"column:doctor" json:"doctor" form:"doctor"`
959
 	Departments           int64                        `gorm:"column:departments" json:"departments" form:"departments"`
968
 	Departments           int64                        `gorm:"column:departments" json:"departments" form:"departments"`
1109
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1118
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1110
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1119
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1111
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
1120
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
1121
+	Diagnosis    string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
1112
 }
1122
 }
1113
 
1123
 
1114
 func (XtHisOrder) TableName() string {
1124
 func (XtHisOrder) TableName() string {
1832
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1842
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1833
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1843
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1834
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
1844
 	IsPre        int64  `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
1845
+	Diagnosis    string `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
1835
 }
1846
 }
1836
 
1847
 
1837
 func (CustomInComeStatistics) TableName() string {
1848
 func (CustomInComeStatistics) TableName() string {

+ 23 - 22
service/self_drug_service.go View File

512
 }
512
 }
513
 
513
 
514
 type Drugs struct {
514
 type Drugs struct {
515
-	ID                 int64    `gorm:"column:id" json:"id" form:"id"`
516
-	DrugName           string   `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
517
-	Pinyin             string   `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
518
-	Wubi               string   `gorm:"column:wubi" json:"wubi" form:"wubi"`
519
-	DrugAlias          string   `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
520
-	DrugAliasPinyin    string   `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
521
-	DrugAliasWubi      string   `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
522
-	DrugCategory       int64    `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
523
-	DrugSpec           string   `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
524
-	DrugType           int64    `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
525
-	DrugStockLimit     string   `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
526
-	DrugStatus         string   `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
527
-	DeliveryWay        string   `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
528
-	ExecutionFrequency string   `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
529
-	SingleDose         float64  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
530
-	PrescribingNumber  float64  `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
531
-	Status             int64    `gorm:"column:status" json:"status" form:"status"`
532
-	OrgId              int64    `gorm:"column:org_id" json:"org_id" form:"org_id"`
533
-	MinUnit            string   `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
534
-	Drugs              []*Drugs `gorm:"ForeignKey:DrugName;AssociationForeignKey:DrugName" json:"drug_specs"`
535
-	HospApprFlag       int64    `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
536
-	LmtUsedFlag        int64    `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
515
+	ID                    int64    `gorm:"column:id" json:"id" form:"id"`
516
+	DrugName              string   `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
517
+	Pinyin                string   `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
518
+	Wubi                  string   `gorm:"column:wubi" json:"wubi" form:"wubi"`
519
+	DrugAlias             string   `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
520
+	DrugAliasPinyin       string   `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
521
+	DrugAliasWubi         string   `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
522
+	DrugCategory          int64    `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
523
+	DrugSpec              string   `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
524
+	DrugType              int64    `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
525
+	DrugStockLimit        string   `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
526
+	DrugStatus            string   `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
527
+	DeliveryWay           string   `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
528
+	ExecutionFrequency    string   `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
529
+	SingleDose            float64  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
530
+	PrescribingNumber     float64  `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
531
+	Status                int64    `gorm:"column:status" json:"status" form:"status"`
532
+	OrgId                 int64    `gorm:"column:org_id" json:"org_id" form:"org_id"`
533
+	MinUnit               string   `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
534
+	Drugs                 []*Drugs `gorm:"ForeignKey:DrugName;AssociationForeignKey:DrugName" json:"drug_specs"`
535
+	HospApprFlag          int64    `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
536
+	LmtUsedFlag           int64    `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
537
+	PrescribingNumberUnit string   `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
537
 }
538
 }
538
 
539
 
539
 func (Drugs) TableName() string {
540
 func (Drugs) TableName() string {