|
@@ -1137,3 +1137,93 @@ func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error)
|
1137
|
1137
|
}
|
1138
|
1138
|
return
|
1139
|
1139
|
}
|
|
1140
|
+
|
|
1141
|
+type HisDoctorAdviceInfo struct {
|
|
1142
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
1143
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
1144
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
1145
|
+ AdviceDate int64 `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
|
|
1146
|
+ AdviceName string `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
|
|
1147
|
+ AdviceDesc string `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
|
|
1148
|
+ SingleDose float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
1149
|
+ SingleDoseUnit string `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
|
|
1150
|
+ PrescribingNumber float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
|
|
1151
|
+ PrescribingNumberUnit string `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
|
|
1152
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
1153
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
1154
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
1155
|
+ CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
|
|
1156
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
|
1157
|
+ DrugSpec float64 `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
|
|
1158
|
+ DrugSpecUnit string `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
|
|
1159
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
1160
|
+ Drug Drug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
|
|
1161
|
+}
|
|
1162
|
+
|
|
1163
|
+func (HisDoctorAdviceInfo) TableName() string {
|
|
1164
|
+ return "his_doctor_advice_info"
|
|
1165
|
+}
|
|
1166
|
+
|
|
1167
|
+type HisPrescriptionProject struct {
|
|
1168
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
1169
|
+ ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
|
1170
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
1171
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
1172
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
1173
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
|
1174
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
|
1175
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
1176
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
1177
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
|
1178
|
+ PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
|
1179
|
+ Count int64 `gorm:"column:count" json:"count" form:"count"`
|
|
1180
|
+ FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
|
1181
|
+ MedListCodg string `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
|
|
1182
|
+ SingleDose string `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
1183
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
1184
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
1185
|
+ Day string `gorm:"column:day" json:"day" form:"day"`
|
|
1186
|
+ VMHisProject VMHisProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
|
|
1187
|
+ Remark string `gorm:"column:remark" json:"remark" form:"remark"`
|
|
1188
|
+ Unit string `gorm:"column:unit" json:"unit" form:"unit"`
|
|
1189
|
+}
|
|
1190
|
+
|
|
1191
|
+func (HisPrescriptionProject) TableName() string {
|
|
1192
|
+ return "his_prescription_project"
|
|
1193
|
+}
|
|
1194
|
+
|
|
1195
|
+type HisOrderInfo struct {
|
|
1196
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
1197
|
+ OrderNumber string `gorm:"column:order_number" json:"order_number" form:"order_number"`
|
|
1198
|
+ UploadDate int64 `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
|
|
1199
|
+ AdviceId int64 `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
|
|
1200
|
+ DetItemFeeSumamt float64 `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
|
|
1201
|
+ Cnt float64 `gorm:"column:cnt" json:"cnt" form:"cnt"`
|
|
1202
|
+ Pric float64 `gorm:"column:pric" json:"pric" form:"pric"`
|
|
1203
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
1204
|
+ MedChrgitmType string `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
|
|
1205
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
1206
|
+ FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
|
1207
|
+ ChldMedcFlag string `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
|
|
1208
|
+ ChrgitmLv string `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
|
|
1209
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
1210
|
+ ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
|
1211
|
+ ItemId int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
|
|
1212
|
+ HisPrescriptionProject HisPrescriptionProject `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
|
|
1213
|
+ HisDoctorAdviceInfo HisDoctorAdviceInfo `gorm:"ForeignKey:ID;AssociationForeignKey:AdviceId" json:"advice"`
|
|
1214
|
+}
|
|
1215
|
+
|
|
1216
|
+func (HisOrderInfo) TableName() string {
|
|
1217
|
+ return "his_order_info"
|
|
1218
|
+}
|
|
1219
|
+
|
|
1220
|
+func GetHisOrderDetailByNumber(order_number string, org_id int64) (order []*HisOrderInfo, err error) {
|
|
1221
|
+ err = readDb.Model(&HisOrderInfo{}).Where("order_number = ? AND status = 1", order_number).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
|
|
1222
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).
|
|
1223
|
+ Preload("VMHisProject", "status = 1 AND user_org_id = ?", org_id)
|
|
1224
|
+ }).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
|
|
1225
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).
|
|
1226
|
+ Preload("Drug", "status = 1 AND user_org_id = ?", org_id)
|
|
1227
|
+ }).Find(&order).Error
|
|
1228
|
+ return
|
|
1229
|
+}
|