public List <AnalisiDTO> ChangeHL7StatusAndMessageAnalisis(List <string> analidids, string hl7_stato, string hl7_msg = null) { Stopwatch tw = new Stopwatch(); tw.Start(); List <AnalisiDTO> updateds = null; log.Info(string.Format("Starting ...")); string msg_ = "Status updating with 'hl7_stato'-> " + hl7_stato; if (hl7_msg != null) { msg_ += " and 'hl7_msg'-> " + hl7_msg; } log.Info(string.Format(msg_)); log.Info(string.Format("Updating ANAL ...")); List <AnalisiDTO> gots = GetAnalisisByIds(analidids); gots.ForEach(p => { p.hl7_stato = hl7_stato; p.hl7_msg = hl7_msg != null ? hl7_msg : p.hl7_msg; }); int analsres = 0; foreach (AnalisiDTO got_ in gots) { AnalisiDTO updt_ = UpdateAnalisi(got_); if (updt_ != null) { if (updateds == null) { updateds = new List <AnalisiDTO>(); } updateds.Add(updt_); analsres++; } else { log.Info(string.Format("An Error occurred. Record not updated! ANALIDID: {0}", got_.analidid)); } } log.Info(string.Format("Updated {0}/{1} record!", analsres, gots.Count)); tw.Stop(); log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed))); return(updateds); }
public AnalisiDTO RetrieveAnal(string analid) { Stopwatch tw = new Stopwatch(); tw.Start(); log.Info(string.Format("Starting ...")); AnalisiDTO anal = null; anal = bll.GetAnalisiById(analid); tw.Stop(); log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed))); return(anal); }
public int ChangeHL7StatusAndMessageAll(string richidid, string presidid, string hl7_stato, string hl7_msg = null) { Stopwatch tw = new Stopwatch(); tw.Start(); int res = 0; log.Info(string.Format("Starting ...")); string msg_ = "Status updating with 'hl7_stato'-> " + hl7_stato; if (hl7_msg != null) { msg_ += " and 'hl7_msg'-> " + hl7_msg; } log.Info(string.Format(msg_)); log.Info(string.Format("Updating ESAM ...")); RichiestaLISDTO got = GetRichiestaLISById(richidid); got.hl7_stato = hl7_stato; got.hl7_msg = hl7_msg != null ? hl7_msg : got.hl7_msg; RichiestaLISDTO updt = UpdateRichiestaLIS(got); int esamres = 0; if (updt != null) { esamres++; } else { log.Info(string.Format("An Error occurred. Record not updated! ESAMIDID: {0}", got.esamidid)); } res += esamres; log.Info(string.Format("Updated {0}/{1} record!", esamres, 1)); log.Info(string.Format("Updating PRES ...")); PrestazioneDTO got2 = GetPrestazioneById(presidid); got2.hl7_stato = hl7_stato; got2.hl7_msg = hl7_msg != null ? hl7_msg : got2.hl7_msg; PrestazioneDTO updt1 = UpdatePrestazione(got2); int presres = 0; if (updt1 != null) { presres++; } else { log.Info(string.Format("An Error occurred. Record not updated! PRESIDID: {0}", got2.presidid)); } res += presres; log.Info(string.Format("Updated {0}/{1} record!", presres, 1)); log.Info(string.Format("Updating ANAL ...")); List <AnalisiDTO> gots = GetAnalisisByRichiesta(richidid); gots.ForEach(p => { p.hl7_stato = hl7_stato; p.hl7_msg = hl7_msg != null ? hl7_msg : p.hl7_msg; }); int analsres = 0; foreach (AnalisiDTO got_ in gots) { AnalisiDTO updt_ = UpdateAnalisi(got_); if (updt_ != null) { analsres++; } else { log.Info(string.Format("An Error occurred. Record not updated! ANALIDID: {0}", got_.analidid)); } } res += analsres; log.Info(string.Format("Updated {0}/{1} record!", analsres, gots.Count)); log.Info(string.Format("Updated {0} record overall!", res)); tw.Stop(); log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed))); return(res); }
public int ChangeHL7StatusAndMessageAll(string richidid, string hl7_stato, string hl7_msg = null) { Stopwatch tw = new Stopwatch(); tw.Start(); int res = 0; log.Info(string.Format("Starting ...")); string msg_ = "Status updating with 'hl7_stato' -> " + hl7_stato; if (hl7_msg != null) { msg_ += " and 'hl7_msg' -> " + hl7_msg; } log.Info(string.Format(msg_)); log.Info(string.Format("Updating RICH ...")); RichiestaLISDTO got = GetRichiestaLISByIdExt(richidid); if (got == null) { log.Info(string.Format("An Error occurred. Rich bot found! IDExt: {0}", richidid)); tw.Stop(); log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed))); return(0); } string id = got.id.Value.ToString(); got.hl7_stato = hl7_stato; got.hl7_msg = hl7_msg != null ? hl7_msg : got.hl7_msg; RichiestaLISDTO updt = UpdateRichiestaLIS(got); int richres = 0; if (updt != null) { richres++; } else { log.Info(string.Format("An Error occurred. Record not updated! ID: {0}", got.id)); } res = richres; log.Info(string.Format("Updated {0}/{1} record!", richres, 1)); log.Info(string.Format("Updating ANAL ...")); List <AnalisiDTO> gots = GetAnalisisByRichiestaExt(richidid); gots.ForEach(p => { p.hl7_stato = hl7_stato; p.hl7_msg = hl7_msg != null ? hl7_msg : p.hl7_msg; }); int analsres = 0; foreach (AnalisiDTO got_ in gots) { AnalisiDTO updt_ = UpdateAnalisi(got_); if (updt_ != null) { analsres++; } else { log.Info(string.Format("An Error occurred. Record not updated! ANALIDID: {0}", got_.analidid)); } } res += analsres; log.Info(string.Format("Updated {0}/{1} record!", analsres, gots.Count)); log.Info(string.Format("Updated {0} record overall!", res)); tw.Stop(); log.Info(string.Format("Completed! Elapsed time {0}", LibString.TimeSpanToTimeHmsms(tw.Elapsed))); return(res); }