药品、处方列表关联药房信息

This commit is contained in:
haomingming
2026-09-07 16:25:04 +08:00
parent 5f2baaace7
commit 3205005b9a
10 changed files with 224 additions and 1 deletions
+4
View File
@@ -31,12 +31,16 @@ type OrderPrescription struct {
PatientSex int `gorm:"column:patient_sex;type:tinyint(1);comment:患者性别-就诊人(1:男 2:女)" json:"patient_sex"`
PatientAge int `gorm:"column:patient_age;type:int(11);comment:患者年龄-就诊人" json:"patient_age"`
DoctorAdvice string `gorm:"column:doctor_advice;type:varchar(255);comment:医嘱" json:"doctor_advice"`
PharmacyId int64 `gorm:"column:pharmacy_id;type:bigint(19);default:0;comment:开方药房id" json:"pharmacy_id"`
PharmacyCode string `gorm:"column:pharmacy_code;type:varchar(64);comment:开方药房代码快照" json:"pharmacy_code"`
PharmacyName string `gorm:"column:pharmacy_name;type:varchar(100);comment:开方药房名称快照" json:"pharmacy_name"`
OrderInquiry *OrderInquiry `gorm:"foreignKey:OrderInquiryId;references:order_inquiry_id" json:"order_inquiry"` // 问诊订单
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
UserPharmacist *UserPharmacist `gorm:"foreignKey:PharmacistId;references:pharmacist_id" json:"user_pharmacist"` // 药师
UserPatient *UserPatient `gorm:"foreignKey:PatientId;references:patient_id" json:"user_patient"` // 患者
OrderPrescriptionIcd []*OrderPrescriptionIcd `gorm:"foreignKey:OrderPrescriptionId;references:order_prescription_id" json:"order_prescription_icd"` // 处方疾病
PatientFamily *PatientFamily `gorm:"foreignKey:FamilyId;references:family_id" json:"patient_family"` // 家庭成员
Pharmacy *Pharmacy `gorm:"foreignKey:PharmacyId;references:pharmacy_id" json:"pharmacy"` // 药房
Model
}
+4
View File
@@ -50,11 +50,15 @@ type OrderProduct struct {
ConsigneeNameMask string `gorm:"column:consignee_name_mask;type:varchar(150);comment:收货人姓名(掩码)" json:"consignee_name_mask"`
ConsigneeTel string `gorm:"column:consignee_tel;type:varchar(50);comment:收货人电话" json:"consignee_tel"`
ConsigneeTelMask string `gorm:"column:consignee_tel_mask;type:varchar(50);comment:收货人电话(掩码)" json:"consignee_tel_mask"`
PharmacyId int64 `gorm:"column:pharmacy_id;type:bigint(19);default:0;comment:发货药房id" json:"pharmacy_id"`
PharmacyCode string `gorm:"column:pharmacy_code;type:varchar(64);comment:发货药房代码快照" json:"pharmacy_code"`
PharmacyName string `gorm:"column:pharmacy_name;type:varchar(100);comment:发货药房名称快照" json:"pharmacy_name"`
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
OrderInquiry *OrderInquiry `gorm:"foreignKey:OrderInquiryId;references:order_inquiry_id" json:"order_inquiry"` // 问诊
UserPatient *UserPatient `gorm:"foreignKey:PatientId;references:patient_id" json:"user_patient"` // 患者
OrderPrescription *OrderPrescription `gorm:"foreignKey:OrderPrescriptionId;references:order_prescription_id" json:"order_prescription"` // 处方
OrderProductItem []*OrderProductItem `gorm:"foreignKey:OrderProductId;references:order_product_id" json:"order_product_item"` // 处方
Pharmacy *Pharmacy `gorm:"foreignKey:PharmacyId;references:pharmacy_id" json:"pharmacy"` // 药房
Model
}