51 lines
2.2 KiB
Go
51 lines
2.2 KiB
Go
package service
|
|
|
|
import (
|
|
"fmt"
|
|
"hospital-admin-api/api/dao"
|
|
"hospital-admin-api/api/responses/orderPrescriptionResponse"
|
|
)
|
|
|
|
// OrderPrescriptionService 处方
|
|
type OrderPrescriptionService struct {
|
|
}
|
|
|
|
// GetOrderPrescriptionById 获取处方数据
|
|
func (r *OrderPrescriptionService) GetOrderPrescriptionById(OrderPrescriptionId int64) (u *orderPrescriptionResponse.OrderPrescription, err error) {
|
|
orderPrescriptionDao := dao.OrderPrescriptionDao{}
|
|
orderPrescription, err := orderPrescriptionDao.GetById(OrderPrescriptionId)
|
|
if orderPrescription == nil {
|
|
return nil, nil
|
|
}
|
|
|
|
u = &orderPrescriptionResponse.OrderPrescription{
|
|
OrderPrescriptionId: fmt.Sprintf("%d", orderPrescription.OrderPrescriptionId),
|
|
OrderInquiryId: fmt.Sprintf("%d", orderPrescription.OrderInquiryId),
|
|
DoctorId: fmt.Sprintf("%d", orderPrescription.DoctorId),
|
|
PatientId: fmt.Sprintf("%d", orderPrescription.PatientId),
|
|
FamilyId: fmt.Sprintf("%d", orderPrescription.FamilyId),
|
|
PharmacistId: fmt.Sprintf("%d", orderPrescription.PharmacistId),
|
|
PrescriptionStatus: orderPrescription.PrescriptionStatus,
|
|
PharmacistAuditStatus: orderPrescription.PrescriptionStatus,
|
|
PharmacistVerifyTime: orderPrescription.PharmacistVerifyTime,
|
|
PharmacistFailReason: orderPrescription.PharmacistFailReason,
|
|
PlatformAuditStatus: orderPrescription.PlatformAuditStatus,
|
|
PlatformFailTime: orderPrescription.PlatformFailTime,
|
|
PlatformFailReason: orderPrescription.PlatformFailReason,
|
|
IsAutoPharVerify: orderPrescription.IsAutoPharVerify,
|
|
DoctorCreatedTime: orderPrescription.DoctorCreatedTime,
|
|
ExpiredTime: orderPrescription.ExpiredTime,
|
|
VoidTime: orderPrescription.VoidTime,
|
|
IsDelete: orderPrescription.IsDelete,
|
|
PrescriptionCode: orderPrescription.PrescriptionCode,
|
|
DoctorName: orderPrescription.DoctorName,
|
|
PatientName: orderPrescription.PatientName,
|
|
PatientSex: orderPrescription.PatientSex,
|
|
PatientAge: orderPrescription.PatientAge,
|
|
DoctorAdvice: orderPrescription.DoctorAdvice,
|
|
CreatedAt: orderPrescription.CreatedAt,
|
|
UpdatedAt: orderPrescription.UpdatedAt,
|
|
}
|
|
return u, nil
|
|
}
|