public static bool LoaumeDataTMP() { bool result = false; try { umeDataTMPList = IctusDBManager.GetAllUmeDataTMP(); if (umeDataTMPList != null && umeDataTMPList.Count() != 0) { result = true; } } catch (Exception exp) { ncLog.Exception("LoaumeDataTMP::" + exp.Message); } return(result); }
public static void InfoDifferentCIE() { Dictionary <long, List <umeDataTMP> > result = new Dictionary <long, List <umeDataTMP> >(); try { List <umeDataTMP> umeDataTMPList = IctusDBManager.GetAllUmeDataTMP(); if (umeDataTMPList == null || umeDataTMPList.Count() == 0) { ncLog.Error("InfoDifferentCIE::Null or empty umeDataTMPList!!"); return; } string msg = "ID,CIE1,Responsable1,CIE2, Responsable2"; Dictionary <long, List <umeDataTMP> > umeDataTMPMap = umeDataTMPList.GroupBy(x => x.inc_id).ToDictionary(y => y.Key, y => y.ToList()); if (umeDataTMPMap != null && umeDataTMPMap.Count() != 0) { foreach (KeyValuePair <long, List <umeDataTMP> > iter in umeDataTMPMap) { long pacienteID = iter.Key; List <string> cieGroup = iter.Value.Select(x => x.cie_codigo).Distinct().ToList(); if (cieGroup != null && cieGroup.Count() > 1) { msg += "\r\n" + pacienteID; int size = cieGroup.Count; int counter = 1; foreach (string iterCie in cieGroup) { if (size == 3) { if (counter == 2) { ++counter; continue; } } umeDataTMP dataFound = iter.Value.Where(x => x.cie_codigo == iterCie).FirstOrDefault(); msg += "," + iterCie + "," + dataFound.dim_responsable_nombre; ++counter; } msg += "," + iter.Value.FirstOrDefault().inc_sello_temporal.Year; } } } ncLog.Message(msg); } catch (Exception exp) { ncLog.Exception("InfoDifferentCIE::" + exp.Message); } }