抄方 处方列表处理
This commit is contained in:
@@ -37,6 +37,8 @@ type OrderPrescriptionDto struct {
|
||||
OrderPrescriptionIcd string `json:"order_prescription_icd"` // 处方诊断疾病
|
||||
OrderInquiryCase *OrderInquiryCaseDto `json:"order_inquiry_case"` // 问诊病例
|
||||
OrderPrescriptionProduct []*OrderPrescriptionProductDto `json:"order_prescription_product"` // 处方商品
|
||||
UserDoctor *UserDoctorDto `json:"user_doctor"` // 原始医生
|
||||
TransferUserDoctor *UserDoctorDto `json:"transfer_user_doctor"` // 接受抄方的医生
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
@@ -125,6 +127,16 @@ func GetOrderPrescriptionListDto(m []*model.OrderPrescription) []*OrderPrescript
|
||||
response = response.LoadOrderPrescriptionIcdString(v.OrderPrescriptionIcd)
|
||||
}
|
||||
|
||||
// 加载原始医生信息
|
||||
if v.OrderInquiry != nil && v.OrderInquiry.UserDoctor != nil {
|
||||
response = response.LoadUserDoctor(v.OrderInquiry.UserDoctor)
|
||||
}
|
||||
|
||||
// 加载接受抄方的医生信息
|
||||
if v.OrderInquiry != nil && v.OrderInquiry.TransferUserDoctor != nil {
|
||||
response = response.LoadTransferUserDoctor(v.OrderInquiry.TransferUserDoctor)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
@@ -205,3 +217,19 @@ func (r *OrderPrescriptionDto) LoadOrderProductId(m *model.OrderProduct) *OrderP
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadUserDoctor 加载原始医生信息
|
||||
func (r *OrderPrescriptionDto) LoadUserDoctor(m *model.UserDoctor) *OrderPrescriptionDto {
|
||||
if m != nil {
|
||||
r.UserDoctor = GetUserDoctorDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// LoadTransferUserDoctor 加载接受抄方的医生信息
|
||||
func (r *OrderPrescriptionDto) LoadTransferUserDoctor(m *model.UserDoctor) *OrderPrescriptionDto {
|
||||
if m != nil {
|
||||
r.TransferUserDoctor = GetUserDoctorDto(m)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user