///<summary>Refreshes the list of radiology orders showing with the rad orders associated to the user passed in.</summary> public void RefreshRadOrdersForUser(Userod user) { _listNonCpoeProcs.Clear(); _listAppointments.Clear(); _listPats.Clear(); if (user == null) { FillGrid(); //Nothing to show the user. return; } _user = user; //Add all non-CPOE radiology procedures _listNonCpoeProcs = Procedures.GetProcsNonCpoeAttachedToApptsForProv(_user.ProvNum); //Keep a deep copy of the procedure code cache around for ease of use. _listProcCodes = ProcedureCodes.GetListDeep(); //This list of appointments can be enhanced to include many more appointments when needed. _listAppointments = Appointments.GetMultApts(_listNonCpoeProcs.Select(x => x.AptNum).Distinct().ToList()); //This list of patients can be enhanced to include many more pat nums when needed. _listPats = Patients.GetLimForPats(_listNonCpoeProcs.Select(x => x.PatNum).Distinct().ToList()); FillGrid(); }
private void FormTreatPlanCurEdit_Load(object sender, EventArgs e) { if (TreatPlanCur == null || (TreatPlanCur.TPStatus != TreatPlanStatus.Active && TreatPlanCur.TPStatus != TreatPlanStatus.Inactive)) { throw new Exception("No treatment plan loaded."); } _treatPlanUnassigned = TreatPlans.GetUnassigned(TreatPlanCur.PatNum); this.Text = TreatPlanCur.Heading + " - {" + Lans.g(this, TreatPlanCur.TPStatus.ToString()) + "}"; _listTpAttachesAll = TreatPlanAttaches.GetAllForPatNum(TreatPlanCur.PatNum); _listTpAttachesCur = _listTpAttachesAll.FindAll(x => x.TreatPlanNum == TreatPlanCur.TreatPlanNum); _listTpProcsAll = Procedures.GetProcsByStatusForPat(TreatPlanCur.PatNum, new[] { ProcStat.TP, ProcStat.TPi }); ProcedureLogic.SortProcedures(ref _listTpProcsAll); _listTpProcsCur = _listTpProcsAll.FindAll(x => _listTpAttachesCur.Any(y => x.ProcNum == y.ProcNum) || (TreatPlanCur.TPStatus == TreatPlanStatus.Active && (x.AptNum > 0 || x.PlannedAptNum > 0))); _listAppointments = Appointments.GetMultApts(_listTpProcsAll.SelectMany(x => new[] { x.AptNum, x.PlannedAptNum }).Distinct().Where(x => x > 0).ToList()); textHeading.Text = TreatPlanCur.Heading; textNote.Text = TreatPlanCur.Note; FillGrids(); if (TreatPlanCur.TPStatus == TreatPlanStatus.Inactive && TreatPlanCur.Heading == Lan.g("TreatPlan", "Unassigned")) { gridTP.Title = Lan.g("TreatPlan", "Unassigned Procedures"); labelHeading.Visible = false; textHeading.Visible = false; labelNote.Visible = false; textNote.Visible = false; gridAll.Visible = false; butLeft.Visible = false; butRight.Visible = false; butOK.Enabled = false; butDelete.Visible = false; } if (TreatPlanCur.TPStatus == TreatPlanStatus.Active) { butMakeActive.Enabled = false; butDelete.Enabled = false; } comboPlanType.Items.AddRange(Enum.GetNames(typeof(TreatPlanType))); comboPlanType.SelectedIndex = (int)TreatPlanCur.TPType; }