Ejemplo n.º 1
0
        private void btn_Get_Click(object sender, EventArgs e)
        {
            string levelCode = ConfigurationManager.AppSettings["LevelCode"]; /*n次事業所コード*/

            try
            {
                IF_Service service = new IF_Service();

                var start    = dateTimePicker1.Value.ToString("yyyyMMdd");
                var end      = dateTimePicker2.Value.ToString("yyyyMMdd");
                var imgstart = dateTimePicker1.Value.AddMonths(-1).ToString("yyyy/MM/dd");
                var imgend   = dateTimePicker2.Value.ToString("yyyy/MM/dd");

                var setting = "";

                RetHospList = service.GetHospital().ToList();
                RetdocList  = service.GetDoctor().ToList();

                foreach (var conf in form_menu.SystemConfig)
                {
                    if ("RefDB_RS" == conf.Key)
                    {
                        setting = conf.Value;
                        break;
                    }
                }

                /*☆★↓↓↓2016/06/08 処理分岐用に事業所コード追加↓↓↓★☆*/
                //var reports = service.GetReport_Org(start, end, setting);
                var reports = service.GetReport_Org(start, end, setting, levelCode);
                /*☆★↑↑↑2016/06/08↑↑↑★☆*/

                var pro = "";
                foreach (var conf in form_menu.SystemConfig)
                {
                    if ("RefDB_PACS" == conf.Key)
                    {
                        setting = conf.Value;
                    }
                    if ("RefPro_PACS" == conf.Key)
                    {
                        pro = conf.Value;
                    }
                }

                var images = service.GetImageCnt_Org(imgstart, imgend, setting, pro);

                var noHos = "";
                var noDoc = "";

                List <Report> addData = new List <Report>();
                string        sHosp   = ConfigurationManager.AppSettings["ImageSpecial"];
                foreach (var rep in reports)
                {
                    if (sHosp.IndexOf(rep.HCd) < 0)
                    {
                        if (images != null)
                        {
                            foreach (var img in images)
                            {
                                if (rep.Modality == img.Modality &&
                                    img.PatID == rep.PatID &&
                                    img.StudyDate == rep.StudyDate)
                                {
                                    rep.ImageCnt = img.ImageCnt;
                                    break;
                                }
                            }
                        }
                    }

                    if (rep.ImageCnt > 0)
                    {
                        switch (rep.HCd)
                        {
                        case "ASE":
                            rep.AddImageFlg = rep.ImageCnt / 1000;

                            if (rep.ImageCnt - rep.AddImageFlg * 1000 == 0)
                            {
                                rep.AddImageFlg--;
                            }
                            break;

                        case "HKR":
                            if (rep.ImageCnt > 500)
                            {
                                rep.AddImageFlg = 1;
                            }
                            break;

                        default:
                            rep.AddImageFlg = rep.ImageCnt / 500;

                            if (rep.ImageCnt - rep.AddImageFlg * 500 == 0)
                            {
                                rep.AddImageFlg--;
                            }
                            break;
                        }
                    }

                    if (string.IsNullOrEmpty(GetHospCd(rep.HCd)))
                    {
                        if (noHos != "")
                        {
                            if (noHos.IndexOf(rep.HCd) < 0)
                            {
                                noHos += "," + rep.HCd;
                            }
                        }
                        else
                        {
                            noHos = rep.HCd;
                        }
                    }
                    if (string.IsNullOrEmpty(GetDocCd(rep.ReadCd)))
                    {
                        if (noDoc != "")
                        {
                            if (noDoc.IndexOf(rep.HCd) < 0)
                            {
                                noDoc += "," + rep.HCd;
                            }
                        }
                        else
                        {
                            noDoc = rep.HCd;
                        }

                        rep.PayFlg   = 0;
                        rep.ClaimFlg = 0;
                    }

                    var datas = service.GetReportOrderNos(rep.HCd, start, end).ToList();

                    if (!datas.Contains(rep.OrderNo))
                    {
                        addData.Add(rep);
                    }
                    //else
                    //    service.SetImageCnt(rep.HCd, rep);
                }

                if (!string.IsNullOrEmpty(noHos))
                {
                    MessageBox.Show("登録されていない施設が取り込まれています。\n\n" + noHos, "警告");
                }
                if (!string.IsNullOrEmpty(noDoc))
                {
                    MessageBox.Show("登録されていない読影医が記録されたオーダーが取り込まれています。\n\n" + noHos, "警告");
                }

                if (!service.SetReport("", addData.ToArray()))
                {
                    MessageBox.Show("取り込みに失敗いたしました。", "エラー", MessageBoxButtons.OK);
                }
                if (!service.SetReportHist("", addData.ToArray()))
                {
                    MessageBox.Show("取り込みに失敗いたしました。", "エラー", MessageBoxButtons.OK);
                }
                else
                {
                    LogUtil.Info(form_menu.form_login.UserRet.Name + " " + start + " " + end + "  サーバから取り込み");
                    MessageBox.Show("取り込みが完了いたしました。", "取り込み完了", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
        //ここから================================================イベント=========================================================

        /// <summary>
        /// ロードイベント
        /// </summary>
        private void Form_Edit_Load(object sender, EventArgs e)
        {
            IF_Service service = new IF_Service();

            RetHospList = service.GetHospital().ToList();

            AddCmbFacility();

            RetdocList = service.GetDoctor().ToList();

            DataTable table = new DataTable();

            table.Columns.Add("Display", typeof(string));
            table.Columns.Add("Value", typeof(string));

            table.Rows.Add("", "");
            foreach (var doc in RetdocList)
            {
                if (doc.IsVisible == "0")
                {
                    table.Rows.Add(doc.Name, doc.Name);
                }
            }

            WorkDoctor.DataSource    = table;
            WorkDoctor.ValueMember   = "Value";
            WorkDoctor.DisplayMember = "Display";
            SearchDoc.DataSource     = table;
            SearchDoc.ValueMember    = "Value";
            SearchDoc.DisplayMember  = "Display";

            DataTable table2 = new DataTable();

            table2.Columns.Add("Display", typeof(string));
            table2.Columns.Add("Value", typeof(string));
            DataTable table3 = new DataTable();

            table3.Columns.Add("Display", typeof(string));
            table3.Columns.Add("Value", typeof(string));

            table3.Rows.Add("", "");

            string[] modList = null;

            foreach (var conf in form_menu.SystemConfig)
            {
                if (conf.Key == "Modality")
                {
                    modList = conf.Value.Split(',');
                    break;
                }
            }

            for (int i = 0; i < modList.Length; i++)
            {
                string[] modVal = modList[i].Split(':');

                table2.Rows.Add(modVal[1], modVal[2]);
                table3.Rows.Add(modVal[1], modVal[2]);
            }

            Modality.DataSource     = table2;
            Modality.ValueMember    = "Value";
            Modality.DisplayMember  = "Display";
            SearchMod.DataSource    = table3;
            SearchMod.ValueMember   = "Value";
            SearchMod.DisplayMember = "Display";
        }
Ejemplo n.º 3
0
        public Form_OutPutAggregate()
        {
            InitializeComponent();

            IF_Service service = new IF_Service();

            RetHospList  = service.GetHospital().ToList();
            RetdocList   = service.GetDoctor().ToList();
            SystemConfig = service.GetSystemConfig().ToList();

            ModalityList    = new Dictionary <string, string>();
            ModalityDocList = new Dictionary <string, string>();
            HospDistMsts    = new List <HospDistMst>();

            string[] modList    = null;
            string[] modDocList = null;

            foreach (var conf in SystemConfig)
            {
                if (conf.Key == "Modality")
                {
                    modList = conf.Value.Split(',');
                }
                else if (conf.Key == "Modality_Doc")
                {
                    modDocList = conf.Value.Split(',');
                }
            }
            ModalityList = new Dictionary <string, string>();
            for (int i = 0; i < modList.Length; i++)
            {
                string[] modVal = modList[i].Split(':');

                ModalityList.Add(modVal[1], modVal[2]);
            }

            ModalityDocList = new Dictionary <string, string>();
            for (int i = 0; i < modDocList.Length; i++)
            {
                string[] modVal = modDocList[i].Split(':');

                ModalityDocList.Add(modVal[1], modVal[2]);
            }

            foreach (var hosp in RetHospList)
            {
                var         dat     = service.GetHospitalConfig(hosp.Cd);
                string[]    confs   = null;
                HospDistMst tmpData = new HospDistMst();
                tmpData.Hospital = hosp;

                for (int i = 0; i < dat.Length; i++)
                {
                    confs = null;

                    if (!String.IsNullOrEmpty(dat[i].Value))
                    {
                        switch (dat[i].Key)
                        {
                        case "Cost":
                            tmpData.Cost = dat[i].Value;
                            break;

                        case "Dist":
                            tmpData.Dist = dat[i].Value;
                            break;

                        default:
                            confs = dat[i].Value.Split('@');
                            break;
                        }
                    }

                    if (confs == null)
                    {
                        continue;
                    }

                    switch (dat[i].Key)
                    {
                    case "Hosp":
                        List <HospMst> list = new List <HospMst>();
                        foreach (var conf in confs)
                        {
                            var     datas = conf.Split(':');
                            HospMst mst   = new AggregateTool.HospMst();
                            mst.Target = datas[0];
                            var wheres = datas[1].Split(',');
                            mst.Where = wheres[0] + " " + wheres[1] + " '" + wheres[2] + "'";

                            list.Add(mst);
                        }
                        tmpData.Hosp = list.ToArray();
                        break;

                    case "Sheet":
                        List <ModarityMst> listMod = new List <ModarityMst>();
                        foreach (var conf in confs)
                        {
                            var         datas = conf.Split(':');
                            ModarityMst mst   = new ModarityMst();
                            mst.Sum    = datas[0];
                            mst.Target = datas[1];
                            var wheres = datas[2].Split(',');
                            mst.Where = wheres[0] + " " + wheres[1] + " '" + wheres[2] + "'";
                            if (datas.Length > 3)
                            {
                                mst.DocMod = datas[3];
                            }
                            listMod.Add(mst);
                        }
                        tmpData.Sheet = listMod.ToArray();
                        break;

                    case "Kaikei":
                        tmpData.Yayoi = confs;
                        break;

                    default:
                        continue;
                    }
                }

                HospDistMsts.Add(tmpData);
            }
        }