/// <summary> /// Ctor /// </summary> /// <param name="number">Порядковый номер направления</param> /// <param name="code">Код направления NAZ_R</param> /// <param name="value">Код назначения, определяемый значением NAZ_R</param> DispAssignment(int number, int code, string value, NeoSuspectDirection neoSuspection) { Index = number; RouteCode = code; switch (code) { case 1: case 2: DoctorSpeciality = value; break; case 3: StudyKind = value; break; case 4: case 5: AidProfile = value; break; case 6: BedProfile = value; break; default: Lib.Logger.Log("Неверный код направления по результату диспансеризации: " + code.ToString()); break; } if (neoSuspection != null && neoSuspection.Suspected) { switch (RouteCode) { case 2: DirectionDate = neoSuspection.DirectionDate; TargetClinic = neoSuspection.TargetClinic; ServiceCode = neoSuspection.ServiceCode; break; case 3: TargetClinic = string.Empty; ServiceCode = neoSuspection.ServiceCode; break; default: TargetClinic = string.Empty; ServiceCode = string.Empty; break; } } }
/// <summary> /// Get collection of dispanserisation bound directions /// </summary> /// <param name="KSG">Direction code (МЭС1, PAT.KSG)</param> /// <param name="KSG2">Direction elaboration (МЭС2, KSG2)</param> /// <param name="neoSuspection">Onkology suspection direction's parameters</param> public static IEnumerable <DispAssignment> Make(string KSG, string KSG2, NeoSuspectDirection neoSuspection) { int number = 0; int code; string[] codes = KSG.Split('-'); string[] values = KSG2.Split('-'); int j = Math.Min(codes.Length, values.Length); for (int i = 0; i < j; ++i) { if (int.TryParse(codes[i], out code)) { ++number; yield return(new DispAssignment(number, code, values[i], neoSuspection)); } } }