|
|
|
|
101
|
FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
101
|
FoundPrice float64 `gorm:"column:found_price" json:"found_price" form:"found_price"`
|
102
|
MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
102
|
MedicalInsurancePrice float64 `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
|
103
|
PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
103
|
PrivatePrice float64 `gorm:"column:private_price" json:"private_price" form:"private_price"`
|
|
|
104
|
+ Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
104
|
}
|
105
|
}
|
105
|
|
106
|
|
106
|
func (VMHisOrder) TableName() string {
|
107
|
func (VMHisOrder) TableName() string {
|
|
|
|
|
1125
|
return "xt_his_project"
|
1126
|
return "xt_his_project"
|
1126
|
}
|
1127
|
}
|
1127
|
|
1128
|
|
|
|
1129
|
+type VMHisPrescriptionTwo struct {
|
|
|
1130
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
|
1131
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
|
1132
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
|
1133
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
|
1134
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
|
|
1135
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
|
|
1136
|
+ Type int64 `gorm:"column:type" json:"type" form:"type"`
|
|
|
1137
|
+}
|
|
|
1138
|
+
|
|
|
1139
|
+func (VMHisPrescriptionTwo) TableName() string {
|
|
|
1140
|
+ return "his_prescription"
|
|
|
1141
|
+}
|
|
|
1142
|
+
|
1128
|
func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
|
1143
|
func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
|
1129
|
err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
|
1144
|
err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
|
1130
|
for _, item := range project {
|
1145
|
for _, item := range project {
|
|
|
|
|
1156
|
RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
1171
|
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"`
|
1172
|
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"`
|
1173
|
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"`
|
|
|
|
|
1174
|
+ PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
|
|
1175
|
+
|
|
|
1176
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
|
1177
|
+ DrugId int64 `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
|
|
|
1178
|
+ Drug Drug `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
|
|
|
1179
|
+ VMHisPrescriptionTwo VMHisPrescriptionTwo `gorm:"ForeignKey:ID;AssociationForeignKey:PrescriptionId" json:"prescription"`
|
1161
|
}
|
1180
|
}
|
1162
|
|
1181
|
|
1163
|
func (HisDoctorAdviceInfo) TableName() string {
|
1182
|
func (HisDoctorAdviceInfo) TableName() string {
|
|
|
|
|
1165
|
}
|
1184
|
}
|
1166
|
|
1185
|
|
1167
|
type HisPrescriptionProject struct {
|
1186
|
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"`
|
|
|
|
|
1187
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
|
1188
|
+ ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
|
|
1189
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
|
1190
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
|
1191
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
|
1192
|
+ Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
|
|
|
1193
|
+ Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
|
|
|
1194
|
+ PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
|
|
|
1195
|
+ HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
|
|
|
1196
|
+ RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
|
|
|
1197
|
+ PrescriptionId int64 `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
|
|
|
1198
|
+ Count int64 `gorm:"column:count" json:"count" form:"count"`
|
|
|
1199
|
+ FeedetlSn string `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
|
|
|
1200
|
+ MedListCodg string `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
|
|
|
1201
|
+ SingleDose string `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
|
1202
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
|
1203
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
|
1204
|
+ Day string `gorm:"column:day" json:"day" form:"day"`
|
|
|
1205
|
+ VMHisProject VMHisProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
|
|
|
1206
|
+ Remark string `gorm:"column:remark" json:"remark" form:"remark"`
|
|
|
1207
|
+ Unit string `gorm:"column:unit" json:"unit" form:"unit"`
|
|
|
1208
|
+ VMHisPrescriptionTwo VMHisPrescriptionTwo `gorm:"ForeignKey:ID;AssociationForeignKey:PrescriptionId" json:"prescription"`
|
1189
|
}
|
1209
|
}
|
1190
|
|
1210
|
|
1191
|
func (HisPrescriptionProject) TableName() string {
|
1211
|
func (HisPrescriptionProject) TableName() string {
|
|
|
|
|
1219
|
|
1239
|
|
1220
|
func GetHisOrderDetailByNumber(order_number string, org_id int64) (order []*HisOrderInfo, err error) {
|
1240
|
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 {
|
1241
|
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)
|
|
|
|
|
1242
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("VMHisPrescriptionTwo", "status = 1 AND user_org_id = ?", org_id).Preload("VMHisProject", "status = 1 AND user_org_id = ?", org_id)
|
1224
|
}).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
|
1243
|
}).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)
|
|
|
|
|
1244
|
+ return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("VMHisPrescriptionTwo", "status = 1 AND user_org_id = ?", org_id).Preload("Drug", "status = 1 AND org_id = ?", org_id)
|
1227
|
}).Find(&order).Error
|
1245
|
}).Find(&order).Error
|
1228
|
return
|
1246
|
return
|
1229
|
}
|
1247
|
}
|