Beispiel #1
0
        /// <summary>
        /// 打印成药处方单
        /// </summary>
        public IActionResult PrintFormedPrescription(Guid?prescriptNo)
        {
            if (!prescriptNo.HasValue || prescriptNo == new Guid())
            {
                throw new Exception("请保存后打印");
            }
            var model = _treatSvr.GetPrescriptionDetail(prescriptNo);

            return(View(model));
        }
Beispiel #2
0
        public IActionResult GetPrescriptionDetail(Guid prescriptionGuid)
        {
            try
            {
                var dd = _treatSvr.GetPrescriptionDetail(prescriptionGuid);
                if (dd is CHIS.Models.ViewModel.PrintFormedModel)
                {
                    var rlt0 = (CHIS.Models.ViewModel.PrintFormedModel)dd;
                    var mmd  = rlt0.ahDtUtil().NewModel <Models.ViewModel.PrintFormedModel>(m => new
                    {
                        m.PrescriptionType,
                        m.Main.PrescriptionNo,
                        m.Main.Amount,
                        m.Main.ChargeStatus,
                        m.Treat.DoctorName,
                        m.RxDoctorName,
                        IsNeedRxSign     = m.Regist.RxDoctorId > 0,
                        IsRxDoctorSigned = !string.IsNullOrWhiteSpace(m.Main.RxDoctorSignUrl),
                        Main             = new
                        {
                            m.Treat.FirstTreatTime,
                            m.Treat.CustomerName,
                            CustomerGender = m.Treat.Gender,
                            m.Treat.TreatCustomerAge,
                            m.Treat.StationName,
                            m.Treat.DepartmentName,
                            m.Treat.Diagnosis1,
                            m.Treat.Diagnosis2,
                            IsDiagnosis1Unsure = m.Treat.FstIsDiag,
                            IsDiagnosis2Unsure = m.Treat.SecIsDiag,
                        },
                        Items = m.Detail.Select(a => new
                        {
                            a.DrugId,
                            a.DrugName,
                            a.DrugModel,
                            a.Qty,
                            a.UnitName,
                            a.GivenTakeTypeName,
                            a.GivenDays,
                            a.GivenDosage,
                            a.GivenNum,
                            a.GivenRemark,
                            a.GivenWhereTypeName,
                            a.GroupNum,
                            a.ManufacturerOrigin,
                            a.OriginPlace
                        }),
                        Additions = new
                        {
                            m.RxDoctorId,
                            m.Main.TreatId,
                            m.Main.RxDoctorSignUrl,
                            m.Main.DoctorSignUrl
                        }
                    });
                    var rlt = MyDynamicResult(mmd);
                    return(Ok(rlt));
                }
                if (dd is CHIS.Models.ViewModel.PrintHerbModel)
                {
                    var rlt0 = (CHIS.Models.ViewModel.PrintHerbModel)dd;
                    var mmd  = rlt0.ahDtUtil().NewModel <Models.ViewModel.PrintHerbModel>(m => new
                    {
                        m.PrescriptionType,
                        m.Main.PrescriptionNo,
                        m.Main.Amount,
                        m.Main.ChargeStatus,
                        m.Treat.DoctorName,
                        m.RxDoctorName,
                        IsNeedRxSign     = m.Regist.RxDoctorId > 0,
                        IsRxDoctorSigned = !string.IsNullOrWhiteSpace(m.Main.RxDoctorSignUrl),
                        Main             = new
                        {
                            m.Treat.FirstTreatTime,
                            m.Treat.CustomerName,
                            CustomerGender = m.Treat.Gender,
                            m.Treat.TreatCustomerAge,
                            m.Treat.StationName,
                            m.Treat.DepartmentName,
                            m.Treat.Diagnosis1,
                            m.Treat.Diagnosis2,
                            IsDiagnosis1Unsure = m.Treat.FstIsDiag,
                            IsDiagnosis2Unsure = m.Treat.SecIsDiag,

                            m.Main.HerbTitle,
                            m.Main.Qty,
                            m.Main.DoctorAdvice,
                            m.Main.GivenRemark,
                            m.Main.GivenTakeTypeName,
                        },
                        Items = m.Detail.Select(a => new
                        {
                            DrugId = a.CnHerbId,
                            a.DrugName,
                            a.Qty,
                            a.UnitName,
                            a.HerbUseTypeName,
                            a.HerbPackageNum,
                            a.HerbUseTypeId,
                            a.Trademark,
                            a.ManufacturerOrigin,
                            a.OriginPlace
                        }),
                        Additions = new
                        {
                            m.RxDoctorId,
                            m.Main.TreatId,
                            m.Main.RxDoctorSignUrl,
                            m.Main.DoctorSignUrl
                        }
                    });
                    var rlt = MyDynamicResult(mmd);
                    return(Ok(rlt));
                }
                throw new BeThrowComException("没有发现正确数据");
            }
            catch (Exception ex) { return(Ok(MyDynamicResult(ex))); }
        }