Exemplo n.º 1
0
        public string MOP_OutpDoctorQuery_LY(string InXml)
        {
            Log.AddTrace("-------------------------- MOP_OutpDoctorQuery 方法开始 ---------------------------------");
            Log.AddTrace("-------------------------- 源启入参:" + InXml + " ---------------------------------");
            Entity.RegisterDoctorInfo.YQ.request  request  = XmlSerializerHelper.XmlDeserialize <Entity.RegisterDoctorInfo.YQ.request>(InXml);
            Entity.RegisterDoctorInfo.YQ.response response = new Entity.RegisterDoctorInfo.YQ.response();
            string text = XmlSerializerHelper.XmlSerializer <RequestRegDoct>(new RequestRegDoct
            {
                TypeCodeList = request.ParentDeptCode,
                DeptCode     = request.DepartCode,
                Date         = request.Ext1,
                PactCode     = request.Ext2
            });

            Log.AddTrace("--------------------------  his接口(009)入参:" + text + " ---------------------------------");
            string text2 = HisAction.Process("009", text);

            Log.AddTrace("--------------------------  his接口(009)出参:" + text2 + " ---------------------------------");
            StringBuilder stringBuilder = new StringBuilder(text2);

            stringBuilder.Replace("</Err>", "</Err><Doctors>");
            stringBuilder.Replace("</ReponseRegDoct>", "</Doctors></ReponseRegDoct>");
            text2 = stringBuilder.ToString();
            ReponseRegDoct reponseRegDoct = XmlSerializerHelper.XmlDeserialize <ReponseRegDoct>(text2);

            if (reponseRegDoct.Result == 1)
            {
                List <Entity.RegisterDoctorInfo.YQ.data_row> list = new List <Entity.RegisterDoctorInfo.YQ.data_row>();
                response.returnresult.returncode = reponseRegDoct.Result;
                response.returnresult.errormsg   = reponseRegDoct.Err;
                new List <string>();
                foreach (Doctor doctor in reponseRegDoct.Doctors)
                {
                    Entity.RegisterDoctorInfo.YQ.data_row data_row = new Entity.RegisterDoctorInfo.YQ.data_row();
                    data_row.DepartCode    = doctor.DeptCode;
                    data_row.DeptName      = doctor.DeptName;
                    data_row.DoctorCode    = doctor.DoctorCode;
                    data_row.DoctorName    = doctor.DoctorName;
                    data_row.DoctorTitle   = doctor.ReglevelName;
                    data_row.TimeInterval  = doctor.Noon;
                    data_row.RegisterFee   = doctor.RegFee;
                    data_row.ClinicFee     = doctor.DiagFee;
                    data_row.Ext1          = doctor.SchemaID;
                    data_row.RegisterCount = doctor.Reged;
                    data_row.Ext2          = doctor.Wait;
                    data_row.Ext3          = doctor.RegLimit;
                    data_row.Ext4          = doctor.Reged;
                    if (string.IsNullOrEmpty(doctor.YbInMsg))
                    {
                        data_row.Ext5 = doctor.YbInMsg;
                    }
                    else
                    {
                        YBTranMsg ybcostCode = (YBTranMsg)HelperJson.GetObjectNew(doctor.YbInMsg, typeof(YBTranMsg));
                        data_row.Ext5 = HelperJson.GetJsonStringNew(ybcostCode);
                    }
                    DoctorDes multiEntity = this.cmmondSrv.GetMultiEntity <DoctorDes>(string.Format("select t.doctor_no,t.doctor_des from powerrst.hospital_doctor t where t.doctor_no='{0}'", data_row.DoctorCode));
                    if (multiEntity != null)
                    {
                        data_row.DoctorDes = multiEntity.doctor_des;
                    }
                    list.Add(data_row);
                }
                list          = list.OrderBy(a => a.DoctorCode).ThenBy(a => a.TimeInterval).ToList();
                response.data = list.ToArray();
            }
            else
            {
                response.returnresult.returncode = -1;
                response.returnresult.errormsg   = reponseRegDoct.Err;
            }
            string text3 = XmlSerializerHelper.XmlSerializer <Entity.RegisterDoctorInfo.YQ.response>(response);

            //Log.AddTrace("-------------------------- 源启出参:" + text3 + " ---------------------------------");
            Log.AddTrace("-------------------------- MOP_OutpDoctorQuery 方法结束 ---------------------------------");
            return(text3);
        }
Exemplo n.º 2
0
        public string MOP_RegisterGetDoctorSchedule(string InXml)
        {
            Log.AddTrace("-------------------------- MOP_OutpPartTimeQuery 方法开始 ---------------------------------");
            Log.AddTrace("-------------------------- 源启入参:" + InXml + " ---------------------------------");
            Entity.RegisterDoctorPartTimeInfo.YQ.request  request  = XmlSerializerHelper.XmlDeserialize <Entity.RegisterDoctorPartTimeInfo.YQ.request>(InXml);
            Entity.RegisterDoctorPartTimeInfo.YQ.response response = new Entity.RegisterDoctorPartTimeInfo.YQ.response();
            List <Doctor> list  = new List <Doctor>();
            string        text2 = XmlSerializerHelper.XmlSerializer <RequestRegDoct>(new RequestRegDoct
            {
                Date = DateTime.Now.ToString("yyyyMMdd"),
                //Date = "20191121",
                TypeCodeList = "01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18",
                DeptCode     = request.deptcode,
                PactCode     = "01"
            });

            Log.AddTrace("--------------------------  his接口(009)入参:" + text2 + " ---------------------------------");
            string text3 = HisAction.Process("009", text2);

            Log.AddTrace("--------------------------  his接口(009)出参:" + text3 + " ---------------------------------");
            StringBuilder stringBuilder = new StringBuilder(text3);

            stringBuilder.Replace("</Err>", "</Err><Doctors>");
            stringBuilder.Replace("</ReponseRegDoct>", "</Doctors></ReponseRegDoct>");
            text3 = stringBuilder.ToString();
            ReponseRegDoct reponseRegDoct = XmlSerializerHelper.XmlDeserialize <ReponseRegDoct>(text3);

            if (reponseRegDoct.Result == 1 && reponseRegDoct.Doctors != null && reponseRegDoct.Doctors.Length != 0)
            {
                list.AddRange(reponseRegDoct.Doctors);
            }
            if (list.Count > 0)
            {
                List <Entity.RegisterDoctorPartTimeInfo.YQ.data_row> list2 = new List <Entity.RegisterDoctorPartTimeInfo.YQ.data_row>();
                response.returnresult.returncode = 1;
                foreach (Doctor doctor in list)
                {
                    if (doctor.DoctorCode == request.doctorno && doctor.SchemaID == request.scheduleId && !string.IsNullOrEmpty(doctor.TimePoint))
                    {
                        string[] array = doctor.TimePoint.Split(new char[]
                        {
                            ','
                        });
                        for (int j = 0; j < array.Length; j++)
                        {
                            Entity.RegisterDoctorPartTimeInfo.YQ.data_row data_row = new Entity.RegisterDoctorPartTimeInfo.YQ.data_row();
                            data_row.DeptCode    = request.deptcode;
                            data_row.DeptName    = doctor.DeptName;
                            data_row.DoctorNo    = doctor.DoctorCode;
                            data_row.DoctorName  = doctor.DoctorName;
                            data_row.ScheduleId  = doctor.SchemaID;                   //排班ID
                            data_row.PartTimeId  = array[j].Split('|')[0];            //分时ID
                            data_row.DoctorNo    = doctor.DoctorCode;                 //医生编码
                            data_row.StartTime   = array[j].Split('|')[1];            //开始时间
                            data_row.EndTime     = array[j].Split('|')[2];            //结束时间
                            data_row.ClinicFee   = Convert.ToDecimal(doctor.DiagFee); //诊察费
                            data_row.RegisterFee = Convert.ToDecimal(doctor.RegFee);  //挂号费
                            data_row.Ext1        = doctor.BeginTime.Split(' ')[0];    //就诊日期
                            data_row.Ext2        = doctor.IsAppend;                   //是否加号
                            DateTime dateTime = Convert.ToDateTime(data_row.EndTime);
                            int      k        = DateTime.Compare(dateTime, DateTime.Now);
                            if (k > 0)
                            {
                                list2.Add(data_row);
                            }
                            //list2.Add(data_row);
                        }
                        //break;
                    }
                    if (doctor.DoctorCode == request.doctorno && doctor.SchemaID == request.scheduleId && doctor.IsAppend == "1")
                    {
                        Entity.RegisterDoctorPartTimeInfo.YQ.data_row data_row = new Entity.RegisterDoctorPartTimeInfo.YQ.data_row();
                        data_row.DeptCode   = request.deptcode;
                        data_row.DeptName   = doctor.DeptName;
                        data_row.DoctorNo   = doctor.DoctorCode;
                        data_row.DoctorName = doctor.DoctorName;
                        data_row.ScheduleId = doctor.SchemaID;   //排班ID
                        data_row.PartTimeId = "";                //分时ID
                        data_row.DoctorNo   = doctor.DoctorCode; //医生编码
                        switch (doctor.Noon)
                        {
                        case "1":
                            data_row.StartTime = "08:00";
                            data_row.EndTime   = "12:00";
                            break;

                        case "2":
                            data_row.StartTime = "14:00";
                            data_row.EndTime   = "18:00";
                            break;

                        case "3":
                            data_row.StartTime = "18:00";
                            data_row.EndTime   = "23:00";
                            break;
                        }
                        //data_row.EndTime = "+";//结束时间
                        data_row.ClinicFee   = Convert.ToDecimal(doctor.DiagFee); //诊察费
                        data_row.RegisterFee = Convert.ToDecimal(doctor.RegFee);  //挂号费
                        data_row.Ext1        = doctor.BeginTime.Split(' ')[0];    //就诊日期
                        data_row.Ext2        = doctor.IsAppend;                   //是否加号
                        data_row.Ext3        = doctor.IsAppend;                   //加号标识
                        list2.Add(data_row);
                    }
                }
                response.data = list2.ToArray();
            }
            else
            {
                response.returnresult.returncode = -1;
                response.returnresult.errormsg   = "获取医生分时信息失败";
            }
            string text4 = XmlSerializerHelper.XmlSerializer <Entity.RegisterDoctorPartTimeInfo.YQ.response>(response);

            //Log.AddTrace("-------------------------- 源启出参:" + text4 + " ---------------------------------");
            Log.AddTrace("-------------------------- MOP_OutpPartTimeQuery 方法结束 ---------------------------------");
            return(text4);
        }