public WebPreOrderList WebGetPreList(int hospid, string patid) { WebPreOrderList ret = new WebPreOrderList(); try { ServiceIF serv = new ServiceIF(); OrderTool_Serv.Class.Search search = new OrderTool_Serv.Class.Search(); search.HospID = hospid; search.PatID = patid; PreOrder[] tmpList = null; ResultData inRet = serv.GetPreOrder_Serv(search, out tmpList); if (inRet.Result) { if (string.IsNullOrEmpty(patid)) { LogControl.WriteLog(LogType.ORE, "WebGetPreList", "【オーダー候補一覧取得】 施設ID:" + hospid + " 件数:" + tmpList.Length); } else { LogControl.WriteLog(LogType.ORE, "WebGetPreList", "【オーダー候補取得】 施設ID:" + hospid + " 患者ID:" + patid + " 件数(過去含む):" + tmpList.Length); } ret.Items = tmpList; } else { ret.Message = inRet.Message; } ret.Result = inRet.Result; } catch (Exception e) { ret.Result = false; ret.Message = "処理中に障害が発生いたしました。\nシステム管理者にお問い合わせください。"; LogControl.WriteLog(LogType.ERR, "WebGetPreList", e.Message); } return(ret); }
public WebPreOrderList WebGetPreList(string patid, string date, string mod, int isCnt) { WebPreOrderList ret = new WebPreOrderList(); try { DicomQRItem[] studyDatas = null; List <PreOrder> tmpList = new List <PreOrder>(); string orderDir = ConfigurationManager.AppSettings["OrderDir"]; C_Find.Setting(); studyDatas = C_Find.C_FindFromStudy(patid, date, "", mod, ""); for (int i = 0; i < studyDatas.Length; i++) { StudyData tmpStudy = new StudyData(); tmpStudy.SetStudy(studyDatas[i].Tags); DicomQRItem[] tmpDat = C_Find.C_FindFromSeries(tmpStudy.UID); tmpStudy.SetSeries(tmpDat); if (isCnt == 1) { foreach (var dat in tmpDat) { tmpStudy.SetImages( C_Find.C_FindFromImages( tmpStudy.UID , dat.Tags[(uint)Tags.SERIES_INSTANCE_UID] ) ); } } if (tmpStudy.Modality.IndexOf(mod) < 0) { continue; } PreOrder tmp = new PreOrder(); if (tmpStudy.Tags.ContainsKey((uint)Tags.ACCSESSIONNO)) { tmp.OrderNo = tmpStudy.Tags[(uint)Tags.ACCSESSIONNO].Trim(); } else { tmp.OrderNo = tmpStudy.Tags[(uint)Tags.PATIENTID].Trim() + tmpStudy.Tags[(uint)Tags.STUDYDATE].Trim().Substring(2, 6) + tmpStudy.Modality; } if (File.Exists(Path.Combine(orderDir, tmp.OrderNo + ".csv"))) { PreOrder past = ReadCSV(Path.Combine(orderDir, tmp.OrderNo + ".csv")); tmp = past; } else { tmp.Status = 0; } tmp.PatID = tmpStudy.Tags[(uint)Tags.PATIENTID]; tmp.PatName = tmpStudy.Tags[(uint)Tags.PATIENTNAME]; if (tmpStudy.Tags.ContainsKey((uint)Tags.SEX)) { string dat = tmpStudy.Tags[(uint)Tags.SEX]; switch (dat.ToLower().Trim()) { case "m": case "male": tmp.Sex = 1; break; case "f": case "femail": tmp.Sex = 2; break; default: tmp.Sex = 0; break; } } else { tmp.Sex = 2; } if (tmpStudy.Tags.ContainsKey((uint)Tags.BIRTHDAY)) { tmp.BirthDay = tmpStudy.Tags[(uint)Tags.BIRTHDAY]; } tmp.Date = tmpStudy.Tags[(uint)Tags.STUDYDATE]; tmp.Time = tmpStudy.Tags[(uint)Tags.STUDYTIME]; if (tmpStudy.Tags.ContainsKey((uint)Tags.BODYPART)) { tmp.BodyPart = tmpStudy.Tags[(uint)Tags.BODYPART]; } if (tmpStudy.Tags.ContainsKey((uint)Tags.DESCRIPTION)) { tmp.Desc = tmpStudy.Tags[(uint)Tags.DESCRIPTION]; } tmp.Modality = tmpStudy.Modality; tmp.StudyInstanceUID = tmpStudy.UID; tmp.ImgCnt = tmpStudy.Cnt; tmpList.Add(tmp); } tmpList.Sort((a, b) => { return(-((a.Date + a.Time).CompareTo((b.Date + b.Time)))); }); ret.Items = tmpList.ToArray(); ret.Result = true; C_Find.Client.Close(); C_Find.Client = new DicomQRClient(); } catch (Exception e) { ret.Result = false; ret.Message = "処理中に障害が発生いたしました。\nシステム管理者にお問い合わせください。"; LogControl.WriteLog(LogType.ERR, "WebGetPreList", e.Message); LogControl.WriteLog(LogType.ERR, "WebGetPreList", e.StackTrace); C_Find.Client.Close(); C_Find.Client = new DicomQRClient(); } return(ret); }