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); }
private bool CheckMod(out string msg_1, out string msg_2) { bool ret = true; msg_1 = ""; msg_2 = ""; foreach (var hosp in HospDistMsts) { List <string> cntMods = new List <string>(); List <string> setMods = new List <string>(); if (hosp.Yayoi == null || hosp.Yayoi.Length < 5) { continue; } ExtReports val = new ExtReports(); val.ModReports = new List <ModReports>().ToArray(); foreach (var tmp in HospReports) { if (tmp.Cd == hosp.Hospital.Cd) { val = tmp; break; } } string hoscd = hosp.Yayoi[0]; string hosname = hosp.Yayoi[1]; string hosname_S = hosp.Yayoi[2]; string cost = hosp.Yayoi[3]; List <KaikeiMst> YList = new List <KaikeiMst>(); for (int i = 4; i < hosp.Yayoi.Length; i++) { KaikeiMst tmp = new KaikeiMst(); List <string> vals = hosp.Yayoi[i].Split(':').ToList(); if (String.IsNullOrEmpty(vals[0])) { continue; } tmp.No = Convert.ToInt32(vals[0]); vals.RemoveAt(0); tmp.Values = vals.ToArray(); if (tmp.Values.Length < 5) { continue; } if (tmp.Values[4] != "1" && tmp.Values[4] != "5") { continue; } setMods.Add(tmp.Values[5]); } for (var i = 0; i < val.ModReports.Length; i++) { if (val.ModReports[i].Count > 0) { cntMods.Add(val.ModReports[i].Mod); } } string tmpstr = ""; if (setMods.Count > cntMods.Count) { foreach (var mod in setMods) { if (!cntMods.Contains(mod)) { if (!string.IsNullOrEmpty(tmpstr)) { tmpstr += ","; } tmpstr += mod; } } msg_2 += "【" + hosp.Hospital.Name_DB + "】 " + tmpstr + "\n"; ret = false; } else if (cntMods.Count > setMods.Count) { foreach (var mod in cntMods) { if (!setMods.Contains(mod)) { if (!string.IsNullOrEmpty(tmpstr)) { tmpstr += ","; } tmpstr += mod; } } msg_1 += "【" + hosp.Hospital.Name_DB + "】 " + tmpstr + "\n"; ret = false; } } return(ret); }
/// <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); }