Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            IF_Service serv = new IF_Service();

            string set     = "server=157.2.1.100;database=ProRadRSWebDB;uid=sa;pwd=tryfor;MultipleActiveResultSets=true";
            var    reports = serv.GetReport_Org("20170831", "20170831", set, "KHM");

            serv.GetHospital();
        }
Exemplo n.º 2
0
        public Form_EditHosp()
        {
            InitializeComponent();

            IF_Service service = new IF_Service();

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


            foreach (var hosp in RetHospList)
            {
                checkedListBox1.Items.Add(hosp.Name, true);
            }

            checkBox1.Checked = true;
        }
Exemplo n.º 3
0
        //ここから================================================イベント=========================================================

        /// <summary>
        /// ログインボタン
        /// </summary>
        private void Btn_Login_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(Txtbox_LoginId.Text))
            {
                MessageBox.Show("ログインIDを入力してください。");
                Txtbox_LoginId.Focus();
                return;
            }
            if (String.IsNullOrEmpty(Txtbox_Password.Text))
            {
                MessageBox.Show("パスワードを入力してください。");
                Txtbox_Password.Focus();
                return;
            }

            IF_Service service = new IF_Service();
            User       user    = new User();

            user = service.Login(Txtbox_LoginId.Text, Txtbox_Password.Text);

            if (user == null || String.IsNullOrEmpty(user.Cd))
            {
                MessageBox.Show("ID、パスワードを確認してください。");
                Txtbox_Password.Select();
                return;
            }

            UserRet = user;

            Form_Menu fm = new Form_Menu();

            fm.form_login = this;
            this.Visible  = false;
            ClearTextBoxText();
            fm.Show();
        }
Exemplo n.º 4
0
        /// <summary>
        /// コンボボックスに施設名称を追加するメソッド
        /// </summary>
        private void AddCmbFacility()
        {
            IF_Service service = new IF_Service();

            //コンボボックスに追加
            DataTable table  = new DataTable();
            DataTable table2 = new DataTable();

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

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

            foreach (var hosp in RetHospList)
            {
                table.Rows.Add(hosp.Name, hosp.Cd);
                table2.Rows.Add(hosp.Name, hosp.Cd);
                var      dat   = service.GetHospitalConfig(hosp.Cd);
                string[] confs = null;
                for (int i = 0; i < dat.Length; i++)
                {
                    if (dat[i].Key == "Hosp" && !String.IsNullOrEmpty(dat[i].Value))
                    {
                        confs = dat[i].Value.Split('@');
                    }
                    else if (dat[i].Key == "Dist" && !String.IsNullOrEmpty(dat[i].Value) && dat[i].Value == "1")
                    {
                        SysList.Add(hosp.Cd);
                    }
                }
                if (confs == null)
                {
                    continue;
                }

                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);
                }
                HospMst[hosp.Name_DB] = list.ToArray();
            }

            table.Rows.Add("システム連携施設", "SYSTEM");
            table.Rows.Add("システム連携施設 以外", "OTHER");


            Cmb_Facility.DataSource    = table;
            Cmb_Facility.ValueMember   = "Value";
            Cmb_Facility.DisplayMember = "Display";
            Office.DataSource          = table2;
            Office.ValueMember         = "Value";
            Office.DisplayMember       = "Display";

//            Cmb_Facility.SelectedIndex = -1;
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新ボタン
        /// </summary>
        private void Btn_DgvUpdate_Click(object sender, EventArgs e)
        {
            if (ShowResultDialog("更新を行ってよろしいですか?"))
            {
                List <Report> tmplistRep = new List <Report>();

                for (int i = 0; i < Dgv_InspectionResult.Rows.Count; i++)
                {
                    if (Dgv_InspectionResult.Rows[i].Cells[24].Value == "D")
                    {
                        continue;
                    }

                    Report rep = new Report();

                    if (Dgv_InspectionResult.Rows[i].Cells[0].Value != null)
                    {
                        rep.PayFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[0].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[1].Value != null)
                    {
                        rep.ClaimFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[1].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[4].Value != null)
                    {
                        rep.PatID = Dgv_InspectionResult.Rows[i].Cells[4].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[5].Value != null)
                    {
                        rep.PatName = Dgv_InspectionResult.Rows[i].Cells[5].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[6].Value != null)
                    {
                        rep.StudyDate = Dgv_InspectionResult.Rows[i].Cells[6].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[7].Value != null)
                    {
                        rep.Modality = Dgv_InspectionResult.Rows[i].Cells[7].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[8].Value != null)
                    {
                        rep.Accept = Dgv_InspectionResult.Rows[i].Cells[8].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[9].Value != null)
                    {
                        rep.BodyPart = Dgv_InspectionResult.Rows[i].Cells[9].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[10].Value != null)
                    {
                        rep.AddMGFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[10].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[11].Value != null)
                    {
                        rep.ReadDate = Dgv_InspectionResult.Rows[i].Cells[11].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[12].Value != null)
                    {
                        rep.ReadCd = Dgv_InspectionResult.Rows[i].Cells[12].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[13].Value != null)
                    {
                        rep.BodyPartFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[13].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[14].Value != null)
                    {
                        rep.PriorityFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[14].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[15].Value != null)
                    {
                        rep.ImageCnt = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[15].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[16].Value != null)
                    {
                        rep.AddImageFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[16].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[17].Value != null)
                    {
                        rep.MailFlg = Convert.ToInt32(Dgv_InspectionResult.Rows[i].Cells[17].Value);
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[18].Value != null)
                    {
                        rep.Contact = Dgv_InspectionResult.Rows[i].Cells[18].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[19].Value != null)
                    {
                        rep.OrderDetail = Dgv_InspectionResult.Rows[i].Cells[19].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[20].Value != null)
                    {
                        rep.Memo = Dgv_InspectionResult.Rows[i].Cells[20].Value.ToString();
                    }
                    rep.OrderNo = Dgv_InspectionResult.Rows[i].Cells[21].Value.ToString();
                    rep.HCd     = GetDBCd(Dgv_InspectionResult.Rows[i].Cells[22].Value.ToString());
                    if (Dgv_InspectionResult.Rows[i].Cells[23].Value != null)
                    {
                        rep.PhysicianName = Dgv_InspectionResult.Rows[i].Cells[23].Value.ToString();
                    }
                    if (Dgv_InspectionResult.Rows[i].Cells[26].Value != null)
                    {
                        rep.Department = Dgv_InspectionResult.Rows[i].Cells[26].Value.ToString();
                    }

                    if (rep.ReadCd == "テストオーダー")
                    {
                        rep.PayFlg   = 0;
                        rep.ClaimFlg = 0;
                    }

                    tmplistRep.Add(rep);
                }
                IF_Service service = new IF_Service();

                service.DelReport(HospCd, listRep.ToArray());

                if (service.SetReport(HospCd, tmplistRep.ToArray()))
                {
                    var end = dateTimePicker1.Value.ToString("yyyyMMdd");

                    LogUtil.Info(form_menu.form_login.UserRet.Name + " " + HospCd + " " + end + "  レポートデータ更新");
                    MessageBox.Show("レポートデータの更新が完了いたしました。", "完了", MessageBoxButtons.OK);
                    confirmationExit = true;
                    Btn_Search_Click(sender, e);
                }
                else
                {
                    MessageBox.Show("レポートデータの更新に失敗いたしました。", "エラー", MessageBoxButtons.OK);
                }
            }
        }
Exemplo n.º 6
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";
        }
Exemplo n.º 7
0
        //ここから------------------------------------------------ボタンクリック処理-----------------------------------------------
        /// <summary>
        /// 検索ボタン
        /// </summary>
        private void Btn_Search_Click(object sender, EventArgs e)
        {
            confirmationExit = true;
            Dgv_InspectionResult.Rows.Clear();
            lblCnt.Text = "";

            IF_Service service = new IF_Service();
            var        start   = Dtp_SearchDate.Value.ToString("yyyyMMdd");
            var        end     = dateTimePicker1.Value.ToString("yyyyMMdd");
            var        cd      = Cmb_Facility.SelectedValue.ToString();

            var dispCd = "";

            foreach (var hosp in RetHospList)
            {
                if (hosp.Cd == cd)
                {
                    dispCd = hosp.Name_DB;
                    break;
                }
            }

            HospCd = dispCd;

            Report[] retRep = null;
            //service.GetReport(dispCd, start, end, "");
            Report[] retHisRep = null;
            //= service.GetReportHist(dispCd, start, end, "");
            listRep    = new List <Report>();
            listHisRep = new List <Report>();
            //if (retRep != null)
            //    listRep.AddRange(retRep);
            //if (listHisRep != null)
            //    listHisRep.AddRange(retRep);

            var where = "";
            var mywhere = "";

            if (cd == "SYSTEM")
            {
                mywhere += " AND hcd IN (";

                var wh = "";

                foreach (var hosp in RetHospList)
                {
                    if (SysList.Contains(hosp.Cd))
                    {
                        if (!string.IsNullOrEmpty(wh))
                        {
                            wh += ",";
                        }

                        wh += "'";
                        wh += hosp.Name_DB;
                        wh += "'";
                    }
                }

                mywhere += wh;
                mywhere += ") ";
                dispCd   = "";
            }
            else if (cd == "OTHER")
            {
                mywhere += " AND hcd IN (";

                var wh = "";

                foreach (var hosp in RetHospList)
                {
                    if (!SysList.Contains(hosp.Cd))
                    {
                        if (!string.IsNullOrEmpty(wh))
                        {
                            wh += ",";
                        }

                        wh += "'";
                        wh += hosp.Name_DB;
                        wh += "'";
                    }
                }

                mywhere += wh;

                mywhere += ") ";
                dispCd   = "";
            }
            else
            {
                foreach (var hosp in RetHospList)
                {
                    if (HospMst.Keys.Contains(hosp.Name_DB))
                    {
                        foreach (var mst in HospMst[hosp.Name_DB])
                        {
                            if (mst.Target == cd)
                            {
                                where += " AND " + mst.Where;
                            }
                            else if (hosp.Name_DB == dispCd)
                            {
                                mywhere += " AND NOT " + mst.Where;
                            }
                        }

                        if (!string.IsNullOrEmpty(where))
                        {
                            if (!string.IsNullOrEmpty(SearchMod.SelectedValue.ToString()))
                            {
                                where += " AND Modality='" + SearchMod.SelectedValue.ToString() + "'";
                            }
                            if (!string.IsNullOrEmpty(SearchDoc.SelectedValue.ToString()))
                            {
                                where += " AND ReadCd='" + SearchDoc.SelectedValue.ToString() + "'";
                            }
                            Report[] tmp = service.GetReport(hosp.Name_DB, start, end, where);
                            if (tmp != null)
                            {
                                foreach (var t in tmp)
                                {
                                    if (string.IsNullOrEmpty(GetHospCd(t.HCd)))
                                    {
                                        continue;
                                    }
                                    listRep.Add(t);
                                }
                            }
                            tmp = service.GetReportHist(hosp.Name_DB, start, end, where);
                            if (tmp != null)
                            {
                                foreach (var t in tmp)
                                {
                                    if (string.IsNullOrEmpty(GetHospCd(t.HCd)))
                                    {
                                        continue;
                                    }
                                    listHisRep.Add(t);
                                }
                            }
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(SearchMod.SelectedValue.ToString()))
            {
                mywhere += " AND Modality='" + SearchMod.SelectedValue.ToString() + "'";
            }
            if (!string.IsNullOrEmpty(SearchDoc.SelectedValue.ToString()))
            {
                mywhere += " AND ReadCd='" + SearchDoc.SelectedValue.ToString() + "'";
            }

            retRep    = service.GetReport(dispCd, start, end, mywhere);
            retHisRep = service.GetReportHist(dispCd, start, end, mywhere);
            if (retRep != null)
            {
                foreach (var t in retRep)
                {
                    if (string.IsNullOrEmpty(GetHospCd(t.HCd)))
                    {
                        continue;
                    }
                    listRep.Add(t);
                }
            }
            if (retHisRep != null)
            {
                foreach (var t in retHisRep)
                {
                    if (string.IsNullOrEmpty(GetHospCd(t.HCd)))
                    {
                        continue;
                    }
                    listHisRep.Add(t);
                }
            }

            for (int i = 0; i < listRep.Count; i++)
            {
                Dgv_InspectionResult.Rows.Add();
                Dgv_InspectionResult.Rows[i].Cells[0].Value  = listRep[i].PayFlg;
                Dgv_InspectionResult.Rows[i].Cells[1].Value  = listRep[i].ClaimFlg;
                Dgv_InspectionResult.Rows[i].Cells[4].Value  = listRep[i].PatID;
                Dgv_InspectionResult.Rows[i].Cells[5].Value  = listRep[i].PatName;
                Dgv_InspectionResult.Rows[i].Cells[6].Value  = listRep[i].StudyDate;
                Dgv_InspectionResult.Rows[i].Cells[7].Value  = listRep[i].Modality;
                Dgv_InspectionResult.Rows[i].Cells[8].Value  = listRep[i].Accept;
                Dgv_InspectionResult.Rows[i].Cells[9].Value  = listRep[i].BodyPart;
                Dgv_InspectionResult.Rows[i].Cells[10].Value = listRep[i].AddMGFlg;
                Dgv_InspectionResult.Rows[i].Cells[11].Value = listRep[i].ReadDate;

                var isDoc = false;
                foreach (var doc in RetdocList)
                {
                    if (doc.Name == listRep[i].ReadCd)
                    {
                        Dgv_InspectionResult.Rows[i].Cells[12].Value = listRep[i].ReadCd;
                        isDoc = true;
                        break;
                    }
                }

                if (!isDoc)
                {
                    Dgv_InspectionResult.Rows[i].Cells[0].Value = false;
                    Dgv_InspectionResult.Rows[i].Cells[1].Value = false;
                }

                Dgv_InspectionResult.Rows[i].Cells[13].Value = listRep[i].BodyPartFlg;
                Dgv_InspectionResult.Rows[i].Cells[14].Value = listRep[i].PriorityFlg;
                Dgv_InspectionResult.Rows[i].Cells[15].Value = listRep[i].ImageCnt;
                Dgv_InspectionResult.Rows[i].Cells[16].Value = listRep[i].AddImageFlg;
                Dgv_InspectionResult.Rows[i].Cells[17].Value = listRep[i].MailFlg;
                Dgv_InspectionResult.Rows[i].Cells[18].Value = listRep[i].Contact;
                Dgv_InspectionResult.Rows[i].Cells[19].Value = listRep[i].OrderDetail;
                Dgv_InspectionResult.Rows[i].Cells[20].Value = listRep[i].Memo;
                Dgv_InspectionResult.Rows[i].Cells[21].Value = listRep[i].OrderNo;
                Dgv_InspectionResult.Rows[i].Cells[22].Value = GetHospCd(listRep[i].HCd);
                Dgv_InspectionResult.Rows[i].Cells[23].Value = listRep[i].PhysicianName;
                Dgv_InspectionResult.Rows[i].Cells[26].Value = listRep[i].Department;

                if (listRep[i].OrderNo.IndexOf("_C") > 0)
                {
                    Dgv_InspectionResult.Rows[i].DefaultCellStyle.BackColor = Color.LimeGreen;
                }
            }

            CheckData();

            lblCnt.Text = listRep.Count + " 件";
        }
Exemplo n.º 8
0
        public void LoadMaster()
        {
            IF_Service service = new IF_Service();

            SystemConfig = service.GetSystemConfig().ToList();
        }
Exemplo n.º 9
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)
            {
            }
        }
Exemplo n.º 10
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);
            }
        }
Exemplo n.º 11
0
        private string GetTargetReport_Child(HospDistMst Hosp)
        {
            IF_Service service = new IF_Service();

            ExtReports hospRep = new ExtReports();

            hospRep.Cd = Hosp.Hospital.Cd;

            List <ModReports> modLists = new List <ModReports>();

            var dispCd     = "";
            var childWhere = "";

            foreach (var mst in HospDistMsts)
            {
                if (mst.Hosp == null)
                {
                    continue;
                }

                foreach (var hos in mst.Hosp)
                {
                    if (hos.Target == Hosp.Hospital.Cd)
                    {
                        dispCd      = mst.Hospital.Name_DB;
                        childWhere += " AND " + hos.Where;
                    }
                }
            }

            foreach (var mod in ModalityList)
            {
                ModReports tmpReps = new ModReports();
                tmpReps.Mod = mod.Value;

                string modWhere = "";
                modWhere += " Modality = '" + mod.Key + "'";

                if (Hosp.Sheet != null)
                {
                    var isData = false;
                    foreach (var sheet in Hosp.Sheet)
                    {
                        if (sheet.Sum == mod.Key)
                        {
                            modWhere += " OR ( Modality = '" + sheet.Target + "'";
                            modWhere += " AND " + sheet.Where + ")";
                            isData    = true;
                        }
                    }
                    if (isData)
                    {
                        modWhere = " AND (" + modWhere + ")";
                    }
                    else
                    {
                        modWhere = " AND " + modWhere;
                    }

                    foreach (var sheet in Hosp.Sheet)
                    {
                        if (sheet.Target == mod.Key)
                        {
                            modWhere += " AND NOT " + sheet.Where;
                        }
                    }
                }
                else
                {
                    modWhere = " AND " + modWhere;
                }

                if (Hosp.Hosp != null)
                {
                    foreach (var mst in Hosp.Hosp)
                    {
                        modWhere += " AND NOT " + mst.Where;
                    }
                }

                tmpReps.Reports = service.GetReport(dispCd, start, end, childWhere + modWhere);

                if (tmpReps.Reports != null)
                {
                    tmpReps.Count  = tmpReps.Reports.Length;
                    hospRep.Count += tmpReps.Reports.Length;
                    modLists.Add(tmpReps);
                }
            }

            hospRep.ModReports = modLists.ToArray();

            HospReports.Add(hospRep);

            return(dispCd);
        }
Exemplo n.º 12
0
        /// <summary>
        ///   レポートデータ取得(親施設)
        /// </summary>
        /// <param name="Hosp"></param>
        private void GetTargetReport(HospDistMst Hosp)
        {
            IF_Service service = new IF_Service();

            ExtReports hospRep = new ExtReports();

            hospRep.Cd = Hosp.Hospital.Cd;

            List <ModReports> modLists = new List <ModReports>();

            foreach (var mod in ModalityList)
            {
                ModReports tmpReps = new ModReports();
                tmpReps.Mod = mod.Value;


                string modWhere = "";
                modWhere += " Modality = '" + mod.Key + "'";

                if (Hosp.Sheet != null)
                {
                    var isData = false;
                    foreach (var sheet in Hosp.Sheet)
                    {
                        if (sheet.Sum == mod.Key)
                        {
                            modWhere      += " OR ( Modality = '" + sheet.Target + "'";
                            modWhere      += " AND " + sheet.Where + ")";
                            tmpReps.DocMod = sheet.DocMod;

                            isData = true;
                        }
                    }
                    if (isData)
                    {
                        modWhere = " AND (" + modWhere + ")";
                    }
                    else
                    {
                        modWhere = " AND " + modWhere;
                    }

                    foreach (var sheet in Hosp.Sheet)
                    {
                        if (sheet.Target == mod.Key)
                        {
                            modWhere += " AND NOT " + sheet.Where;
                        }
                    }
                }
                else
                {
                    modWhere = " AND " + modWhere;
                }

                if (Hosp.Hosp != null)
                {
                    foreach (var mst in Hosp.Hosp)
                    {
                        modWhere += " AND NOT " + mst.Where;
                    }
                }

                tmpReps.Reports = service.GetReport(Hosp.Hospital.Name_DB, start, end, modWhere);

                if (tmpReps.Reports != null)
                {
                    tmpReps.Count  = tmpReps.Reports.Length;
                    hospRep.Count += tmpReps.Reports.Length;
                    modLists.Add(tmpReps);
                }
            }

            hospRep.ModReports = modLists.ToArray();

            HospReports.Add(hospRep);
        }