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);
        }
        /// <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);
        }